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
[Caml-list] ocamllex+ocamlyacc and not parsing properly
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-08-08 (04:23)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] ocamllex+ocamlyacc and not parsing properly
Is there any way to call another rule based on some variable in
ocamllex? I see you can pass arguments to a rule, but what use are
these except in the actions part?

I have two cases:

if (and only if) it's the first token, ':' starts a token with no
spaces. and if (and only if) it's the last token, ':' starts a token
that consumes the rest of the input line.

I'm completely lost how to do this in light of the fact that the lexer
starts at the first rule for each parsed token =(

Is it possible to restart parsing from the start of the matched lexeme
using an action?