[antlr-interest] @members and the lexer in 3.0.1

Bocek, Timothy (RDM) Timothy.Bocek at bsci.com
Tue Oct 6 10:41:11 PDT 2009


I am using the python target in antlr 3.0.1.  I'm not able to upgrade
for nontechnical reasons.  I am trying to get an exception thrown on any
recognition error, and have gotten as far as

@members {
	def emitErrorMessage(self, msg):
		raise Exception(msg)
}

And this seems to work for parser errors (in addition to overriding the
recoverFrom methods).  However, the lexer still just writes its errors
to stdout instead of throwing an exception.  Upon inspection of the
generated code, it looks like the @members section is only applying to
the lexer, not the parser.  

Is there an @members equivalent for the lexer?  Or some way to make
@members apply to the lexer as well?  Or is this just a bug in the
version I'm using which is fixed in a later one?

Thanks
Tim Bocek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20091006/e9f1ec99/attachment.html 


More information about the antlr-interest mailing list