Liking cljdoc? Tell your friends :D

instacheck.codegen


check-and-order-rulesclj/s

(check-and-order-rules grammar)

Takes an instaparse grammar and returns a sequence of the rule names in the order that they can be defined (reverse dependency order). If the grammar contains mutually recursive (non-direct) rules it will throw an indicating which rules are cyclic.

Takes an instaparse grammar and returns a sequence of the rule
names in the order that they can be defined (reverse dependency
order). If the grammar contains mutually recursive (non-direct)
rules it will throw an indicating which rules are cyclic.
raw docstring

eval-generator-sourceclj/s

(eval-generator-source src)

Takes a src string containing Clojure code, evaluates it and returns the last thing evaluated.

Takes a src string containing Clojure code, evaluates it and
returns the last thing evaluated.
raw docstring

generator-func->generatorclj/s

(generator-func->generator gen-fn start & [weights])

Takes a generator factory function, a start rule keyword, and an optional default weights map. Returns a test.check generator.

Takes a generator factory function, a start rule keyword, and an
optional default weights map. Returns a test.check generator.
raw docstring

grammar->generator-defs-sourceclj/s

(grammar->generator-defs-source {:keys [start] :as ctx} grammar)

Takes an grammar (loaded using load-grammar) and returns the text of a namespace with top-level defines (defs) for all the rules. If the :start is specified in the ctx then this the name of the rule to use as the starting rule of the grammar. If :start is not specified then the first rule in the grammar file is used as the starting rule. Only the start rule flattens the generated values into a final string.

Takes an grammar (loaded using load-grammar) and returns the text
of a namespace with top-level defines (defs) for all the rules. If
the :start is specified in the ctx then this the name of the rule to
use as the starting rule of the grammar. If :start is not specified
then the first rule in the grammar file is used as the starting
rule. Only the start rule flattens the generated values into a final
string.
raw docstring

grammar->generator-func-sourceclj/s

(grammar->generator-func-source {:keys [function] :as ctx} grammar)

Takes an grammar (loaded using load-grammar) and returns the text of a namespace with a single Clojure function. The function takes an optional weights map and returns a map of all the rules as generators (indexed by rule-name keyword).

Takes an grammar (loaded using load-grammar) and returns the text
of a namespace with a single Clojure function. The function takes
an optional weights map and returns a map of all the rules as
generators (indexed by rule-name keyword).
raw docstring

RULES-PER-FUNCclj/s


tag-to-genclj/s

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close