Liking cljdoc? Tell your friends :D

clj-antlr.interpreted

Interpreter for antlr grammars. Slightly slower, but easier to use than the full antlr compilation process.

Interpreter for antlr grammars. Slightly slower, but easier to use than the
full antlr compilation process.

grammar

(grammar grammar-or-filename)

Loads a Grammar from a string filename, or a string containing a grammar inline. If the string contains newlines, interprets as a grammar string; otherwise as a filename.

Loads a Grammar from a string filename, or a string containing a grammar
inline. If the string contains newlines, interprets as a grammar string;
otherwise as a filename.
sourceraw docstring

lexer-interpreter

(lexer-interpreter grammar)

Builds a new lexer interpreter around an empty input stream. Used to initialize our parser, which will later reset and re-use this object for speed.

Builds a new lexer interpreter around an empty input stream. Used to
initialize our parser, which will later reset and re-use this object
for speed.
sourceraw docstring

load-string-grammar

(load-string-grammar string)

Loads a grammar from a string.

Loads a grammar from a string.
sourceraw docstring

parse

(parse grammar opts input)

Given a Grammar, options, and text to parse (a string, reader, or inputstream), returns a map of the :parser, :tree, and :errors for the input.

Given a Grammar, options, and text to parse (a string, reader, or
inputstream), returns a map of the :parser, :tree, and :errors for the
input.
sourceraw docstring

parser

(parser filename)

Construct a new parser.

Construct a new parser.
sourceraw docstring

parser-interpreter

(parser-interpreter grammar lexer)

Builds a new parser interpreter around a given grammar and lexer.

Builds a new parser interpreter around a given grammar and lexer.
sourceraw docstring

reset-lexer-interpreter!

(reset-lexer-interpreter! lexer error-listener char-stream)

Prepares a lexer interpreter for a new run.

Prepares a lexer interpreter for a new run.
sourceraw docstring

reset-parser-interpreter!

(reset-parser-interpreter! parser error-listener token-stream)

Prepares a parser interpreter for a new run.

Prepares a parser interpreter for a new run.
sourceraw docstring

rule-index

(rule-index grammar rule-name)

Finds the index of the given rule in a grammar. Throws if the rule is not present in the given grammar. Example

(rule-index my-grammar :address)

Finds the index of the given rule in a grammar. Throws if the rule is not
present in the given grammar. Example

(rule-index my-grammar :address)
sourceraw docstring

singlethreaded-parser

(singlethreaded-parser grammar)

Creates a new single-threaded parser for a grammar.

Creates a new single-threaded parser for a grammar.
sourceraw docstring

tool

(tool)

Construct a new ANTLR tool

Construct a new ANTLR tool
sourceraw docstring

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

× close