Related articles |
---|
Flex++ and Bison++ (instead of Flex and Bison) edwin@virtools.fr (Edwin) (2002-02-28) |
Re: Flex++ and Bison++ (instead of Flex and Bison) johnmillaway@yahoo.com (John W. Millaway) (2002-03-09) |
Re: Flex++ and Bison++ (instead of Flex and Bison) skeeterdabeeterbunny@ameritech.net (skeeter da beeter bunny) (2002-03-09) |
From: | "skeeter da beeter bunny" <skeeterdabeeterbunny@ameritech.net> |
Newsgroups: | comp.compilers |
Date: | 9 Mar 2002 03:01:16 -0500 |
Organization: | Prodigy Internet http://www.prodigy.com |
References: | 02-02-070 |
Keywords: | parse, C++ |
Posted-Date: | 09 Mar 2002 03:01:16 EST |
This is what Ive done,
have multiple starting states, ( at least Ive done this with regular LEX and
YACC )
Have a function named "parse_init" that would do a "YYSTATE <start state>",
depending on the functionality it would do "YYSTATE START_1, YYSTATE
START_2", etc.
Then that start state in your lexer would return a bogus token like
"START_1, START_2, START_3, etc." that would force the parser into the
correct branch of the parse tree.
then the parser would say:
%start Branch1 Branch2 Branch2
Branch1: START_1 ( rest of parser branches, etc ).
Branch2: START_2, etc.
Branch3: START_3, etc.
Worked for me, I've done 3 in the same lex/yacc parser,
Good Luck!
"Edwin" <edwin@virtools.fr> wrote in message
> Hi ,I'am trying to use Flex++ and Bison++ instead of Flex and Bison
because
> I would like to
> use multiple lexer and parser in one project.
> I work with Visual C++ 6.0. I search a good documentation with working
> exemples.
> Can someone help me ?
> Thanks.
> --
> Edwin Razafi.
> edwin@virtools.com
Return to the
comp.compilers page.
Search the
comp.compilers archives again.