diff --git a/abnf/hello-abnf/project.clj b/abnf/hello-abnf/project.clj index 316277c..b528125 100644 --- a/abnf/hello-abnf/project.clj +++ b/abnf/hello-abnf/project.clj @@ -3,5 +3,6 @@ :url "http://example.com/FIXME" :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" :url "https://www.eclipse.org/legal/epl-2.0/"} - :dependencies [[org.clojure/clojure "1.10.0"]] + :dependencies [[org.clojure/clojure "1.10.0"] + [instaparse "1.4.10"]] :repl-options {:init-ns hello-abnf.core}) diff --git a/abnf/hello-abnf/src/hello_abnf/core.clj b/abnf/hello-abnf/src/hello_abnf/core.clj index 533db80..ad32ed9 100644 --- a/abnf/hello-abnf/src/hello_abnf/core.clj +++ b/abnf/hello-abnf/src/hello_abnf/core.clj @@ -1,6 +1,16 @@ -(ns hello-abnf.core) +(ns hello-abnf.core + (:require [instaparse.core :as insta])) (defn foo "I don't do a whole lot." [x] (println x "Hello, World!")) + +(def as-and-bs + (insta/parser + "S = AB* + AB = A B + A = 'a'+ + B = 'b'+")) + +(as-and-bs "aaaaabbbaaaabb")