eRPC Generator (erpcgen)  Rev. 1.12.0
NXP Semiconductors
erpcgen::Symbol Class Reference

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

#include <Symbol.hpp>

Inheritance diagram for erpcgen::Symbol:
erpcgen::ConstType erpcgen::DataType erpcgen::EnumMember erpcgen::Function erpcgen::Interface erpcgen::Program erpcgen::StructMember erpcgen::UnionCase

Public Types

enum  symbol_type_t {
  kConstSymbol,
  kEnumMemberSymbol,
  kFunctionSymbol,
  kInterfaceSymbol,
  kProgramSymbol,
  kStructMemberSymbol,
  kTypenameSymbol,
  kUnionCaseMemberSymbol
}
 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...
 
bool isConstSymbol () const
 This function is testing symbol type. More...
 
bool isEnumMemberSymbol () const
 This function is testing symbol type. More...
 
bool isFunctionSymbol () const
 This function is testing symbol type. More...
 
bool isInterfaceSymbol () const
 This function is testing symbol type. More...
 
bool isProgramSymbol () const
 This function is testing symbol type. More...
 
bool isStructMemberSymbol () const
 This function is testing symbol type. More...
 
bool isDatatypeSymbol () const
 This function is testing symbol type. More...
 
bool isUnionCaseSymbol () const
 This function is testing symbol type. More...
 
token_loc_tgetLocation ()
 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 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...
 
AnnotationfindAnnotation (const std::string &name, Annotation::program_lang_t lang)
 Find annotation in the annotation list. More...
 
std::vector< Annotation * > getAnnotations (const 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...
 
ValuegetAnnValue (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 (const 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 (const 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< Annotationm_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)
inlineexplicit

Constructor.

This function set symbol type variable to given symbol type.

Parameters
[in]symTypeEnum 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]symTypeEnum symbol type.
[in]nameName 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]symTypeEnum symbol type.
[in]tokToken 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]aAstNode contains annotation information.
Annotation * Symbol::findAnnotation ( const std::string &  name,
Annotation::program_lang_t  lang 
)

Find annotation in the annotation list.

Parameters
[in]nameAnnotation name.
[in]langPrograming language for which is annotation intended.
Returns
An index into the annotation list
vector< Annotation * > Symbol::getAnnotations ( const std::string &  name,
Annotation::program_lang_t  lang 
)

Find annotations matching name in the annotation list.

Parameters
[in]nameAnnotation name.
[in]langPrograming 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]annNameGiven annotation name.
[in]langPrograming 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]annNameGiven annotation name.
[in]langPrograming language for which is annotation intended.
Returns
NULL if annotation is not found else value object.
virtual std::string erpcgen::Symbol::getDescription ( ) const
inlinevirtual
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.
bool erpcgen::Symbol::isConstSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is ConstSymbol.
falseWhen symbol isn't ConstSymbol.
bool erpcgen::Symbol::isDatatypeSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is TypenameSymbol.
falseWhen symbol isn't TypenameSymbol.
bool erpcgen::Symbol::isEnumMemberSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is EnumMemberSymbol.
falseWhen symbol isn't EnumMemberSymbol.
bool erpcgen::Symbol::isFunctionSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is FunctionSymbol.
falseWhen symbol isn't FunctionSymbol.
bool erpcgen::Symbol::isInterfaceSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is InterfaceSymbol.
falseWhen symbol isn't InterfaceSymbol.
bool erpcgen::Symbol::isProgramSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is ProgramSymbol.
falseWhen symbol isn't ProgramSymbol.
bool erpcgen::Symbol::isStructMemberSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is StructMemberSymbol.
falseWhen symbol isn't StructMemberSymbol.
bool erpcgen::Symbol::isUnionCaseSymbol ( ) const
inline

This function is testing symbol type.

Return values
trueWhen symbol is UnionCaseMemberSymbol.
falseWhen symbol isn't UnionCaseMemberSymbol.
string Symbol::printAnnotations ( )

This function returns description about annotation.

Returns
Annotation description.
void erpcgen::Symbol::setIlComment ( const std::string &  comment)
inline

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

Parameters
[in]commentInline comment for symbol.
void erpcgen::Symbol::setLocation ( const token_loc_t loc)
inline

This function set location for symbol.

Parameters
[in]locSymbol location.
void erpcgen::Symbol::setMlComment ( const std::string &  comment)
inline

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

Parameters
[in]commentMultiline comment for symbol.
void erpcgen::Symbol::setName ( const std::string &  newName)
inline

This function set symbol name.

Parameters
[in]newNameNew 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: