sharwell / antlr4

Other
16 stars 6 forks source link

Integrate semantic predicate evaluation with the DFA #3

Open sharwell opened 12 years ago

sharwell commented 12 years ago

The result of semantic predicate evaluation can be incorporated into the DFA edge tables similar to the way full-context transitions are included. This will allow early evaluation of the predicates inside of execDFA, which opens the possibility of using predicate evaluation to reduce lookahead requirements.

sharwell commented 12 years ago

Fixed in sharwell/antlr4@6218a49a2e. No performance impact on grammars without predicates. Appears to have minimal impact on grammars with LR rules as the only predicates (slight performance hit, slight memory improvement from fewer ATNConfig instances). Not yet tested on grammars with more complicated user predicates.