Re: Semantic actions in LR parser

mauney@csljon.csl.ncsu.edu (Jon Mauney)
Mon, 5 Apr 1993 17:39:52 GMT

          From comp.compilers

Related articles
Semantic actions in LR parser cosc19py@jane.uh.edu (1993-04-02)
Re: Semantic actions in LR parser roy@prism.gatech.edu (1993-04-02)
Re: Semantic actions in LR parser karsten@tfl.dk (1993-04-03)
Re: Semantic actions in LR parser mauney@csljon.csl.ncsu.edu (1993-04-05)
Semantic actions in LR parser clark@zk3.dec.com (1993-04-06)
Re: Semantic actions in LR parser wand@ccs.northeastern.edu (1993-04-07)
Semantic actions in LR parser clark@zk3.dec.com (1993-04-14)
Semantic actions in LR parser xorian@solomon.technet.sg (1993-04-15)
| List of all articles for this month |
Newsgroups: comp.compilers
From: mauney@csljon.csl.ncsu.edu (Jon Mauney)
Keywords: LR(1), parse
Organization: NCSU
References: 93-04-008 93-04-014
Date: Mon, 5 Apr 1993 17:39:52 GMT



roy@prism.gatech.edu (Roy Mongiovi) writes:
>LR parsers can only perform semantic actions when the recognize a handle
>... you can stick in epsilon productions whose only purpose is to cause
>semantic actions.


karsten@tfl.dk (Karsten Nyblad) writes:
>... So, you can allow for actions to be executed when you push a terminal or
>nonterminal and that brings you to a state that has only one item in kernel.
>Even that can be generalized. ...


These are the same thing. Creating a nonterminal, with an epsilon
production, for each action, and inserting them at the places Nyblad
suggests will not cause parse conflicts (and inserting them in places he
implicitly disallows will cause conflicts). It is simply a matter of
syntactic sugar whether the tool does this for you, or makes you do it
manually. (There is also the question of whether the tool can recongnize
that two actions are identical.)
--
Jon Mauney mauney@csc.ncsu.edu
Mauney Computer Consulting (919)828-8053
--


Post a followup to this message

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