[antlr-interest] Proglem about the root of ASTree

Bryan Ewbank ewbank at gmail.com
Thu Sep 21 07:43:29 PDT 2006


This very strictness makes the job of creating ANTLR much easier, because it
provides an automatic way to require that things marked to be the root with
'^' are exactly one token.  Certainly, you could do the analysis to ensure
that a rule marked with '^' is guaranteed to return exactly one token --
that's on a wish list, I think -- but it's never been high enough priority
to deliver.

Generally, tokens show up in just a few places in the grammar, so "reuse"
isn't really compelling.  Some of what you suggest might be addressible by
introducing a scanner and using symbolic names for the tokens.

On 9/21/06, sishen <sishen_freecity at 126.com> wrote:
>
> Thanks.
>
> In my opinion, This restriction is too strict. :(
> it's can't be reuseable.
> And i should use multiple label to mark the token..... like  op1:">"^ |
> op2:"<"^ | op3:"=".....
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060921/08149560/attachment.html 


More information about the antlr-interest mailing list