Related articles |
---|
YACC Parsing Question kalyanpradeep@gmail.com (Pradeep) (2005-11-08) |
Re: YACC Parsing Question jatin.bhateja@amdocs.com (Jatin Bhateja) (2005-11-12) |
Re: YACC Parsing Question oliverhunt@gmail.com (oliverhunt@gmail.com) (2005-11-12) |
From: | "oliverhunt@gmail.com" <oliverhunt@gmail.com> |
Newsgroups: | comp.compilers |
Date: | 12 Nov 2005 16:40:29 -0500 |
Organization: | http://groups.google.com |
References: | 05-11-055 |
Keywords: | yacc, parse |
Posted-Date: | 12 Nov 2005 16:40:28 EST |
It looks like you are adding an identifier to the symbol table when
you hit an IDENTIFIER, rather than when you see a declaration. At
that point your parser doesn't know whether it has a function or
variable declaration (or even if it's a usage of the ident, rather
than a declaration). Therefore you aren't marking it as a function or
a variable, and your later code will not necessarily know either. So
it would seems that is likely to be causing your problems.
Anyway, without seeing exactly what you're doing (and also my knowledge
of yacc has waned over the years as well) I can't be sure that's
causing your problems so there are two things i'd suggest you check
first:
1. Ensure that the function declaration/definition is present in the
symbol table by th time you'd need to use it.
2. That you've got a correct lookup function in your symbol table, ie.
you're not performing string equality by address rather than content.
--Oliver
Return to the
comp.compilers page.
Search the
comp.compilers archives again.