What happened to the options in the rules in ANTLR 4?

This does not compile in ANTLR 4:

Number options { backtrack=true; } : (IntegerLiteral Range)=> IntegerLiteral { $type = IntegerLiteral; } | (FloatLiteral)=> FloatLiteral { $type = FloatLiteral; } | IntegerLiteral { $type = IntegerLiteral; } ; 

due to backtrace = true ... What happened to him?

What should I use in ANTLR 4?

+4
source share
1 answer

There are currently no rule level parameters in ANTLR v4. Note that backtrack=true no longer required since the new parsing algorithm does not need backtracking. Also note that in ANTLR v3 backtrack=true not valid in lexer rules, only parser rules.

+3
source

All Articles