Liking cljdoc? Tell your friends :D

clj-antlr.common

Common functions for building and using parsers.

Common functions for building and using parsers.

antlr-input-stream

(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-stream

(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-stream

(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-stream

(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-input

(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

child

(child node i)

Get a specific child in a tree.

Get a specific child in a tree.
sourceraw docstring

child-count

(child-count node)

How many children does a node have?

How many children does a node have?
sourceraw docstring

children

(children node)

Returns the children of a RuleNode.

Returns the children of a RuleNode.
sourceraw docstring

error-listener

(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-keyword

(fast-keyword s)

Like (keyword str), but faster.

Like (keyword str), but faster.
sourceraw docstring

fast-keyword-cache

A map of strings to keywords.

A map of strings to keywords.
sourceraw docstring

first-rule

(first-rule grammar)

The name of the first rule in a grammar.

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

input-stream

(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-letmacro

(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

parent

(parent node)

The parent of a node.

The parent of a node.
sourceraw docstring

parse-error

(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-name

(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->map

(recognition-exception->map e)

Converts a RecognitionException to a nice readable map.

Converts a RecognitionException to a nice readable map.
sourceraw docstring

rule-index

(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

text

(text node)

The text of a node.

The text of a node.
sourceraw docstring

token-name

(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

tokens

(tokens lexer)

A token stream taken from a lexer.

A token stream taken from a lexer.
sourceraw docstring

visit

(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