tunnelvisionlabs / antlr4

The highly-optimized fork of ANTLR 4 (see README)
Other
73 stars 12 forks source link

Left recursive rule cannot specify baseContext #46

Closed sharwell closed 5 years ago

sharwell commented 5 years ago

Code generation fails unexpectedly for the following grammar.

expression
  : ID
  : expression '+' expression
  ;

expression2
options { baseContext = expression; }
  : NUMBER
  : expression2 '+' expression2
  ;

ID : [a-z]+;
NUMBER : [0-9]+;