Package-level declarations

Types

Link copied to clipboard

A utility for reporting the execution tree of a parsing run, and outputting it in a human-readable format.

Link copied to clipboard
class DescribedType<T>(val type: ParserNodeDeclaration<T>, val expectations: List<Expectation<T, *>>)

A node type declaration (providing a way to make the actual type) with its descriptor (which declares what the type expects).

Link copied to clipboard
sealed class ExpectationResult<in T>

Class for representing the results of an expectation

Link copied to clipboard
class NiwenParser<T>(types: List<DescribedType<*>>, rootType: ParserNodeDeclaration<T>)

Class for a full parser that is ready to parse a chain of tokens.

Link copied to clipboard
class NiwenParserException(message: String, cause: Throwable? = null) : TegralException

Exception type for anything thrown by Niwen Parser.

Link copied to clipboard
fun interface ParserNodeDeclaration<T>

A node declaration. This simple interface provides a way to turn the description of a node into an actual node.

Link copied to clipboard
class ParsingContext(val tokens: List<Token>, typeMap: Map<ParserNodeDeclaration<*>, DescribedType<*>>, val branchSeeker: BranchSeeker? = null)

This object contains the information that is passed to expectations, and is global over a single parser run.

Link copied to clipboard

An implementation of ParserNodeDeclaration that uses reflection to initialize instances.

Link copied to clipboard
class TypeDescription<T>(val arguments: Map<NodeParameterKey<T, *>, *>)

The description for the creation of a type

Functions

Link copied to clipboard

Creates a node declaration that uses reflection to initialize instances of the nodes.