10 #ifndef _EMBEDDED_RPC__SYMBOLSCANNER_H_ 11 #define _EMBEDDED_RPC__SYMBOLSCANNER_H_ 13 #include "AstWalker.hpp" 14 #include "types/AliasType.hpp" 15 #include "types/EnumMember.hpp" 16 #include "types/EnumType.hpp" 17 #include "types/Interface.hpp" 18 #include "types/Program.hpp" 19 #include "types/StructType.hpp" 20 #include "types/SymbolScope.hpp" 21 #include "types/UnionType.hpp" 683 #endif // _EMBEDDED_RPC__SYMBOLSCANNER_H_ void addDoxygenComments(Symbol *symbol, AstNode *above, AstNode *trailing)
This function sets to given symbol given doxygen comments.
Definition: SymbolScanner.cpp:1706
virtual ~SymbolScanner()
Destructor.
Definition: SymbolScanner.hpp:76
Annotation::program_lang_t getAnnotationLang(AstNode *annotationNode)
Helper function to get programming language type if specified for which is annotation intended...
Definition: SymbolScanner.cpp:1559
DataType * lookupDataTypeByName(const Token &tok, SymbolScope *scope, bool recursive=true)
This function returns pointer to new type object.
Definition: SymbolScanner.cpp:1336
void checkAnnotationBeforeAdding(AstNode *annotation, Symbol *symbol)
This function check annotation just before it will be added to symbol.
Definition: SymbolScanner.cpp:1582
bool containsStructEnumDeclaration(const AstNode *typeNode)
Returns true when given Astnode is enum or structure declaration.
Definition: SymbolScanner.cpp:1360
DataType * lookupDataType(const AstNode *typeNode)
This function returns pointer to new type object.
Definition: SymbolScanner.cpp:1366
Scans for symbol names.
Definition: SymbolScanner.hpp:32
bool rhsIsAStringLiteral(AstNode *rhs)
Determines if the right hand side of a constant declaration is a string literal.
Definition: SymbolScanner.cpp:130
Member of a struct.
Definition: StructMember.hpp:38
uint64_t getIntExprValue(const AstNode *exprNode)
This function returns token integer value.
Definition: SymbolScanner.cpp:1453
Interface * m_currentInterface
Definition: SymbolScanner.hpp:88
virtual AstNode * handleEnum(AstNode *node, top_down) override
This function end handle enum.
Definition: SymbolScanner.cpp:185
StructType * m_currentStruct
Definition: SymbolScanner.hpp:89
virtual AstNode * handleStruct(AstNode *node, top_down) override
This function start handle struct.
Definition: SymbolScanner.cpp:635
Typedef.
Definition: AliasType.hpp:26
virtual AstNode * handleParam(AstNode *node, top_down) override
This function start handle function parameter.
Definition: SymbolScanner.cpp:1193
Homogeneous AST node class.
Definition: AstNode.hpp:36
DataType * getDataTypeForConst(AstNode *typeNode)
This function returns the data type for a constant variable.
Definition: SymbolScanner.cpp:135
Performs a depth-first walk of an AST.
Definition: AstWalker.hpp:41
Program declaration.
Definition: Program.hpp:28
Structure data type.
Definition: StructType.hpp:29
Base class for all named declarations in the IDL.
Definition: Symbol.hpp:28
Value * getAnnotationValue(AstNode *annotationNode)
Helper function to get Value from annotation AstNode.
Definition: SymbolScanner.cpp:1543
void addGlobalSymbol(Symbol *symbol)
This function add symbol into global symbol scope.
Definition: SymbolScanner.cpp:1791
bool enumMemberHasValue(AstNode *enumMember)
Check to see if enum member is assigned a value by the user.
Definition: SymbolScanner.cpp:296
Value * getValueForConst(AstNode *const node, DataType *const constDataType)
Gets the value object for the const variable.
Definition: SymbolScanner.cpp:67
virtual AstNode * handleType(AstNode *node, top_down) override
This function start handle type.
Definition: SymbolScanner.cpp:148
Abstract base class for values of arbitrary types.
Definition: Value.hpp:27
virtual AstNode * handleEnumMember(AstNode *node, bottom_up) override
This function end handle enum member.
Definition: SymbolScanner.cpp:252
EnumType * m_currentEnum
Definition: SymbolScanner.hpp:91
Program * m_currentProgram
Definition: SymbolScanner.hpp:90
Program * getProgram()
Program is out of global symbol scope.
Definition: SymbolScanner.hpp:83
virtual AstNode * handleProgram(AstNode *node, top_down) override
This function start handle program.
Definition: SymbolScanner.cpp:609
virtual AstNode * handleFunction(AstNode *node, top_down) override
This function start handle function.
Definition: SymbolScanner.cpp:1023
SymbolScanner(SymbolScope *globals, const std::string &fileName)
This function is constructor of symbol scanner class.
Definition: SymbolScanner.hpp:61
A scoped namespace containing symbols.
Definition: SymbolScope.hpp:28
StructMember * createCallbackParam(StructMember *structMember, const std::string &name)
This function creates new function parameter.
Definition: SymbolScanner.cpp:1721
bool rhsIsAnExpression(AstNode *rhs)
Determines if the right hand side of a constant declaration is an expression.
Definition: SymbolScanner.cpp:126
void addAnnotations(AstNode *childTok, Symbol *symbol)
This function add annotations to vector of symbol annotations.
Definition: SymbolScanner.cpp:1496
virtual AstNode * handleConst(AstNode *node, bottom_up) override
This function handles a constant definition.
Definition: SymbolScanner.cpp:53
Base class for data types.
Definition: DataType.hpp:26
SymbolScope * m_globals
Definition: SymbolScanner.hpp:87
Encapsulates all information about a token.
Definition: Token.hpp:60
virtual AstNode * handleStructMember(AstNode *node, bottom_up) override
This function end handle struct member.
Definition: SymbolScanner.cpp:736
DataType * createArrayType(const AstNode *typeNode)
This function returns pointer to new array object.
Definition: SymbolScanner.cpp:1402
virtual AstNode * handleExpr(AstNode *node, bottom_up) override
This function start handle expression.
Definition: SymbolScanner.cpp:1329
Value * getValueFromSymbol(Token &tok)
Get value from symbol table for name defined by given token.
Definition: SymbolScanner.cpp:1417
Specifier type to select bottom-up handler using ADL.
Definition: AstWalker.hpp:81
Enumerate data type.
Definition: EnumType.hpp:28
void setParameterDirection(StructMember *param, AstNode *directionNode)
set parameter direction: in, out, inout
Definition: SymbolScanner.cpp:1298
std::map< std::string, DataType * > m_forwardDeclarations
Definition: SymbolScanner.hpp:95
DataType * createListType(const AstNode *typeNode)
This function returns pointer to new list object.
Definition: SymbolScanner.cpp:1390
Discriminated union data type.
Definition: UnionType.hpp:28
void scanStructForAnnotations()
Controlling annotations used on structure members.
Definition: SymbolScanner.cpp:1632
virtual AstNode * handleUnaryOp(AstNode *node, bottom_up) override
This function end handle unary operator.
Definition: SymbolScanner.cpp:540
An interface that contains functions.
Definition: Interface.hpp:29
virtual AstNode * handleUnionCase(AstNode *node, top_down) override
Definition: SymbolScanner.cpp:870
SymbolScanner(SymbolScope *globals)
This function is constructor of symbol scanner class.
Definition: SymbolScanner.hpp:42
virtual AstNode * handleUnion(AstNode *node, top_down) override
Handles Union data type while traversing down the AST.
Definition: SymbolScanner.cpp:772
std::vector< UnionCase * > m_emptyUnionCases
Definition: SymbolScanner.hpp:94
void removeForwardDeclaration(DataType *dataType)
This function unregister union/structure declarations.
Definition: SymbolScanner.cpp:1775
UnionType * m_currentUnion
Definition: SymbolScanner.hpp:93
virtual AstNode * handleInterface(AstNode *node, top_down) override
This function start handle interface.
Definition: SymbolScanner.cpp:994
Definition: AstNode.hpp:26
virtual void handleRoot(AstNode *node, bottom_up) override
This function is called at the end of scanning.
Definition: SymbolScanner.cpp:33
virtual AstNode * handleBinaryOp(AstNode *node, bottom_up) override
This function end handle binary operator.
Definition: SymbolScanner.cpp:317
AliasType * m_currentAlias
Definition: SymbolScanner.hpp:92
Specifier type to select top-down handler using ADL.
Definition: AstWalker.hpp:78
void addForwardDeclaration(DataType *dataType)
This function registers forward union/structure declarations.
Definition: SymbolScanner.cpp:1747