[Grace-core] consolidated parser combinator grammar

James Noble kjx at ecs.vuw.ac.nz
Mon Dec 26 02:34:22 PST 2011


Hi all

so the attached file  is a definition of very basic parser combinators in Grace,
the definition of a Grace grammar in terms of those combinators, 
and tests of both combinators and the Grammar.
(the file is more usefully NewOOL/sample\ code/combinators.grace in the repository) 

The combinators are slow, not terribly fully featured, but they do work!

You can test this on minigrace (paste the whole file in to the top-left window):

http://homepages.ecs.vuw.ac.nz/~mwh/minigrace/js/

or by building the minigrace on C system here from the latest tarball here:

http://homepages.ecs.vuw.ac.nz/~mwh/minigrace/dist/

That this works at all is of course due to Michael Homer,
who is building minigrace.

The main omission from the grammar is that it does not consider layout;
rather requires explicit semicolons.  For the purpose of a language definition
(rather than a practical parser) that seems OK for now, although ideally
either an extension or a short algorithmic description of Grace's layout
rule would be useful.    It does have "new style" class definitions, types,
generics with where clauses, and matching block arguments. 

What it needs most is feedback from people who understand grammars
rather more than I do. I'm sure its not completely done, but it is good 
enough as far as it goes e.g. as a basis for some formal work, and 
hopefully to so go as an appendix in the spec.

James


-------------- next part --------------
A non-text attachment was scrubbed...
Name: combinators.grace
Type: application/octet-stream
Size: 73762 bytes
Desc: not available
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20111226/3defd535/attachment-0001.obj>


More information about the Grace-core mailing list