Crate wagon_parser

Source
Expand description

WAGon Parser

A crate containing the Parser for the WAGon DSL as well as a checker and associated functions. As long as you do not need any extensions to the WAGon DSL itself, this will likely be your main interface to the ecosystem. After you have a parsed a full Wag tree, you can do with it whatever you require.

Modules§

firstpass
The checker
parser
The parser

Macros§

any_token
A macro that automatically expands to allow either a wagon_lexer::Tokens::ProductionToken, a wagon_lexer::Tokens::MathToken or a wagon_lexer::Tokens::MetadataToken.
either_token
A macro that automatically expands to allow either a wagon_lexer::Tokens::ProductionToken or a wagon_lexer::Tokens::MathToken with the same name.
either_token_ref
The same as either_token! but as a reference.

Structs§

SpannableNode
A node is anything that implements Parse. SpannableNode then, is a wrapper around this node that holds span information about it. It is intended to be a mostly see-through wrapper around whatever the inner node is. Parse is implemented on it in a way that automatically calculates the span information.

Traits§

WrapSpannable
A trait for internal use to automatically convert between nodes and SpannableNode.

Functions§

parse_and_check
Parse an input string and check if the resulting WAG is valid.