| eRPC Generator (erpcgen) Rev. 1.8.1 NXP Semiconductors

- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Attributes | List of all members
erpcgen::Symbol Class Reference

Base class for all named declarations in the IDL. More...

`#include <Symbol.h>`

Inheritance diagram for erpcgen::Symbol:

## Public Types
enum | symbol_type_t { kConstSymbol, kEnumMemberSymbol, kFunctionSymbol, kInterfaceSymbol, kProgramSymbol, kStructMemberSymbol, kTypenameSymbol, kUnionCaseMemberSymbol, kAliasTypeSymbol, kArrayTypeSymbol, kBuiltinTypeSymbol, kEnumTypeSymbol, kFunctionTypeSymbol, kListTypeSymbol, kStructTypeSymbol, kUnionTypeSymbol }
| Supported symbol types.

## Public Member Functions
| Symbol (symbol_type_t symType)
| Constructor. More...
| Symbol (symbol_type_t symType, const std::string &name)
| Constructor. More...
| Symbol (symbol_type_t symType, const Token &tok)
| Constructor. More...
virtual | ~Symbol ()
| Destructor.
symbol_type_t | getSymbolType () const
| This function returns symbol type. More...
const std::string & | getName () const
| This function returns symbol name. More...
void | setName (const std::string &newName)
| This function set symbol name. More...
token_loc_t & | getLocation ()
| This function returns location for symbol. More...
void | setLocation (const token_loc_t &loc)
| This function set location for symbol. More...
int | getFirstLine () const
| This function return first line from location of symbol. More...
int | getLastLine () const
| This function return last line from location of symbol. More...
virtual bool | isBuiltin () const
| This function return "false" value as default for identify builtin type. More...
virtual std::string | getDescription () const
| This function returns description about the symbol (symbol name). More...
void | addAnnotation (const Annotation &a)
| This function add annotation to vector of symbol annotations. More...
std::string | printAnnotations ()
| This function returns description about annotation. More...
Annotation * | findAnnotation (std::string name, Annotation::program_lang_t lang)
| Find annotation in the annotation list. More...
std::vector< Annotation * > | getAnnotations (std::string name, Annotation::program_lang_t lang)
| Find annotations matching name in the annotation list. More...
const std::vector< Annotation > & | getAnnotations () const
| Return all Symbol annotations. More...
Value * | getAnnValue (const std::string annName, Annotation::program_lang_t lang)
| This function search and returns Value object for given annotation name. More...
std::string | getAnnStringValue (const std::string annName, Annotation::program_lang_t lang)
| This function search and returns string for given annotation name. More...
std::string | getMlComment ()
| This function returns multiline comment for this symbol declared in IDL file. More...
void | setMlComment (std::string comment)
| This function set multiline comment for this symbol declared in IDL file. More...
std::string | getIlComment ()
| This function returns inline comment for this symbol declared in IDL file. More...
void | setIlComment (std::string comment)
| This function set inline comment for this symbol declared in IDL file. More...

## Protected Attributes
symbol_type_t | m_symbolType
std::string | m_name
token_loc_t | m_location
std::vector< Annotation > | m_annotations
std::string | m_mlComment
std::string | m_ilComment

## Detailed Description

Base class for all named declarations in the IDL.

## Constructor & Destructor Documentation

erpcgen::Symbol::Symbol | ( | symbol_type_t | symType | ) |
| inline

Constructor.

This function set symbol type variable to given symbol type.

Parameters

  [in] | symType | Enum symbol type.

erpcgen::Symbol::Symbol | ( | symbol_type_t | symType,
|  | const std::string & | name
| ) |  |
| inline

Constructor.

This function set symbol type variable to given symbol type and name to given name.

Parameters

  [in] | symType | Enum symbol type.
  [in] | name | Name for symbol.

erpcgen::Symbol::Symbol | ( | symbol_type_t | symType,
|  | const Token & | tok
| ) |  |
| inline

Constructor.

This function set symbol type variable to given symbol type, name to token value and location to token location.

Parameters

  [in] | symType | Enum symbol type.
  [in] | tok | Token for symbol, which contains name and location.

## Member Function Documentation

void erpcgen::Symbol::addAnnotation | ( | const Annotation & | a | ) |
| inline

This function add annotation to vector of symbol annotations.

Parameters

  [in] | a | AstNode contains annotation information.

Annotation * Symbol::findAnnotation | ( | std::string | name,
|  | Annotation::program_lang_t | lang
| ) |  |

Find annotation in the annotation list.

Parameters

  [in] | name | Annotation name.
  [in] | lang | Programing language for which is annotation intended.

Returns
  An index into the annotation list

vector< Annotation * > Symbol::getAnnotations | ( | std::string | name,
|  | Annotation::program_lang_t | lang
| ) |  |

Find annotations matching name in the annotation list.

Parameters

  [in] | name | Annotation name.
  [in] | lang | Programing language for which is annotation intended.

Returns
  A vector of matching annotations

const std::vector<Annotation>& erpcgen::Symbol::getAnnotations | ( |  | ) | const
| inline

Return all Symbol annotations.

Returns
  A vector of Symbol annotations.

string Symbol::getAnnStringValue | ( | const std::string | annName,
|  | Annotation::program_lang_t | lang
| ) |  |

This function search and returns string for given annotation name.

Parameters

  [in] | annName | Given annotation name.
  [in] | lang | Programing language for which is annotation intended.

Returns
  empty string if annotation is not found else string value.

Value * Symbol::getAnnValue | ( | const std::string | annName,
|  | Annotation::program_lang_t | lang
| ) |  |

This function search and returns Value object for given annotation name.

Parameters

  [in] | annName | Given annotation name.
  [in] | lang | Programing language for which is annotation intended.

Returns
  NULL if annotation is not found else value object.

virtual std::string erpcgen::Symbol::getDescription | ( |  | ) | const
| inline virtual

This function returns description about the symbol (symbol name).

Returns
  Symbol name.

Reimplemented in erpcgen::Function, erpcgen::UnionCase, erpcgen::EnumType, erpcgen::StructMember, erpcgen::StructType, erpcgen::Interface, erpcgen::EnumMember, erpcgen::UnionType, erpcgen::AliasType, erpcgen::ArrayType, erpcgen::ListType, erpcgen::FunctionType, and erpcgen::VoidType.

int erpcgen::Symbol::getFirstLine | ( |  | ) | const
| inline

This function return first line from location of symbol.

Returns
  Return first line from location of symbol.

std::string erpcgen::Symbol::getIlComment | ( |  | ) |
| inline

This function returns inline comment for this symbol declared in IDL file.

Returns
  Inline comment for symbol.

int erpcgen::Symbol::getLastLine | ( |  | ) | const
| inline

This function return last line from location of symbol.

Returns
  Return last line from location of symbol.

token_loc_t& erpcgen::Symbol::getLocation | ( |  | ) |
| inline

This function returns location for symbol.

Returns
  Return location for symbol.

std::string erpcgen::Symbol::getMlComment | ( |  | ) |
| inline

This function returns multiline comment for this symbol declared in IDL file.

Returns
  Multiline comment for symbol.

const std::string& erpcgen::Symbol::getName | ( |  | ) | const
| inline

This function returns symbol name.

Returns
  Return symbol name.

symbol_type_t erpcgen::Symbol::getSymbolType | ( |  | ) | const
| inline

This function returns symbol type.

Returns
  Return symbol type.

virtual bool erpcgen::Symbol::isBuiltin | ( |  | ) | const
| inline virtual

This function return "false" value as default for identify builtin type.

Returns
  Always return false.

Reimplemented in erpcgen::DataType, and erpcgen::BuiltinType.

string Symbol::printAnnotations | ( |  | ) |

This function returns description about annotation.

Returns
  Annotation description.

void erpcgen::Symbol::setIlComment | ( | std::string | comment | ) |
| inline

This function set inline comment for this symbol declared in IDL file.

Parameters

  [in] | comment | Inline comment for symbol.

void erpcgen::Symbol::setLocation | ( | const token_loc_t & | loc | ) |
| inline

This function set location for symbol.

Parameters

  [in] | loc | Symbol location.

void erpcgen::Symbol::setMlComment | ( | std::string | comment | ) |
| inline

This function set multiline comment for this symbol declared in IDL file.

Parameters

  [in] | comment | Multiline comment for symbol.

void erpcgen::Symbol::setName | ( | const std::string & | newName | ) |
| inline

This function set symbol name.

Parameters

  [in] | newName | New name for symbol.

## Member Data Documentation

std::vector<Annotation> erpcgen::Symbol::m_annotations
| protected

Vector of annotations belong to symbol.

std::string erpcgen::Symbol::m_ilComment
| protected

Comment next to symbol.

token_loc_t erpcgen::Symbol::m_location
| protected

Location in parsed file.

std::string erpcgen::Symbol::m_mlComment
| protected

Comment above to symbol.

std::string erpcgen::Symbol::m_name
| protected

Symbol name.

symbol_type_t erpcgen::Symbol::m_symbolType
| protected

Symbol type.

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

- Symbol.h
- Type.cpp