forked from antlr/antlr4
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add simple LL(2) rule with ATN debug output.
Signed-off-by: Terence Parr <parrt@antlr.org>
- Loading branch information
Showing
2 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...ime-testsuite/resources/org/antlr/v4/test/runtime/descriptors/TraceParserATN/LL2Trace.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[type] | ||
Parser | ||
|
||
[grammar] | ||
grammar T; | ||
s : t EOF ; | ||
t : ID ';' | ID '.' ; | ||
ID : [a-zA-Z]+ ; | ||
WS : [ \r\n\t]+ -> skip ; | ||
|
||
[start] | ||
s | ||
|
||
[input] | ||
xyz. | ||
|
||
[output] | ||
"""adaptivePredict decision 0 exec LA(1)==ID<3> line 1:0 | ||
predictATN decision 0 exec LA(1)==ID<3>, outerContext=[t s] | ||
closure((7,1,[$])) | ||
closure((9,2,[$])) | ||
adding new DFA state: 0:[(7,1,[$]), (9,2,[$])] | ||
execATN decision 0 exec LA(1)==ID<3> line 1:0 | ||
s0 = 0:[(7,1,[$]), (9,2,[$])] | ||
in computeReachSet, starting closure: [(7,1,[$]), (9,2,[$])] | ||
testing ID<3> at (7,1,[$]) | ||
testing ID<3> at (9,2,[$]) | ||
closure((8,1,[$])) | ||
closure((10,2,[$])) | ||
SLL altSubSets=[{1}, {2}], configs=[(8,1,[$]), (10,2,[$])], predict=0, allSubsetsConflict=false, conflictingAlts={1, 2} | ||
EDGE 0:[(7,1,[$]), (9,2,[$])] -> -1:[(8,1,[$]), (10,2,[$])] upon ID<3> | ||
adding new DFA state: 1:[(8,1,[$]), (10,2,[$])] | ||
DFA= | ||
s0-ID->s1 | ||
|
||
in computeReachSet, starting closure: [(8,1,[$]), (10,2,[$])] | ||
testing '.'<2> at (8,1,[$]) | ||
testing '.'<2> at (10,2,[$]) | ||
SLL altSubSets=[{2}], configs=[(12,2,[$])], predict=2, allSubsetsConflict=false, conflictingAlts={2} | ||
EDGE 1:[(8,1,[$]), (10,2,[$])] -> -1:[(12,2,[$])],uniqueAlt=2=>2 upon '.'<2> | ||
adding new DFA state: 2:[(12,2,[$])],uniqueAlt=2=>2 | ||
DFA= | ||
s0-ID->s1 | ||
s1-'.'->:s2=>2 | ||
|
||
DFA after predictATN: s0-ID->s1 | ||
s1-'.'->:s2=>2 | ||
|
||
""" | ||
|
||
[flags] | ||
traceATN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters