[antlr-interest] Visually display the DFA ANTLR generates
Geoffrey Zhu
gzhu at peak6.com
Wed Jun 27 11:07:44 PDT 2007
For example, for the input "( security" the interpreter works well on
the below grammar, but the ANTLR genereated code chokes on it. I guess
that as long as there are two code bases (ANTLR and WORKS), there are
discrepencies. Maybe Works can employ antlr to do the work. Then there
is no discrepency.
ID : ('a'..'z')+;
fragment WS : ' ' | '\t' ;
LPAREN : '(' ;
LP_SELECT : '(' WS* 'select';
prog: (ID|LPAREN|LP_SELECT|WS)+ ;
-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Randall R Schulz
Sent: Wednesday, June 27, 2007 9:20 AM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] Visually display the DFA ANTLR generates
On Wednesday 27 June 2007 07:09, Geoffrey Zhu wrote:
> I just don't know AntlrWorks's fidelity to the actual code. I already
> found one case where the ANTLRWorks interpreter works differently from
> the actual generated code. Does it read the generated code to build
> the graph?
If ANTLRworks has a deficiency, it is its lack of documentation.
As I learned here yesterday, when acting in its "Intepreter" mode,
ANTLRworks ignores syntactic predicates. For grammars that include them,
this makes the interpreter unuseful. And keep in mind that even if you
do not explicitly write any syntactic predicates, if you enable
backtracking ANTLR itself will generate syntactic predicates for you.
In these cases, you must use the ANTLRworks debugger to test your
grammar's behavior. But it is very useful to do so.
And if there's some sort of discrepancy between ANTLRworks and ANTLR,
it's a bug and either Terence Parr or Jean Bovet will fix it (if you
report it).
Randall Schulz
_______________________________________________________=0A=
=0A=
The information in this email or in any file attached=0A=
hereto is intended only for the personal and confiden-=0A=
tial use of the individual or entity to which it is=0A=
addressed and may contain information that is propri-=0A=
etary and confidential. If you are not the intended=0A=
recipient of this message you are hereby notified that=0A=
any review, dissemination, distribution or copying of=0A=
this message is strictly prohibited. This communica-=0A=
tion is for information purposes only and should not=0A=
be regarded as an offer to sell or as a solicitation=0A=
of an offer to buy any financial product. Email trans-=0A=
mission cannot be guaranteed to be secure or error-=0A=
free. P6070214
More information about the antlr-interest
mailing list