Related articles |
---|
C++ Parser, Flex and mkparserclass bohn@hpe.fzk.de (Stefan Bohn) (2000-05-04) |
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 |
Hi,
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
Parserobject?
e.g.:
/* 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
Return to the
comp.compilers page.
Search the
comp.compilers archives again.