Related articles |
---|
how to push token back for Bison to consider it? mdurovic@vcisnet.net (Milan Durovic) (2003-04-13) |
Re: how to push token back for Bison to consider it? jyrixx@astro.temple.edu (2003-05-06) |
Re: how to push token back for Bison to consider it? blackmarlin@asean-mail.com (2003-05-15) |
From: | jyrixx@astro.temple.edu (Andrew Gwozdziewycz) |
Newsgroups: | comp.compilers |
Date: | 6 May 2003 19:15:46 -0400 |
Organization: | http://groups.google.com/ |
References: | 03-04-038 |
Keywords: | lex |
Posted-Date: | 06 May 2003 19:15:46 EDT |
> ruleBlah: nonterm1 nonterm2
> {
> while( yylex() != SOME_PARTICULAR_TOKEN )
> { do_something(); }
> }
>
> ruleBlah2: SOME_PARTICULAR_TOKEN nonterm3 nonterm4
>
> The problem is that the code above "swallows" SOME_PARTICULAR_TOKEN
> token, and the generated parser never sees it. This causes the parser
> never to match "ruleBlah2" that requires that token.
Using flex you can use the "/" in the pattern rule
So 0/1 will match 01 but push back 1. not sure if that's what your
looking for exactly
[Probably not. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.