Re: Question on Compiler parse semantic analysis

"" <>
23 Jul 2000 17:05:14 -0400

          From comp.compilers

Related articles
Re: Question on Compiler parse semantic analysis ( (2000-07-23)
Re: Question on Compiler parse semantic analysis (Kamal R. Prasad) (2000-07-29)
| List of all articles for this month |

From: "" <>
Newsgroups: comp.lang.c,comp.compilers
Date: 23 Jul 2000 17:05:14 -0400
Organization: Compilers Central
References: <8lbs8s$vge$>
Keywords: analysis

<> wrote in message news:8lbs8s$vge$
> I had a question about yacc and using it to write a language
> parser. (Not directly related to C, i know, but semantic actions
> in yacc are specified in C :))
> Say if you are implementing a scope stack for scope,
> say a production
> Function : begin listofstatements end
> etc
> and begin and end are the scope delimiters in any scope nested
> to any level where does one push or pop the scope stack???? I gotta
> admit this is sort of a yacc question.

Short answer: I hate yacc.

Long answer: yacc only parses. Anything else is entirely up to you. That
means creating a data structure of some kind, #including the header for it
at the top of your grammar, and performing operations on that structure as
your actions.


Post a followup to this message

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