[antlr-interest] Failure to ignore newline

David Riddle david at mcgilly.com
Thu Nov 17 22:55:59 PST 2011


Hi -

This should be a very simple thing - I'm attempting to have my grammar hide
newline, carriage returns, etc. However, every concievable form of a
grammar that attempts to skip over these things or send them to the hidden
channel seems to fail for me. Here's a very basic example:

grammar Test;

prog: ID+;

ID: 'a'..'z'+;

WS: '\n'+ {$channel=HIDDEN;};

// Input: a \n b
// Output: a n b


-- 
David Riddle
Servoy Developer
(510) 854-6221
www.mcgilly.com


More information about the antlr-interest mailing list