Re: Lexical feedback (David Keppel)
Mon, 23 Oct 1995 21:07:29 GMT

          From comp.compilers

Related articles
Lexical feedback (Paul Long) (1995-09-22)
Re: Lexical feedback (Mitchell Perilstein) (1995-09-29)
Re: Lexical feedback (Paul Long) (1995-10-06)
Lexical feedback 75066.3204@CompuServe.COM (Carl Barron) (1995-10-21)
Re: Lexical feedback (Richard Pennington) (1995-10-22)
Re: Lexical feedback (1995-10-23)
Re: Lexical feedback (1995-10-25)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (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]

Post a followup to this message

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