[il-antlr-interest: 28477] ANTLR issue with Grammar...

2010-04-17 Thread josh wood
I think there is an issue within ANTLR and supporting the optional
operator '?'.

Here's what I'm doing:


conditionalTest
:   'when arrival >' INTEGERPIPETIME
;

INTEGER : '0'..'9'+ ;
INTEGERPIPETIME: (INTEGER '|')? TIME;
TIME: INTEGER ':' INTEGER;


When I try to validate the following statement:
when arrival > 1|13:59

It works fine.  '1|' should be optional because of the '?' operator.
So I use this statement:
when arrival > 13:59

And I receive an error stating it was expecting TIMETICKS.  TIMETICKS
is clearly using the optional operator, so why is ANTLR always
expecting to see the integer pipe combination?

Any help would be appreciated.

Thanks!
Josh

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.



[il-antlr-interest: 28478] Re: ANTLR issue with Grammar...

2010-04-17 Thread josh wood
Sorry, I made a mistake.  The error states it was expecting
INTEGERPIPETIME, not TIMETICKS.

On Apr 17, 10:40 pm, josh wood  wrote:
> I think there is an issue within ANTLR and supporting the optional
> operator '?'.
>
> Here's what I'm doing:
>
> conditionalTest
>         :       'when arrival >' INTEGERPIPETIME
>         ;
>
> INTEGER : '0'..'9'+ ;
> INTEGERPIPETIME: (INTEGER '|')? TIME;
> TIME: INTEGER ':' INTEGER;
>
> When I try to validate the following statement:
> when arrival > 1|13:59
>
> It works fine.  '1|' should be optional because of the '?' operator.
> So I use this statement:
> when arrival > 13:59
>
> And I receive an error stating it was expecting TIMETICKS.  TIMETICKS
> is clearly using the optional operator, so why is ANTLR always
> expecting to see the integer pipe combination?
>
> Any help would be appreciated.
>
> Thanks!
> Josh
>
> --
> You received this message because you are subscribed to the Google Groups 
> "il-antlr-interest" group.
> To post to this group, send email to il-antlr-inter...@googlegroups.com.
> To unsubscribe from this group, send email to 
> il-antlr-interest+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/il-antlr-interest?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.