MLLIF
a MLIR-based Language to Language Interoperability Flyover
Loading...
Searching...
No Matches
mllif::mlir::Node Class Referencefinal

A node for symbol tree. It represents just simple XML serializer. More...

#include <Tree.h>

Collaboration diagram for mllif::mlir::Node:

Public Member Functions

 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.
 
Nodeinsert_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)
 
Nodeinsert (std::deque< std::string > &path, const std::string &tag)
 Inserts new node at given path (first element of path is id of this node)
 

Detailed Description

A node for symbol tree. It represents just simple XML serializer.

Definition at line 10 of file Tree.h.

Constructor & Destructor Documentation

◆ Node()

mllif::mlir::Node::Node ( std::string tag,
std::string name )
inlineexplicit

Creates new node.

Parameters
tagTag of node
nameName (id attribute) of node

Definition at line 53 of file Tree.h.

Here is the call graph for this function:

Member Function Documentation

◆ 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.

Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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
pathPath of new node
tagTag 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
nullptrif path is empty or path's first element is not id of this node

Definition at line 48 of file Tree.cxx.

Here is the call graph for this function:

◆ 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
pathPath of new node
tagTag 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
nullptrif path is empty

Definition at line 28 of file Tree.cxx.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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: