Fork of clj-antlr
supporting ANTLRv4 alternative labels.
At the moment it's just a rather bad patch to the library for my personal purposes, I may try to 'refactor' it and make a pull request later.
Version left as 0.2.5-SNAPSHOT
Original way is broken, you can now use it as following
(require [clj-antlr.coerce :as coerce]
[clj-antlr.interpreted :as interpreted])
(defn parse
[grammar-file input-file]
(let [input-string (slurp input-file)
grammar-str (slurp grammar-file)
grammar (interpreted/grammar grammar-str)
m (interpreted/parse grammar {} input-string)
e (coerce/tree->sexpr m)]
e))
(parse "grammars/Json.g4" "data/test.json")