diff --git a/CommentMacro.g4 b/CommentMacro.g4 index 4cb21ab..01a2177 100644 --- a/CommentMacro.g4 +++ b/CommentMacro.g4 @@ -6,7 +6,7 @@ grammar CommentMacro; prog : statement+ EOF ; -statement : macro (':' macro)* NEWLINE +statement : macro (':' macro)* NEWLINE? | NEWLINE ; @@ -70,6 +70,9 @@ number : NUMBER ; ** LEXAR Rules **/ +fragment DIGIT : [0-9] ; +NUMBER : DIGIT+ ('.' DIGIT+)? ; + SLASH : '/' ; THRU : '>' ; NEXT : '+' ; @@ -81,11 +84,8 @@ WHOLEHOG : [hH] ; DP8K : [dD] ; IOP : 'IOP'; -fragment DIGIT : [0-9] ; -NUMBER : DIGIT+ ('.' DIGIT+)? ; - -NEWLINE : '\r'? '\n' ; // return newlines to parser -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 : ( ''