Crate sprout

Source

Modules§

parse
prelude
tokenize

Macros§

alphabet
Create an Alphabet by providing definitions for all token types.
build_grammar
Internal implementation of [grammar]. Potentially useful because it uses an external GrammarBuilder that is passed as a parameter.
grammar
Create a Grammar by providing definitions for its procedures.

Structs§

ASTNode
A node in the AST. It represents an occurrence of one of the procedures from the grammar in the text. As such, it has three properties:
Parser
The Parser is instantiated with an Alphabet and Grammar, and provides the parse method to directly compile a String to an AST.
ParsingError
An error object returned when a part of the parsing process failed. It contains message, a String that describes what went wrong, and pos, a TextPosition that points to the problematic location in the text whose parsing was attempted.
TextPosition
A position in the text.

Type Aliases§

AST
An AST (abstract syntax tree). Its nodes and represent occurrences of grammar procedures in the parsed text.