A node for symbol tree. It represents just simple XML serializer.
More...
#include <Tree.h>
|
| Node (std::string tag, std::string name) |
| Creates new node.
|
|
std::string & | tag () |
| Gets a tag of node.
|
|
std::string | tag () const |
| Gets a tag of node as readonly.
|
|
std::string & | name () |
| Gets a name of node.
|
|
std::string | name () const |
| Gets a name of node as readonly.
|
|
std::vector< std::pair< std::string, std::string > > & | attributes () |
| Gets attributes of node.
|
|
const std::vector< std::pair< std::string, std::string > > & | attributes () const |
| Gets attributes of node as readonly.
|
|
std::vector< Node > & | children () |
| Gets children of node.
|
|
const std::vector< Node > & | children () const |
| Gets children of node as readonly.
|
|
void | print (llvm::raw_ostream &os) const |
| Serialize subtree as XML to stream.
|
|
Node * | insert_inplace (std::deque< std::string > &path, const std::string &tag) |
| Inserts new node in-place at given path (first element of path is not id of this node)
|
|
Node * | insert (std::deque< std::string > &path, const std::string &tag) |
| Inserts new node at given path (first element of path is id of this node)
|
|
A node for symbol tree. It represents just simple XML serializer.
Definition at line 10 of file Tree.h.
◆ Node()
mllif::mlir::Node::Node |
( |
std::string | tag, |
|
|
std::string | name ) |
|
inlineexplicit |
Creates new node.
- Parameters
-
tag | Tag of node |
name | Name (id attribute) of node |
Definition at line 53 of file Tree.h.
◆ attributes() [1/2]
std::vector< std::pair< std::string, std::string > > & mllif::mlir::Node::attributes |
( |
| ) |
|
|
inline |
Gets attributes of node.
- Returns
- Attributes of node
Definition at line 83 of file Tree.h.
◆ attributes() [2/2]
const std::vector< std::pair< std::string, std::string > > & mllif::mlir::Node::attributes |
( |
| ) |
const |
|
inline |
Gets attributes of node as readonly.
- Returns
- Attributes of node
Definition at line 89 of file Tree.h.
◆ children() [1/2]
std::vector< Node > & mllif::mlir::Node::children |
( |
| ) |
|
|
inline |
Gets children of node.
- Returns
- Children of node
Definition at line 95 of file Tree.h.
◆ children() [2/2]
const std::vector< Node > & mllif::mlir::Node::children |
( |
| ) |
const |
|
inline |
Gets children of node as readonly.
- Returns
- Children of node
Definition at line 101 of file Tree.h.
◆ insert()
mllif::mlir::Node * mllif::mlir::Node::insert |
( |
std::deque< std::string > & | path, |
|
|
const std::string & | tag ) |
Inserts new node at given path (first element of path is id of this node)
- Parameters
-
path | Path of new node |
tag | Tag of new node (tag of missing will be namespace ) |
- Returns
- Created node (If path is already used by other node, that node will be return; Given arguments ignored)
- Return values
-
nullptr | if path is empty or path's first element is not id of this node |
Definition at line 48 of file Tree.cxx.
◆ insert_inplace()
mllif::mlir::Node * mllif::mlir::Node::insert_inplace |
( |
std::deque< std::string > & | path, |
|
|
const std::string & | tag ) |
Inserts new node in-place at given path (first element of path is not id of this node)
- Parameters
-
path | Path of new node |
tag | Tag of new node (tag of missing will be namespace ) |
- Returns
- Created node (If path is already used by other node, that node will be return; Given arguments ignored)
- Return values
-
Definition at line 28 of file Tree.cxx.
◆ name() [1/2]
std::string & mllif::mlir::Node::name |
( |
| ) |
|
|
inline |
Gets a name of node.
- Returns
- Name of node
Definition at line 71 of file Tree.h.
◆ name() [2/2]
std::string mllif::mlir::Node::name |
( |
| ) |
const |
|
inline |
Gets a name of node as readonly.
- Returns
- Name of node
Definition at line 77 of file Tree.h.
◆ print()
void mllif::mlir::Node::print |
( |
llvm::raw_ostream & | os | ) |
const |
Serialize subtree as XML to stream.
- Returns
- Children of node
Definition at line 3 of file Tree.cxx.
◆ tag() [1/2]
std::string & mllif::mlir::Node::tag |
( |
| ) |
|
|
inline |
Gets a tag of node.
- Returns
- Tag of node
Definition at line 59 of file Tree.h.
◆ tag() [2/2]
std::string mllif::mlir::Node::tag |
( |
| ) |
const |
|
inline |
Gets a tag of node as readonly.
- Returns
- Tag of node
Definition at line 65 of file Tree.h.
The documentation for this class was generated from the following files:
- mllif/Frontend/MLIR/include/mllif/Frontend/MLIR/Tree.h
- mllif/Frontend/MLIR/lib/Tree.cxx