Skip to main content

Module ast

Module ast 

Source

Structs§

ASTNode
AST node. Grammar rules have children, tokens do not.
AnyMap
Standard “AnyMap” for putting whatever you want in it.
PrdError
Parser error state.
PrdGlobal
Exposable parts of current parser state.

Enums§

GuardResult
Result of a Guard checking if a given alternation should be taken or not.

Functions§

ast_to_shape_string
For testing only: convert the AST’s shape to a string.
parse
Worklist implementation: Parse the given token stream (produced by bnf::tokenize) into an AST, using the given bnf::Grammar, and taking the given root rule name as the starting point.
parse_recursive
Recursive implementation: Parse the given token stream (produced by bnf::tokenize) into an AST, using the given bnf::Grammar, and taking the given root rule name as the starting point.
print_ast_pred_recdec
For debugging only: print out the given AST.
visit_ast
Visit the AST with a possibly-impure callback. The AST itself cannot be modified this way.

Type Aliases§

Guard
Arguments:
Hook
Arguments: