Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Parser state variables
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-10-28 (07:12)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Parser state variables
On Fri, 2005-10-28 at 08:22 +0200, Alain Frisch wrote:
> skaller wrote:
> > Are there any plans to extend Ocamlyacc to allow state variables,
> > in a manner similar to the recent extensions to Ocamllex to
> > allow them?
> > 
> > At present, there are two workarounds:
> Another one is to make semantic actions return functions which take the
> state as an argument. This is similar to introducing a new data type to
> represent pure concrete parse trees and then post-process these trees to
> produce abstract syntax.

Aha! Another win for higher order functions! Thanks for this
insight. Dang -- so obvious when you see it :) 

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: