From 7b0774752e8f163f4861bb338172fcdcd60cee36 Mon Sep 17 00:00:00 2001 From: Tuowen Zhao Date: Thu, 29 Sep 2016 16:15:38 -0600 Subject: changes for recusing --- include/chillAST/chillAST_node.hh | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'include/chillAST/chillAST_node.hh') diff --git a/include/chillAST/chillAST_node.hh b/include/chillAST/chillAST_node.hh index b0e7622..a8fb50f 100644 --- a/include/chillAST/chillAST_node.hh +++ b/include/chillAST/chillAST_node.hh @@ -5,15 +5,41 @@ #include "chillAST_def.hh" #include +#include //! generic node of the actual chillAST, a multiway tree node. class chillAST_Node { protected: - void gatherTypedef(std::map> map, chillAST_TypedefTable* tdt); - void gatherSymbol(std::map> map, chillAST_SymbolTable* tdt); - void gatherRecord(std::map> map, chillAST_RecordTable *tdt); - void gatherOther(chillAST_SourceFile *s); - void fixReference(std::map> map); + /*! + * Add typedef to containing scope + * @param tdt the containing scope + */ + void gatherTypedef(chillAST_TypedefTable* tdt); + /*! + * Add symboldefinition to containing scope + * @param st the containing scope + */ + void gatherSymbol(chillAST_SymbolTable* st); + /*! + * Add struct definition to containing scope + * @param rt the containing scope + */ + void gatherRecord(chillAST_RecordTable *rt); + /*! + * Add function declaration & definition to the source file + * @param s + */ + void gatherFunctionDecl(std::vector *s); + /*! + * Add macro definition to the source file + * @param s + */ + void gatherMacroDecl(std::vector *s); + /*! + * Fix the pointer reference in a source file + * @param nameMap a mapping from string to the corresponding declarations, stack is used to mimic scoping + */ + void fixReference(std::map> nameMap); public: // TODO decide how to hide some data //! this Node's parent @@ -199,8 +225,6 @@ public: void setMetaComment(const char *c) { metacomment = strdup(c); }; - virtual void mergeChildInfo(chillAST_Node); - virtual void addChild(chillAST_Node *c); virtual void addChildren(const chillAST_NodeList &c); -- cgit v1.2.3-70-g09d2