|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:||Mitchell Perilstein <firstname.lastname@example.org>|
|Keywords:||parse, yacc, comment|
|Date:||Fri, 29 Sep 1995 04:23:26 GMT|
What's wrong with the parser communicating its state to the lexer at the
same time it asks the lexer for the next token?
I'm about to do exactly this for a C-like language that has its own
macro processor. Some of the macros are only valid in certain contexts.
If I pass a little context information to lex from the parser, all the
macros can be handled by lex. Fortunately, this is a by-hand lex and
parser; who knows how to teach lex and yacc this trick without globals?
What are the reasons for your hesitation?
Mitchell N. Perilstein [\]
COMPASS Design Automation, Columbia MD USA
Tel: 410-992-5700 x1225, Fax: 410-992-3536
[Don't forget that yacc can be reading a token ahead of where it's parsing.
That makes lexical feedback more exciting. -John]
Return to the
Search the comp.compilers archives again.