[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Writing a grammar
- From: Chris Babcock <cbabcock@...>
- Date: Wed, 28 Nov 2012 21:43:26 -0700
I have an existing DSL (Diplomacy orders) for which I need to
implement a parser. The language specification consists of a syntax
document and a vocabulary document:
http://aqmn.asciiking.com/data/syntax
http://aqmn.asciiking.com/data/map
I need to write a parser that applies the vocabulary to the syntax and
turns an order stream into an object. There are multiple vocabulary
documents written in a similar format. I think what I need to write
may actually be a parser generator. What I need to know, since I will
be spending many hours on this with little prior background, is LPeg
the right tool for the job? If so, are there beginner documents or
some exercises in writing a trivial parser that might provide me with
a gentler learning curve than the official docs and the academic
papers?
Of course if someone on the list happens to be a fan of the Diplomacy
board game, I'd welcome a little hands on assistance. :-)
And thank you, Steve Donovan, for the wiki article:
http://lua-users.org/wiki/LpegTutorial
Chris
--
Preference will be shown to scoring systems that emphasize solo victories.
- Diplomacy World Cup Charter, section 7