This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-03
Channels
- # arachne (31)
- # aws (9)
- # bangalore-clj (7)
- # beginners (46)
- # boot (18)
- # cider (21)
- # cljs-dev (8)
- # clojure (154)
- # clojure-dusseldorf (5)
- # clojure-filipino (3)
- # clojure-ireland (4)
- # clojure-italy (9)
- # clojure-russia (6)
- # clojure-spec (6)
- # clojure-uk (52)
- # clojureremote (3)
- # clojurescript (173)
- # clojurewest (14)
- # cursive (24)
- # data-science (2)
- # datomic (18)
- # defnpodcast (1)
- # devcards (1)
- # hoplon (4)
- # instaparse (29)
- # jobs (2)
- # juxt (1)
- # leiningen (3)
- # lumo (78)
- # off-topic (46)
- # om (9)
- # onyx (42)
- # pedestal (33)
- # perun (3)
- # re-frame (9)
- # reagent (6)
- # slack-help (5)
- # spacemacs (2)
- # specter (6)
- # unrepl (157)
- # untangled (99)
- # yada (32)
@aengelberg , I am trying instaparse against an IETF abnf (https://tools.ietf.org/html/rfc7950 ). I am getting the error Parse error at line 92, column 44: < URI in RFC 3986 >
< a string that matches the rule >
isn't valid BNF. In that spec, it is used for prose that can only be understood by humans.
In Instaparse we use <abc>
completely differently, used to refer to the "hidden" version of the non-terminal abc
.
thank you @aengelberg . I made a change and the parsing moved forward. Now, I am getting an error (in the last few pages of the grammar file, So, I am hoping the grammar is holding up well so far)
CompilerException java.lang.RuntimeException: Error parsing grammar specification: Parse error at line 915, column 32: action-keyword = %s"action"
I don't think %s
is valid ABNF per the spec, though I see what it's getting at, and it wouldn't be too hard to implement.
If you're ok with case insensitive, you could just do "action"
@aengelberg for now, I removed %s and moved on. It is getting close to the end of the file, but, I have this error :
If you really want case sensitive, you could translate it to decimal or hex and use %d
/ %x
You're going to want :input-format :abnf
if you haven't set that already btw
CompilerException java.lang.RuntimeException: a occurs on the right-hand side of your grammar, but not on the left,
(def my-parser (insta/parser (http://clojure.java.io/resource "my.abnf") :input-format :abnf :trace true))
Only thing I can think of is there is a loose a
or A
somewhere...
Or it's one of the < a string that matches the rule >
and the a
is the first of many invalid things in that expression.
@aengelberg .. great . that is the issue. one such usage got left out. I changed it, now, that parsing is completing without error. Thank you.
sweet
I am not sure about the change I made (I dont know much about grammars), though .. I changed the text from yang-version-arg-str = < a string that matches the rule > < yang-version-arg > to yang-version-arg-str = yang-version-arg yang-version-arg = "1.1"
if that is correct, I wonder why the ietf folks did not do the same. As it is , the ietf abnf is not parseable, right.
I think some grammars are written with the intention of helping humans to write programs, rather than to be fed to parser generators like Instaparse.
So they don't feel the need to exactly follow the ABNF spec.