[antlr-interest] Two questions about antlr3 syntax

Oliver Zeigermann oliver.zeigermann at gmail.com
Fri Oct 28 01:09:03 PDT 2005


2005/10/28, shmuel siegel <antlr at shmuelhome.mine.nu>:
> Oliver Zeigermann wrote:
>
> >2005/10/27, shmuel siegel
> >
> >
> >>1) In antlr2 I used EOT to indicate that the entire input file must
> >>match my syntax. What has replaced this in antlr3.
> >>example
> >>     document : contextSection (eventSection)? (handlerList)?
> >>(settingSection)* EOT!;
> >>
> >>
> >
> >AFAIK the EOT is no longer required. The only thing you will need is
> >at least one start rule. A start rule is called by no other rule.
> >
> >
> >
> The EOT was introduced into this rule to avoid having document match a
> contextSection followed by garbage. Are you saying that the mere fact
> that document is a top level rule will make it try to consume the entire
> input stream?

That was my impression, but I am not entirely sure...

Oliver


More information about the antlr-interest mailing list