[antlr-interest] not parsing to end of input

Mark Volkmann r.mark.volkmann at gmail.com
Mon Dec 10 09:08:21 PST 2007


I've stripped down my grammar to the smallest size that reproduces the
problem. When I run "print x;" through this grammar using the
ANTLRWorks debugger, it doesn't process the semicolon. It stops
parsing at that point and throws the rest of the input away. In my
real grammar this ends up being multiple lines of lost input. Any idea
what I'm doing wrong?

grammar problem;

options {
  output = AST;
}

script: print ';';
print: 'print' LETTER -> ^('print');
	
LETTER: 'a'..'z';
WHITESPACE: ' '+ { $channel = HIDDEN; };

-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list