|Lexical feedback firstname.lastname@example.org (Paul Long) (1995-09-22)|
|Re: Lexical feedback email@example.com (Mitchell Perilstein) (1995-09-29)|
|Re: Lexical feedback firstname.lastname@example.org (Paul Long) (1995-10-06)|
|Lexical feedback 75066.3204@CompuServe.COM (Carl Barron) (1995-10-21)|
|Re: Lexical feedback email@example.com (Richard Pennington) (1995-10-22)|
|Re: Lexical feedback firstname.lastname@example.org (1995-10-23)|
|Re: Lexical feedback email@example.com (1995-10-25)|
|From:||firstname.lastname@example.org (David Keppel)|
|Keywords:||parse, yacc, lex, comment|
|Organization:||Computer Science & Engineering, U. of Washington, Seattle|
|References:||95-09-143 95-10-032 95-10-065|
|Date:||Mon, 23 Oct 1995 21:07:29 GMT|
>[Discussion: parser communicates current state when calls lexer?]
I believe -- but haven't used it for sure, so I won't promise -- that
the current version of `flex' supports a lexer with multiple entry
points. In effect, you get to define a set of cooperating lexers and
call the one that corresponds to the current parse context.
In principle, if not practice:
common definitions ...
entry1: definitions for one parser ...
entry2: definitions for a second parser ...
So, if you can embed parser context as a ``one of N'' kind of rule,
you should be able to use `flex' for the job.
This still doesn't solve the problem that John mentions, namely that
`yacc' may be reading a token ahead.
;-D on ( A token contribution ) Pardo
[I haven't seen a version of flex tha tdoes that, but it's easy to fake with
exclusive start states. -John]
Return to the
Search the comp.compilers archives again.