Version française
Home     About     Download     Resources     Contact us    
Browse thread
menhir
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Pottier <Francois.Pottier@i...>
Subject: Re: [Caml-list] menhir

On Wed, May 02, 2007 at 07:38:15AM +0200, I wrote:
> Internally, the construction of the automaton uses a pseudo-token,
> written #, which stands for the end of the token stream. This token
> can appear in conflict explanation messages.

Actually, I should say: # stands for the end of a sentence that we are trying
to recognize. That is, if S is a start symbol, then Menhir builds a new start
symbol S' with the production S' -> S #. As a result, when we reach a state
where a reduce action ("reduce production p") has lookahead symbol #, this
means: "in this state, perhaps we have consumed a sentence derived from S; in
that case, we should reduce production p and not read anything more". It does
not mean that we have reached the end of the physical token stream, only that
we have reached the end of what we were supposed to read.

-- 
François Pottier
Francois.Pottier@inria.fr
http://cristal.inria.fr/~fpottier/