[antlr-interest] Adding parameters to lexer and parser constructors

Cameron Ross cross at kojeware.com
Mon May 17 08:23:23 PDT 2010


Hi,

I'm implementing custom error reporting as per these instructions:
http://www.antlr.org/wiki/display/ANTLR3/Error+reporting+and+recovery. As
mentioned in this post, "it is generally the case that the destination for
errors does not change once lexing and parsing has begun, so a refinement on
the above solution is to pass the error reporter object in as an extra
parameter to the lexer and parser constructor methods, instead of using a
completely separate method".  I would like to implement this refinement,
 but I
m not sure how to specify custom constructors for the lexer and parser.  Any
advice would be greatly appreciated.

Cameron.


More information about the antlr-interest mailing list