[plt-scheme] Parser tools and actions in mid-rules

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Thu Mar 19 12:55:47 EDT 2009

Parse it into sexpressions and then write an actual function to check
that kind of thing.


On Thu, Mar 19, 2009 at 11:26 AM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> Hi all,
> Bison supports actions in mid-rule:
> http://www.gnu.org/software/bison/manual/html_mono/bison.html#Mid_002dRule-Actions
> however this doesn't seem the case with Parser Tools.
> I wonder then, what's the best way to solve the following issue:
> I am parsing a formal specification language which introduce several
> environments which are just pairs of Variable / Type.
> One structure of the language is an Event which has a local variables
> section and a body section.
> Something like:
> event ::= EVENT locals BODY expression END;
> The way to do this would be to have a mid-rule after locals to create
> a new environment which contains the variables defined in locals and
> then after END, we remove the destroy the environment.
> Without mid-rules I am a bit lost. Is there any other way to do this
> kind of thing? (or maybe some way to turn an unambiguous grammar with
> mid-rules into an unambiguous grammar without mid-rules)
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> Webpage: http://www.personal.soton.ac.uk/pocm
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.