[antlr-interest] State Machines Galore

Terence Parr parrt at cs.usfca.edu
Sat Jan 7 10:24:48 PST 2006


On Jan 7, 2006, at 1:45 AM, Jeff Barnes wrote:
>> You could...i was showing the output of another tool
>> actually (ANTLR
>> v3) ;)
>
>
> So it appears that ANTLR v3's parse tree isn't (a | b
> | c) it is:
>
>          |
>         / \
>        |   c
>       / \
>      a   b
>
> and that tree is explicitly expressed in regular
> expression as
>
> ((a | b) | c)
>
> right?

Actually, v3 builds something more complicated.  For your  
entertainment, run

java org.antlr.Tool -dfa -nfa t.g

and you'll get rulename.dot and t_dec-n.dot (the prediction DFA).   
Load with graphviz.  Rinse.  Repeat.  Enjoy fuller, bouncier hair. :) ;)

Ter


More information about the antlr-interest mailing list