ANTLR generates methods for rules that are too complex/large for my compiler. What can I do?

Terence Parr

You can break up your large rule into a chain instead of one big alternative list like the following:

a : T1 | T2 | T3 | b ;

b : T4 | T5 | T6 | c ;

c : T7 ;
That will result in the same language being matched but with a simpler (and slightly slower) grammar.
About | Sitemap | Contact