Esperanto.Parser behaviour (esperanto v0.1.0)
Parser interface
Link to this section Summary
Callbacks
Enchant parser returning a new tree paremters
Parse given input paremters
Check if parser should handle current walker input paremters
Link to this section Types
Link to this type
tree()
Specs
tree() :: any()
Link to this section Functions
Link to this function
to_xml(tree, opts \\ [])
Link to this section Callbacks
Specs
enchant_parser(tree(), NaryTree.Node.t(), integer()) :: tree()
Enchant parser returning a new tree paremters:
tree- Current AST treetree- the node being createdparent_id- id of the parent node returns: a new enchanted tree
Link to this callback
parse(walker, tree, parent_id, opts)
Specs
parse( walker :: Esperanto.Walker.t(), tree :: tree(), parent_id :: integer(), opts :: keyword() ) :: {tree(), Esperanto.Walker.t()}
Parse given input paremters:
walker- Parse is responsible to walk trough inputtree- Current AST treeparent_id- id of the parent nodeopts- id of the parent node returns: A tuple with the new tree and new walker
Link to this callback
should_parse(walker, tree, parent_id, opts)
Specs
should_parse( walker :: Esperanto.Walker.t(), tree :: tree(), parent_id :: integer(), opts :: keyword() ) :: boolean()
Check if parser should handle current walker input paremters:
walker- Parse is responsible to walk trough inputtree- Current AST treeparent_id- id of the parent nodeopts- id of the parent node returns: true if the the parse should be used. Note that if two parsers returns true anAmbigousSyntaxErroris raised