eRPC Generator (erpcgen)
Rev. 1.12.0
NXP Semiconductors
|
A scoped namespace containing symbols. More...
#include <SymbolScope.hpp>
Classes | |
class | typed_iterator |
Public Types | |
typedef std::map< std::string, Symbol * > | symbol_map_t |
typedef std::vector< Symbol * > | symbol_vector_t |
Public Member Functions | |
SymbolScope () | |
Constructor. | |
virtual | ~SymbolScope () |
Destructor. | |
bool | hasSymbol (const std::string &name, bool recursive=true) |
This function returns true when name is found in symbol map. More... | |
Symbol * | getSymbol (const std::string &name, bool recursive=true) |
This function will return symbol. More... | |
void | addSymbol (Symbol *sym, int32_t pos=-1) |
This function will add symbol to the symbol scope. More... | |
void | replaceSymbol (Symbol *oldSym, Symbol *newSym) |
This function will replace old symbol with new symbol in the symbol scope. More... | |
int32_t | getSymbolPos (const Symbol *sym) |
This function will return symbol position. More... | |
bool | hasParent () const |
Return boolean representation about existence of parent. More... | |
SymbolScope * | getParent () |
Return pointer to parent. More... | |
void | setParent (SymbolScope *parent) |
This function set parent for this object. More... | |
symbol_vector_t::iterator | begin () |
Return begin of symbol vector. More... | |
symbol_vector_t::iterator | end () |
Return end of symbol vector. More... | |
typed_iterator | tbegin (Symbol::symbol_type_t predicateType) |
typed_iterator | tend (Symbol::symbol_type_t predicateType) |
symbol_vector_t | getSymbolsOfType (Symbol::symbol_type_t predicateType) |
This function returns symbol vector with symbols. More... | |
symbol_vector_t | getSymbolVector () |
This function returns symbol vector. More... | |
void | dump () |
This function show debug description about the all symbols. More... | |
void | clear () |
Erase data from m_symbolMap and m_symbolVector. | |
Protected Attributes | |
symbol_map_t | m_symbolMap |
symbol_vector_t | m_symbolVector |
SymbolScope * | m_parent |
A scoped namespace containing symbols.
typedef std::map<std::string, Symbol *> erpcgen::SymbolScope::symbol_map_t |
Map symbol name to symbol type.
typedef std::vector<Symbol *> erpcgen::SymbolScope::symbol_vector_t |
Vector of symbol types.
void SymbolScope::addSymbol | ( | Symbol * | sym, |
int32_t | pos = -1 |
||
) |
This function will add symbol to the symbol scope.
The function will add symbol given by pointer sym to the symbol scope vector m_symbolVector. If symbol with same name is already added, will be throw semantic error.
[in] | sym | Symbol pointer, which is added to symbol scope vector. |
[in] | pos | Position where symbol should be added. Default -1 mean at the end of vector. |
|
inline |
Return begin of symbol vector.
void SymbolScope::dump | ( | ) |
This function show debug description about the all symbols.
|
inline |
Return end of symbol vector.
|
inline |
Return pointer to parent.
Symbol * SymbolScope::getSymbol | ( | const std::string & | name, |
bool | recursive = true |
||
) |
This function will return symbol.
This function returns symbol found in symbol scope map m_symbolMap. Symbol is found using given name.
[in] | name | Name, which is used to find symbol. |
[in] | recursive | If true, then recursive finding is allowed. |
nullptr | (when symbol wasn't found) |
int32_t SymbolScope::getSymbolPos | ( | const Symbol * | sym | ) |
This function will return symbol position.
The function will return symbol position of given symbol by pointer sym from the symbol scope vector m_symbolVector.
[in] | sym | Pointer of symbol, which position is searched. |
SymbolScope::symbol_vector_t SymbolScope::getSymbolsOfType | ( | Symbol::symbol_type_t | predicateType | ) |
|
inline |
This function returns symbol vector.
|
inline |
Return boolean representation about existence of parent.
true | When parent is set. |
false | When parent isn't set. |
bool SymbolScope::hasSymbol | ( | const std::string & | name, |
bool | recursive = true |
||
) |
This function returns true when name is found in symbol map.
This function returns true when name is found in symbol map. Symbol is found using given name.
[in] | name | Name, which is used to find symbol. |
[in] | recursive | If true, then recursive finding is allowed. |
true | (symbol is found) |
false | (symbol isn't found) |
This function will replace old symbol with new symbol in the symbol scope.
The function will remove old symbol and call addSymbol with new symbol.
[in] | oldSym | Symbol pointer, which will be replaced. |
[in] | newSym | Symbol pointer, which will be replacer. |
|
inline |
This function set parent for this object.
[in] | parent | Pointer to given parent. |
SymbolScope::typed_iterator SymbolScope::tbegin | ( | Symbol::symbol_type_t | predicateType | ) |
[in] | predicateType |
SymbolScope::typed_iterator SymbolScope::tend | ( | Symbol::symbol_type_t | predicateType | ) |
[in] | predicateType |
|
protected |
Scope of Symbol
|
protected |
Map Symbols to names.
|
protected |
Vector of Symbols