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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: Re: [Caml-list] camlp4 grammar and LIST1

On Mar 10, 2009, at 11:01 PM, Jake Donham wrote:

> An approach
> that works for me is to think "recursive descent" and always give
> rules that check at least one token before branching to another rule.


Something like this then?

   sellMethod:
   [
     [ "Next"; "Bar"; at = OPT "At$"; e = expr;
       f = [ [ "Stop" | "Lower" ] -> fun x -> Stop x
           | [ "Limit" | "Higher" ] -> fun x -> Limit x
           ] -> (f e, at)
     ]
   ];


---
http://tinyco.de
--- Mac & iPhone