A single node in a parse tree for a sentence.
More...
#include <node.h>
|
| node (class_label cat) |
| Constructs a new node with the given category. More...
|
|
const class_label & | category () const |
|
virtual bool | is_leaf () const =0 |
|
bool | is_temporary () const |
|
virtual bool | equal (const node &other) const =0 |
|
virtual std::unique_ptr< node > | clone () const =0 |
| Clones the given node. More...
|
|
template<class Visitor > |
std::remove_reference< Visitor >::type::result_type | accept (Visitor &&vtor) |
| Accepts a visitor. More...
|
|
template<class Visitor > |
std::remove_reference< Visitor >::type::result_type | accept (Visitor &&vtor) const |
| Accepts a visitor (const version). More...
|
|
template<class Node > |
Node & | as () |
| Casting operation for nodes to derived types. More...
|
|
template<class Node > |
std::add_const< Node >::type & | as () const |
| Casting operation for nodes to derived types. More...
|
|
virtual | ~node ()=default |
| Default virtual destructor for deriving classes.
|
|
|
const class_label | category_ |
| The category for this node.
|
|
A single node in a parse tree for a sentence.
meta::parser::node::node |
( |
class_label |
cat | ) |
|
Constructs a new node with the given category.
- Parameters
-
cat | The category for the new node |
const class_label & meta::parser::node::category |
( |
| ) |
const |
- Returns
- the category for the node
bool meta::parser::node::is_leaf |
( |
| ) |
const |
|
pure virtual |
- Returns
- whether this node is a leaf node
bool meta::parser::node::is_temporary |
( |
| ) |
const |
- Returns
- whether this node is a temporary node inserted during binarization
virtual bool meta::parser::node::equal |
( |
const node & |
other | ) |
const |
|
pure virtual |
- Parameters
-
other | The other subtree to compare with |
- Returns
- whether this subtree is equal to the other subtree
virtual std::unique_ptr<node> meta::parser::node::clone |
( |
| ) |
const |
|
pure virtual |
Clones the given node.
- Returns
- a unique_ptr to a copy of this object
template<class Visitor >
std::remove_reference<Visitor>::type::result_type meta::parser::node::accept |
( |
Visitor && |
vtor | ) |
|
|
inline |
Accepts a visitor.
- Parameters
-
vtor | The visitor to visit each of the nodes in this subtree |
- Returns
- the visitor result for this subtree
template<class Visitor >
std::remove_reference<Visitor>::type::result_type meta::parser::node::accept |
( |
Visitor && |
vtor | ) |
const |
|
inline |
Accepts a visitor (const version).
Can only accept visitors that do not modify the tree directly.
- Parameters
-
vtor | The visitor to visit each of the nodes in this subtree |
- Returns
- the visitor result for this subtree
template<class Node >
Node& meta::parser::node::as |
( |
| ) |
|
|
inline |
template<class Node >
std::add_const<Node>::type& meta::parser::node::as |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files:
- /home/chase/projects/meta/include/parser/trees/node.h
- /home/chase/projects/meta/src/parser/trees/node.cpp