How do I use a non-ANTLR-generated (C++) lexer into an ANTLR-generated parser?

Location: jguru.com/faq/view.jsp?EID=88710 Created: Jun 28, 2000 Modified: 2000-06-28 22:59:45.872 Author: Ric Klaren (jguru.com/guru/viewbio.jsp?EID=11059) Question originally posed by Robert Hodge (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 class Scanner : public antlr::TokenStream { // implement a nextToken function.. antlr::RefToken nextToken( void ) { int tok; char yytextMAX_STRING; // do scanner magic... ... // set tok and yytext.. more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions