The syntax for PEGs is largely the same as peg-bootstrap. Of interest might be the ever-present variable:
val pos : int ref
Which will hold the current position in the file.
For an example PEG, look at the parser itself (smlpeg.peg).
There is little or no error handling at present. This should be fixed eventually.
-- Gian Perrone , November 2011