Re: YACC Parsing Question

"" <>
12 Nov 2005 16:40:29 -0500

          From comp.compilers

Related articles
YACC Parsing Question (Pradeep) (2005-11-08)
Re: YACC Parsing Question (Jatin Bhateja) (2005-11-12)
Re: YACC Parsing Question ( (2005-11-12)
| List of all articles for this month |

From: "" <>
Newsgroups: comp.compilers
Date: 12 Nov 2005 16:40:29 -0500
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
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.


Post a followup to this message

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