diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.files | 2 | ||||
-rw-r--r-- | src/analysis/analysis.cpp | 12 | ||||
-rw-r--r-- | src/analysis/expression.cpp | 42 | ||||
-rw-r--r-- | src/analysis/expression.h | 33 |
4 files changed, 87 insertions, 2 deletions
diff --git a/src/Makefile.files b/src/Makefile.files index 4e4f055..bf8669b 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -1,5 +1,7 @@ SRC = analysis/analysis.cpp \ analysis/analysis.h \ + analysis/expression.cpp \ + analysis/expression.h \ analysis/function.cpp \ analysis/function.h \ analysis/walkitem.h \ diff --git a/src/analysis/analysis.cpp b/src/analysis/analysis.cpp index 3221ccf..6da4af3 100644 --- a/src/analysis/analysis.cpp +++ b/src/analysis/analysis.cpp @@ -21,11 +21,14 @@ #include "command.h" +#include "analysis/expression.h" #include "analysis/function.h" #include "analysis/walkitem.h" #include "nodes/decl/function_decl.h" +#include "nodes/expr/modify_expr.h" + #include "localconsts.h" namespace Analysis @@ -51,9 +54,14 @@ void walkTree(Node *node, WalkItem wi) WalkItem analyseNode(Node *node, WalkItem wi) { // searching function declaration - if (node->nodeType == FUNCTION_DECL) + switch (node->nodeType) { - return analyseFunction(static_cast<FunctionDeclNode*>(node), wi); + case FUNCTION_DECL: + return analyseFunction(static_cast<FunctionDeclNode*>(node), wi); + case MODIFY_EXPR: + return analyseModifyExpr(static_cast<ModifyExprNode*>(node), wi); + default: + break; } return wi; } diff --git a/src/analysis/expression.cpp b/src/analysis/expression.cpp new file mode 100644 index 0000000..6745a42 --- /dev/null +++ b/src/analysis/expression.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2015 Andrei Karas + * + * This file is part of AstDumper. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "analysis/expression.h" + +#include "command.h" +#include "logger.h" + +#include "analysis/analysis.h" +#include "analysis/walkitem.h" + +#include "nodes/expr/modify_expr.h" + +#include <set> + +#include "localconsts.h" + +namespace Analysis +{ + +WalkItem analyseModifyExpr(ModifyExprNode *node, WalkItem wi) +{ + return wi; +} + +} diff --git a/src/analysis/expression.h b/src/analysis/expression.h new file mode 100644 index 0000000..b32e099 --- /dev/null +++ b/src/analysis/expression.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2015 Andrei Karas + * + * This file is part of AstDumper. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ANALYSIS_EXPRESSION_H +#define ANALYSIS_EXPRESSION_H + +#include "includes.h" + +struct ModifyExprNode; +struct WalkItem; + +namespace Analysis +{ + WalkItem analyseModifyExpr(ModifyExprNode *node, WalkItem wi); +} + +#endif // ANALYSIS_EXPRESSION_H |