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 26 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 69 of file Tree.h.

Here is the call graph for this function:
Here is the caller 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 99 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 105 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 111 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 117 of file Tree.h.

◆ insert()

auto 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 68 of file Tree.cxx.

Here is the call graph for this function:

◆ insert_inplace()

auto 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 46 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 87 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 93 of file Tree.h.

◆ print()

auto mllif::mlir::Node::print ( llvm::raw_ostream & os) const

Serialize subtree as XML to stream.

Returns
Children of node

Definition at line 20 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 75 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 81 of file Tree.h.


The documentation for this class was generated from the following files: