python like grammar antlr with semicolons -
i trying write grammar python-like language in antlr, language looks this:
if condition: if condition: pass; if condtion: pass; if condtion: pass; pass; if condtion: pass; my problem can't find blocks spaces. want know if there way implement without writing code in grammar?
if remember correctly, did create stack of white space in lexer of course requires actions in lexer.
another way handle create character stream processor sends unicode 16 characters not 8 bit lexer. then, use special bit patterns indicate character nesting depth. lexer can send indent , dedent tokens parser.
Comments
Post a Comment