[antlr-interest] Novice Question - Token for all characters from a given point to End of Line

Brisard, Fred D Fred.Brisard at ca.com
Tue Aug 5 11:03:47 PDT 2008


I have a keyword style grammar and have the need to accept all the
characters until the end of line to be accepted as a single token.  

For example, I have a statement that is of the following type

Command multiple arguments (EOL)

Where Command can be a command name and the multiple arguments are one
or more arguments.  There can be from 1 to many arguments - each
argument does not have a fixed content - it may be an integer, a string,
a quoted string.  The characters in the string can be most anything.

I was looking for something similar to the multiple line comment
technique using the greedy=false option.  Collect all the characters
following the Command into a single token.

Any ideas or suggestions are appreciated.

Regards, Fred



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080805/fff7f05e/attachment.html 


More information about the antlr-interest mailing list