caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Menhir and ocamlyacc: Ambiguous grammar
@ 2007-05-01 19:16 Joel Reymont
  0 siblings, 0 replies; only message in thread
From: Joel Reymont @ 2007-05-01 19:16 UTC (permalink / raw)
  To: Caml List

name_shares:
   | LP expr RP expr SHARES { (Some $2, `Qty $4) }
   | LP expr RP             { (Some $2, `All)    }
   | expr SHARES            { (None, `Qty $1)    }
   |                        { (None, `All)       }

This is intended to parse a "name" that is followed by the # of shares.

The problem is that expr itself can be LP expr LP in which case the  
only differentiator is the SHARES that follows.

Is there any way to parse this using ocamlyacc or Menhir?

	Thanks, Joel

--
http://wagerlabs.com/






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-01 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-01 19:16 Menhir and ocamlyacc: Ambiguous grammar Joel Reymont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).