[antlr-interest] problem with rules in tree parsers, is it a bug or is it normal ?
Anthony Brenelière
abreneliere at telys.com
Thu Feb 20 06:30:34 PST 2003
In a tree parser,
I have the following rules
entOrSet
: (entity)=> entity
| (set)=> set
;
entity
: #( R_ENT entityComponentList )
;
it compiles well, and there is no non-determinism
but it is not able to recognize the token R_ENT whereas it should.
I have the following message error :
<AST>: unexpected AST node: [entity]
..each time an entity is found. ("[entity]" is the text for the token
R_ENT)
BUT..
When I change the entOrSet rule to:
entOrSet
: (entity)=> entity
// | (set)=> set (this alternative is suppressed)
;
then everything works fine ! Then 'entity' rule is perfectly matched.
( but of course, i cannot have 'sets' sentences in my document )
Any idea about how to solve this problem ?
Cordially,
Anthony
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list