[antlr-interest] Newbie : resolving ambiguity between "number" and "string"
Xue Yong Zhi
zhixueyong at hotmail.com
Mon Feb 12 08:23:37 PST 2007
You can use antlr's 'Syntactic Predicates'. Or just accept "12.3" as
String, then use semantic action to set it back to Number.
> 12.3 : Number.
> "12.3" : Number.
> "abc" : String
>
> but as expected there is an ambiguity between string and number.
> how can I express that the content of the a string may not be a NUMBER?
--
Xue Yong Zhi
XRuby (Ruby to Java bytecode compiler):
http://xruby.blogspot.com
More information about the antlr-interest
mailing list