I looked at ANTLRStringStreams consume() method and noticed that it 
checks for a '\n'. In the current grammar I'm skip()ing newlines, 
instead of placing them on a hidden channel.

I made the following modification to the grammar in ANTLRWorks which 
promptly broke the compiler.
fragment NEWLINE : '\n' '\r'? {$channel=HIDDEN;};
fragment WS      : ('\n'|'\r'|'\t'|' ')+ {$channel=HIDDEN;};

The error message is "cannot find symbol : variable _channel". I edited 
QuizLexer.java and added
public static int _channel; Now when I run the test rig, I can see the 
tokens returned from lexer.nextToken().getText(), although tokens.size() 
still reports zero. This change also enables the debugger to correctly 
parse the input.

Is $channel=HIDDEN not working in ANTLRWorks a known issue? The 404 Not 
Found error for its source code repository does not inspire confidence 
http://fisheye2.cenqua.com/browse/antlrworks.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to