[antlr-interest] spaces between tokens

Bryan Ewbank ewbank at synopsys.com
Wed Nov 10 08:27:36 PST 2004


> In my grammar, how in many others, the whitespaces are skipped in lexer,
> but I've some circumstances in which I need to check that not any spaces
> are present between tokens.
> ...
> I think a similar issue is present in C/C++ structure construct
>
I believe you are mistaken here.  The C/C++ grammar treats "." as an
operator, but ignores whitespace around that operator.  Most people have a
"coding style" that prohibits whitespace, but the compiler don't care.  It
sees <ID> <DOT> <ID>.

Try it; I think you will see that whitespace is not an issue.  Even putting
the "." in a separate file that is #include'd should not break the code.

-- Bryan Ewbank




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list