result
is a structure returned by a parse
call. It contains a parsed forest, input and provides means to extract parsed information, trees and input characters.
found
contains true
if the starting symbol was successfuly parsed over the whole input.
Otherwise it contains false
.
If found
is false
, parse_error
contains information why parsing failed.
Contains information how to shape parsed tree when using get_shaped_tree()
method.
Returns pointer to the parsed forest.
Transforms forest into tree and applies trimming according to grammar options or shaping options provided as an argument.
It also transforms ambiguous nodes as children of AMB nodes.
This is called by get_shaped_tree()
.
Applies inlining to a tree (w/o tree paths) according to grammar options or shaping options provided as an argument.
This is called by inline_tree()
.
Applies tree paths inlining to a tree according to grammar options or shaping options provided as an argument.
This is called by inline_tree()
.
Applies inlining to a tree according to grammar options or shaping options provided as an argument. Calls inline_tree_nodes()
and inline_tree_paths()
.
This is called by get_shaped_tree()
.
Trims children terminals from a tree according to grammar options or shaping options provided as an argument.
This is called by get_shaped_tree()
.
Transforms forest into a tree and applies shaping according to grammar options or shaping options provided as an argument.
Extracts the first parse tree from the parsed forest.
true
if input is good = stream is good or mmap is opened.
Returns the input as a string (input's char type, ie. C).
Read terminals from input (input's terminal type, ie. T).
Read terminals from input at position span of a provided node.
Reads terminals of a node and converts them to int. If the conversion fails or the int is out of range returns no value.
Returns true if the parse forest is ambiguous (contains more than one tree).
Returns true
if the parse forest is not ambiguous (contains only a single tree).
Returns ambiguous nodes.
Prints ambiguous nodes.
Returns all nodes and edges of the forest. It is a pair of vectors of nodes and edges. edge is defined as a pair of node ids.
using node_edge = std::pair<pnode, pnode>;
using edges = std::vector<typename pforest::edge>;
using nodes_and_edges = std::pair<pnodes, edges>;
Removes all prefixed symbols from the whole graph by replacing them with their immediate children nodes.
Inlines nodes created by EBNF and binarize transformation prefixes.