It's of interest as an example grammar for those using Kern to build their own grammars, showcasing as much as possible an in-place one-to-one monad-to-macro mapping from parser combinator to generated code.
Work on Grojure ceased in January 2014 when the author switched to Go as the development language for rebuilding the Groovy Language from scratch,
All the example files supplied (i.e. those ending in
.grj in the test directory) run OK, and looking at these reveals what syntax is implemented.
This final release is 0.11.0. It depends on Clojure 1.6.0-beta2.
It incorporates a copy of Kern 0.7.0.
Copyright © 2013 Gavin "Groovy" Grover The Kern portions are Copyright © 2013 Armando Blancas
Distributed under the Eclipse Public License, the same as Clojure.
Put your code in a script file ending in
.grj, and call
grojure.grammar/run-grj-file on it:
(ns user (:use grojure.grammar)) (run-grj-file "my/dir/my_file.grj" "arg1" "arg2")
- first run the Clojure code in the
.cljfile with the same name, here "my/dir/my_file.clj"
- then run the Grojure code in the first paragraph of the
.grjfile, i.e. everything before the first U+2029 or end of file if none
The arguments are available as a list called
*args* in the
From within the first paragraph of the
.grj file, the contents of each subsequent paragraph can be run as Clojure code by calling the appropriate vector entry in either
_z, e.g. calling
_z(1)("th", 'r) with
(print (str (get *args* 0) (get *args* 1) "ee")) in the third paragraph of the file would print