OK, I've tried what you suggested and, for the most part, it works. There's just a little problem with this: the WS as an operator, if there is one, is not present in the AST. How can I put it in the AST? Better yet, how can I rewrite the rule so that I can see it as a '*' operator in the AST? Thanks again for all your help!!! ^_^
Dominic P.S.: If it has something to do with the hidden channel, I'm kind of confused on how to access it, let alone use it. Thanks! -------------------------------------------------- From: "micha" <[email protected]> Sent: Tuesday, January 13, 2009 3:22 AM To: <[email protected]> Subject: Re: [antlr-interest] White spaces not allowed > On Monday 12 January 2009 21:59:12 Dominic Tardif wrote: > >> >> OK, I've removed the NEWLINE token and changed stmt+ by stmt* and it >> works >> just fine, except that I want to be able to support the ' ' operator, >> which >> acts like a '*'. If I didn't support it, I don't think I would have had >> any problems. Is there a way to have a white space act as an operator as >> well? If not, I'll just have to remove it. Thanks again for all your >> help! >> ^_^ > > maybe (i.e. not tested, just the idea): > > WS: (' ' | '\t' )+ { channel=hidden;} > > and: > > multExpr: phase ('*'? phase)* > > then WS is allowed as '*' . You can check the hidden channel, if it was > exactly one ws. > > Michael > > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address > > List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
