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-31 (22:32)
From: Erik de Castro Lopo <ocaml-erikd@m...>
Subject: Re: [Caml-list] Parser state variables
Alain Frisch wrote:

> Another one is to make semantic actions return functions which take the
> state as an argument.

I've also used a variation on this which places a filter function
with signature 

    filter : state -> token -> token

between the lexer and the parser and modifies the stream of tokens 
as required by the current state. 

  Erik de Castro Lopo
"Death is perhaps too easy" -- Iqbal Sacranie in 1989 about
Salman Rushdie, author of "The Satanic Verses". Sacranie 
received a knighthood in 2005 as the face of 'moderate'
British Islam. He has never disowned his earlier statement.