How do I use a non-ANTLR-generated (C++) lexer into an ANTLR-generated parser?
Location: http://www.jguru.com/faq/view.jsp?EID=88710 Created: Jun 28, 2000 Modified: 2000-06-28 22:59:45.872 Author: Ric Klaren (http://www.jguru.com/guru/viewbio.jsp?EID=11059) Question originally posed by Robert Hodge (http://www.jguru.com/guru/viewbio.jsp?EID=69371 Subclass your scanner from antlr::TokenStream and make it adhere to the interface defined by TokenStream. Basically this comes down to defining a nextToken function in your scanner class. I use (+/-) the following to link a Cocktail rex scanner to antlr: #include