[antlr-interest] How to interpret the text DFA

yushang yusunn at gmail.com
Thu Nov 10 09:50:19 PST 2011


Hi , everyone,
I'm testing the following grammar

INT
    :    ('0'..'9')+
    ;
FLOAT
    :    ('0'..'9')* '.' INT
    ;
and get the follwing DFAs
DFA d=1
.s0-'0'..'9'->:s2=>1
.s0-<EOT>->:s1=>2

DFA d=2
.s0-'.'->:s2=>2
.s0-'0'..'9'->:s1=>1

DFA d=3
.s0-'.'->:s3=>2
.s0-'0'..'9'->.s1
.s1-'.'->:s3=>2
.s1-'0'..'9'->.s1
.s1-<EOT>->:s2=>1
from the lexer code , I can just assemble the last one (d=3) what's purpose
of the former 2? Many thanks.


More information about the antlr-interest mailing list