|
|
@ -8,11 +8,12 @@ |
|
|
|
# |
|
|
|
start <- ( Line )+ EndOfFile |
|
|
|
Line <- LineType EndOfLine |
|
|
|
/ < [^\r\n]+ > EndOfLine {fprintf(stderr, "grammar parser error at line %i (error at '%s')\n", parser_state.lineno, yytext); exit(EXIT_FAILURE); } |
|
|
|
# / < [^\r\n]+ > EndOfLine {fprintf(stderr, "grammar parser error at line %i (error at '%s')\n", parser_state.lineno, yytext); exit(EXIT_FAILURE); } |
|
|
|
LineType <- TagLine |
|
|
|
/ ModeLine |
|
|
|
/ CommentLine |
|
|
|
/ IncludeLine |
|
|
|
/ CommentLine |
|
|
|
/ SpaceLine |
|
|
|
CommentLine <- '#' < ( !EndOfLine .)* > { commentline(); } |
|
|
|
|
|
|
|
IncludeLine <- 'include' OpenBracket < Path > ClosingBracket { set_include ( yytext ); } |
|
|
@ -20,7 +21,7 @@ IncludeLine <- 'include' OpenBracket < Path > ClosingBracket { set_include |
|
|
|
SlashorBackslash <- '/' |
|
|
|
/ '\\' |
|
|
|
|
|
|
|
Path <- ( SlashorBackslash (Subpath)+ )+ |
|
|
|
Path <- ( Subpath )+ |
|
|
|
|
|
|
|
Subpath <- [A-Z] |
|
|
|
/ [a-z] |
|
|
@ -28,6 +29,7 @@ Subpath <- [A-Z] |
|
|
|
/ '.' |
|
|
|
/ '_' |
|
|
|
/ '-' |
|
|
|
/ SlashorBackslash |
|
|
|
|
|
|
|
|
|
|
|
ModeLine <- 'mode' OpenBracket < Mode > ClosingBracket { int i = i_pop(); set_mode( i ); } |
|
|
|