Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.compilers    |    Compiler construction, theory, etc. (Mod    |    2,753 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 1,667 of 2,753    |
|    Hans-Peter Diettrich to seescreen@gmail.com    |
|    Re: How do I implement check_type() ?    |
|    25 May 09 09:39:37    |
      From: DrDiettrich1@aol.com              seescreen@gmail.com schrieb:              > In the case of this project I need to return TYPE_NAME from the lexer       > whenever I encounter a Class name. The problem seems to be that only       > the parser knows whether or not the IDENTIFIER is a class name or not,       > and yet the lexer sees the name before it goes to the parser.       >       > What is the simplest way to get around this problem?              I'd create a list of type names, maintained by the parser, then the       lexer can lookup all identifiers in that list.              When you include the preprocessor (what's unlikely when using lex/yacc       -) then the name mapping has to occur somewhere betweeen the lexer and       the parser, after macro expansion.              DoDi              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca