make newline optional member of a statement
This commit is contained in:
parent
7758b76c7d
commit
9b46389801
|
@ -6,7 +6,7 @@ grammar CommentMacro;
|
||||||
|
|
||||||
prog : statement+ EOF ;
|
prog : statement+ EOF ;
|
||||||
|
|
||||||
statement : macro (':' macro)* NEWLINE
|
statement : macro (':' macro)* NEWLINE?
|
||||||
| NEWLINE
|
| NEWLINE
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -70,6 +70,9 @@ number : NUMBER ;
|
||||||
** LEXAR Rules
|
** LEXAR Rules
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
fragment DIGIT : [0-9] ;
|
||||||
|
NUMBER : DIGIT+ ('.' DIGIT+)? ;
|
||||||
|
|
||||||
SLASH : '/' ;
|
SLASH : '/' ;
|
||||||
THRU : '>' ;
|
THRU : '>' ;
|
||||||
NEXT : '+' ;
|
NEXT : '+' ;
|
||||||
|
@ -81,11 +84,8 @@ WHOLEHOG : [hH] ;
|
||||||
DP8K : [dD] ;
|
DP8K : [dD] ;
|
||||||
IOP : 'IOP';
|
IOP : 'IOP';
|
||||||
|
|
||||||
fragment DIGIT : [0-9] ;
|
NEWLINE : '\r'? '\n' ; // return newlines to parser
|
||||||
NUMBER : DIGIT+ ('.' DIGIT+)? ;
|
WS : [ \t]+ -> skip ; // ignore whitespace
|
||||||
|
|
||||||
NEWLINE : '\r'? '\n' ; // return newlines to parser
|
|
||||||
WS : [ \t]+ -> skip ; // ignore whitespace
|
|
||||||
|
|
||||||
COMMENT // toss c and HTML sytle block comments
|
COMMENT // toss c and HTML sytle block comments
|
||||||
: ( '<!--' .*? '-->'
|
: ( '<!--' .*? '-->'
|
||||||
|
|
Loading…
Reference in New Issue