parrt/antlr4 — pull request #101 by sharwell (2012-10-22 03:09:11+00:00)
Title: Ordered alternatives in the lexer

Lexer uses strictly-ordered alternatives within a rule.

* Simplifies code
* Increases performance when non-terminal (lexer rules) depth is limited
* Actually fixes greedy/non-greedy behavior

Operation is simple based on the following principles:

* Use depth-first search in `closure`, following higher-priority paths first
* Stop the closure operation for a rule when an accept state is reached - all remaining configs for this rule have a lower priority than the one which already reached an accept state