Liking cljdoc? Tell your friends :D

clj-antlr.common

Common functions for building and using parsers.

Common functions for building and using parsers.
raw docstring

antlr-input-streamclj

(antlr-input-stream s)

Deprecated in favor of char-stream. Constructs an ANTLRInputStream out of a String, Reader, or InputStream.

Deprecated in favor of char-stream.
Constructs an ANTLRInputStream out of a String, Reader, or InputStream.
sourceraw docstring

case-changing-char-streamclj

(case-changing-char-stream charstream)
(case-changing-char-stream charstream upper?)

Wraps a CharStream in a CaseChangingCharStream. Called with one argument, defaults to lowercasing all input, but the upper? argument allows for case to be chosen. Adapted from https://github.com/parrt/antlr4/blob/case-insensitivity-doc/doc/resources/CaseChangingCharStream.java.

Wraps a CharStream in a CaseChangingCharStream. Called with one argument,
defaults to lowercasing all input, but the upper? argument allows for case to be chosen.
Adapted from https://github.com/parrt/antlr4/blob/case-insensitivity-doc/doc/resources/CaseChangingCharStream.java.
sourceraw docstring

case-insensitive-input-streamclj

(case-insensitive-input-stream input)

Deprecated in favor of case-changing-char-stream. Constructs an ANTLRInputStream out of a string. Presents all characters to the lexer as lowercase, but getText methods will return the original string. Adapted from https://gist.github.com/sharwell/9424666. Consumes memory proportional to the input string.

Deprecated in favor of case-changing-char-stream.
Constructs an ANTLRInputStream out of a string. Presents all characters to
the lexer as lowercase, but getText methods will return the original string.
Adapted from https://gist.github.com/sharwell/9424666. Consumes memory
proportional to the input string.
sourceraw docstring

char-streamclj

(char-stream s)
(char-stream s opts)

Constructs a charstream. With no options, calls char-stream-from-input. With options:

:case-sensitive? true calls char-stream-from-input, false calls case-changing-char-stream

Constructs a charstream. With no options, calls char-stream-from-input. With
options:

:case-sensitive? true calls char-stream-from-input,
                 false calls case-changing-char-stream
sourceraw docstring

char-stream-from-inputclj

(char-stream-from-input s)

Constructs a CharStream out of a String, Reader, or InputStream.

Constructs a CharStream out of a String, Reader, or InputStream.
sourceraw docstring

childclj

(child node i)

Get a specific child in a tree.

Get a specific child in a tree.
sourceraw docstring

child-countclj

(child-count node)

How many children does a node have?

How many children does a node have?
sourceraw docstring

childrenclj

(children node)

Returns the children of a RuleNode.

Returns the children of a RuleNode.
sourceraw docstring

error-listenerclj

(error-listener)

A stateful error listener which accretes parse errors in a deref-able structure. Deref returns nil if there are no errors; else a sequence of heterogenous maps, depending on what debugging information is available.

A stateful error listener which accretes parse errors in a deref-able
structure. Deref returns nil if there are no errors; else a sequence of
heterogenous maps, depending on what debugging information is available.
sourceraw docstring

fast-keywordclj

(fast-keyword s)

Like (keyword str), but faster.

Like (keyword str), but faster.
sourceraw docstring

fast-keyword-cacheclj

A map of strings to keywords.

A map of strings to keywords.
sourceraw docstring

first-ruleclj

(first-rule grammar)

The name of the first rule in a grammar.

The name of the first rule in a grammar.
sourceraw docstring

input-streamclj

(input-stream s)
(input-stream s opts)

Deprecated in favor of char-stream. Constructs an inputstream. With no options, calls antlr-input-stream. With options:

:case-sensitive? true calls antlr-input-stream, false calls case-insensitive-input-stream

Deprecated in favor of char-stream.
Constructs an inputstream. With no options, calls antlr-input-stream. With
options:

:case-sensitive? true calls antlr-input-stream,
                 false calls case-insensitive-input-stream
sourceraw docstring

multi-hinted-letcljmacro

(multi-hinted-let [name expr classes] & body)

Deprecated, since antlr-input-stream is deprecated. A let expression which expands into multiple type-hinted bodies with runtime type dispatch provided by instanceof. Thanks to amalloy, as usual!

Deprecated, since antlr-input-stream is deprecated.
A let expression which expands into multiple type-hinted bodies with runtime
type dispatch provided by instanceof. Thanks to amalloy, as usual!
sourceraw docstring

parentclj

(parent node)

The parent of a node.

The parent of a node.
sourceraw docstring

parse-errorclj

(parse-error errors tree)

Constructs a new ParseError exception with a list of errors.

Constructs a new ParseError exception with a list of errors.
sourceraw docstring

parser-rule-nameclj

(parser-rule-name parser index)

Given a parser and an integer rule index, returns the string name of that rule. Negative indexes map to nil.

Given a parser and an integer rule index, returns the string name of that
rule. Negative indexes map to nil.
sourceraw docstring

recognition-exception->mapclj

(recognition-exception->map e)

Converts a RecognitionException to a nice readable map.

Converts a RecognitionException to a nice readable map.
sourceraw docstring

rule-indexclj

(rule-index grammar rule-name)

Given a grammar and the name of a rule, returns the integer index of that rule.

Given a grammar and the name of a rule, returns the integer index of that
rule.
sourceraw docstring

textclj

(text node)

The text of a node.

The text of a node.
sourceraw docstring

token-nameclj

(token-name parser index)

Given a parser and a token index, returns the string name of that token. Negative indexes map to nil.

Given a parser and a token index, returns the string name of that token.
Negative indexes map to nil.
sourceraw docstring

tokensclj

(tokens lexer)

A token stream taken from a lexer.

A token stream taken from a lexer.
sourceraw docstring

visitclj

(visit visitor node)

Visits a node with a visitor.

Visits a node with a visitor.
sourceraw docstring

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

× close