|Re: Question on Compiler parse semantic analysis email@example.com (vrml3d.com) (2000-07-23)|
|Re: Question on Compiler parse semantic analysis firstname.lastname@example.org (Kamal R. Prasad) (2000-07-29)|
|Date:||23 Jul 2000 17:05:14 -0400|
<email@example.com> wrote in message news:firstname.lastname@example.org...
> 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
> 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
Return to the
Search the comp.compilers archives again.