On 4/8/07, Martin Jambon <[EMAIL PROTECTED]> wrote:
> On Sat, 7 Apr 2007, Nicolas Pouillard wrote:
>
> > On 4/5/07, Martin Jambon <[EMAIL PROTECTED]> wrote:
> >>
> >> On Thu, 5 Apr 2007, Hugo Ferreira wrote:
> >>

[...]

>
> >> You shouldn't try to do this because the parser looks only one token ahead
> >> to make its decision. If you add a rule that starts from "let" (it has
> >> to), the token which enables the parser to select this rule is in position
> >> 3, so it comes too late. Camlp4 will not warn you about the conflict but
> >> fail during preprocessing because it will choose either the predefined
> >> "let" rule or yours without knowing if it's the right one.
> >
> > In fact it's wrong camlp4 can takes more than one token of look ahead.
> > It will try to match the input with all the firsts terminals of a rule.
>
> I am not sure I understand, but this is a crucial matter that should be
> thoroughly documented.

In fact that's not so simple, the implementation is the only reference
and extracting the algorithm is an hard task.

One can say that camlp4 use all terminals on the beginning of the rule
to choose if it choose to follow this rule.

-- 
Nicolas Pouillard

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ocaml-developer" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/ocaml-developer?hl=en
For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html
-~----------~----~----~----~------~----~------~--~---

Reply via email to