Re: Question on Compiler parse semantic analysis

"vrml3d.com" <comments@vrml3d.com>
23 Jul 2000 17:05:14 -0400

          From comp.compilers

Related articles
Re: Question on Compiler parse semantic analysis comments@vrml3d.com (vrml3d.com) (2000-07-23)
Re: Question on Compiler parse semantic analysis kamalp@ix.netcom.com (Kamal R. Prasad) (2000-07-29)
| List of all articles for this month |
From: "vrml3d.com" <comments@vrml3d.com>
Newsgroups: comp.lang.c,comp.compilers
Date: 23 Jul 2000 17:05:14 -0400
Organization: Compilers Central
References: <8lbs8s$vge$1@nnrp1.deja.com>
Keywords: analysis

<nospam411@my-deja.com> wrote in message news:8lbs8s$vge$1@nnrp1.deja.com...
> 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.


--Steve









Post a followup to this message

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