How do I recognize tokens defined as "from here to end of line" such as in a "print" command where the argument is everything after the "print" to end of line?
/** Match print then anything until eol */ PRINT : "print" (~' ')* ' '! ;
Note that the PRINT token returned to the parser will contain the entire PRINT command including all text until end of line, but not end of line (since I put a ! suffix on it). To return just the print argument, put a ! on the "print" reference in the rule.