Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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?

Jonathan