(debug n w i)
Very very inefficient but useful in some cases. Prints out 'i' number of characters from 'w' followed by 'n', and then resets the position in 'w' as if nothing had been consumed.
Very very inefficient but useful in some cases. Prints out 'i' number of characters from 'w' followed by 'n', and then resets the position in 'w' as if nothing had been consumed.
(fastest-theoretical s)
Finding a lower-bound on any optimizations for speed starts by simply reading each character in the string to be parsed 'b'. The function 'end' is the conditional with 'm' consuming.
Finding a lower-bound on any optimizations for speed starts by simply reading each character in the string to be parsed 'b'. The function 'end' is the conditional with 'm' consuming.
Currently oriented around strings and characters, but could easily be adapted for other approaches.
Currently oriented around strings and characters, but could easily be adapted for other approaches.
(c t)
The character at pos
The character at pos
(end t)
End of input
End of input
(gp t)
Get pos
Get pos
(m t)
Returns the 'c' then (inc pos)
Returns the 'c' then (inc pos)
(sp t j)
Set pos
Set pos
(lpegs t s)
Produces a rule that allows any character in the string 's' as a valid match.
Produces a rule that allows any character in the string 's' as a valid match.
(pegasus n g w)
Returns the AST resulting from parsing the wrapped input 'w' given a grammar definition 'g' and starting at rule 'n' in 'g'.
Returns the AST resulting from parsing the wrapped input 'w' given a grammar definition 'g' and starting at rule 'n' in 'g'.
(pegs s)
Produces a rule that consumes each character in the string 's' in the order given in 's'.
Produces a rule that consumes each character in the string 's' in the order given in 's'.
(post-process n g w fn-map)
Similar to with-fns. Other parameters match pegasus. The final result is assumed to be the value of the root map that pegasus would have returned.
Similar to with-fns. Other parameters match pegasus. The final result is assumed to be the value of the root map that pegasus would have returned.
(self-check)
This ensures that grammar-grammar is a valid grammar. It attempts to parse itself. While not every part of valid grammars is used in grammar-grammar, it's a nice sanity check.
This ensures that grammar-grammar is a valid grammar. It attempts to parse itself. While not every part of valid grammars is used in grammar-grammar, it's a nice sanity check.
(self-check-fastest)
This returns the fastest time to read each character of grammar-grammar
This returns the fastest time to read each character of grammar-grammar
(validate g)
Validate can help identify problems in grammars. Using grammar-grammar as the grammar for valid grammars, it will return nil if the given grammar 'g' is not valid.
Validate can help identify problems in grammars. Using grammar-grammar as the grammar for valid grammars, it will return nil if the given grammar 'g' is not valid.
(with-fns g fn-map)
(with-fns g fn-map fn-type)
Simplifies attaching 'post-processing' functions to Non-Terminals in the grammar. Keys in 'fn-map' should match keys in the grammar 'g'. Values in 'fn-map' should be functions accepting the result of having parsed some input according to the related value in 'g'.
Simplifies attaching 'post-processing' functions to Non-Terminals in the grammar. Keys in 'fn-map' should match keys in the grammar 'g'. Values in 'fn-map' should be functions accepting the result of having parsed some input according to the related value in 'g'.
(wrap-string s)
(wrap-string s j)
Reifies IAmotoen around a string 's', possibly at a given starting point 'j'. The function 'charAt' is part of the mechanism to walk through the string.
Reifies IAmotoen around a string 's', possibly at a given starting point 'j'. The function 'charAt' is part of the mechanism to walk through the string.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close