[antlr-interest] Re: Fixing grammar rule with trailing optional token
cintyram <cintyram at yahoo.com>
cintyram at yahoo.com
Sat Jan 18 19:11:57 PST 2003
did you write the rules as you gave here or did you use : instead of = ?
--- In antlr-interest at yahoogroups.com, "angryal2000
<angryal2000 at y...>" <angryal2000 at y...> wrote:
> I am having difficulty trying to fix the following rule:
>
> data_type: FLOAT (OPENBRACKET INTEGER CLOSEBRACKET)? ;
>
> FLOAT="float";
> OPENBRACKET='(';
> CLOSEBRACKET=')';
> INTEGER=('0'..'9')+;
>
> e.g.
> "float" is accept by the rule data_type
> as is
> "float(23)"
>
>
> i know my rule is wrong, i am just not sure how to go about fixing it.
> any ideas? thanks.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list