History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ANTLR-91
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Terence Parr
Reporter: Terence Parr
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ANTLR v3

inline vs table driven DFA bug

Created: 08/Mar/07 11:04 AM   Updated: 14/Mar/07 03:18 PM
Component/s: ANTLR Core
Affects Version/s: 3.0b6
Fix Version/s: 3.0b7


 Description  « Hide
Vadim from Oracle says:
Thanks again for providing me with
GEN_ACYCLIC_DFA_INLINE = false
which allowed me to scale my grammar up. Unfortunately, there seems to be a bug -- the lexer swallows some tokens and they never show up in the output stream. Test case:

grammar Test;

id: IDENTIFIER;

IDENTIFIER: 'A' .. 'Z' ( 'A' ..'Z'| '0' .. '9' )*;

WS : (' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;};

When running antlrworks debugger with input text "I" and start rule "id", the parse tree insists on "MismatchedTokenException". The input window in the lower left corner remains empty. Inline DFA case works OK.


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Terence Parr - 14/Mar/07 01:56 PM
I thought I had fixed...but I fixed another instead...

Terence Parr - 14/Mar/07 03:18 PM
This bug had to do with pruning exit branches (DFAOptimizer.PRUNE_EBNF_EXIT_BRANCHES). IF-THEN-ELSE code can get away with no pruning but just defaulting to bypass subrule. A DFA table implementation must always test lookahead to move. When you say no inline DFA, I turn off the prune exit branch optimization.