C++ Parser, Flex and mkparserclass

Stefan Bohn <bohn@hpe.fzk.de>
4 May 2000 17:16:21 -0400

          From comp.compilers

Related articles
C++ Parser, Flex and mkparserclass bohn@hpe.fzk.de (Stefan Bohn) (2000-05-04)
| List of all articles for this month |

From: Stefan Bohn <bohn@hpe.fzk.de>
Newsgroups: comp.compilers
Date: 4 May 2000 17:16:21 -0400
Organization: Forschungszentrum Karlsruhe
Keywords: lex, yacc, parse, C++, question


I generated a Parser with Bison A 2.6 an converted it into a C++
Parserobject with mkparserclass.

My lexer (-> lex.yy.c) is generated by Flex (not Flex++) and included
in the Parser source. Still it won't work ...

How do I have to call the lexer in connection with my new


/* create new parser object */

class fl_parser *Plainparser = new class fl_parser;

int lexer(void *lexrock, void *yylval) <- Correct?
                                                                                                                      <- insert
yylex here?? how?

int lexstate = 0;

/* run Parser */
(Plainparser)->Parse(lexer, &lexstate);


Thanx, Stefan

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.