Antlr - Parsing Multiline #define for C.g4
问题 I am using Antlr4 to parse C code. I want to parse multiline #defines alongwith C.g4 provided in C.g4 But the grammar mentioned in the link above does not support preprocessor directives, so I have added the following new rules to support preprocessing. Link to my previous question Whitespace : [ \t]+ -> channel(HIDDEN) ; Newline : ( '\r' '\n'? | '\n' ) -> channel(HIDDEN) ; BlockComment : '/*' .*? '*/' ; LineComment : '//' ~[\r\n]* ; IncludeBlock : '#' Whitespace? 'include' ~[\r\n]* ;