[antlr-interest] Re: ambiguous grammar

beeh1973 <hastur4711 at bigfoot.com> hastur4711 at bigfoot.com
Mon Jan 20 07:23:05 PST 2003


--- In antlr-interest at yahoogroups.com, Anakreon Mejdi <amejdi at e...> 
wrote:
>   component:
>     DOLLAR^ FLOAT
>     ;
> This should work.
> There is no DOT because in the NUMBER rule if an DIGIT is matched 
the 
> type is made FLOAT and the DOT is consumed.
> For the same reason there is no NUMBER Token.
>
hi,

it works but does not produce the result i need.
this would create the tree
($ .1)
instead i need the tree
($ . 1)

in fact i do not need DOT to be part of the tree. just to display the
difference. ($ 1) would suffice.

.1 is just a float literal
$.1 is a positional notation: "the first element in $"

another reply gave me the hint to check the provided Java and C 
Grammars.
i will check this way.

thanks a lot,
  alphonse


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list