From 1c22be28854915b6b1e4172e4324a38d6afd4682 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Jun 2015 00:29:53 +0300 Subject: Add parsing node TARGET_OPTION_NODE. --- src/Makefile.files | 4 +++- src/includes/nodeincludes.h | 1 + src/includes/nodeshandling.inc | 1 + src/includes/parserdefines.inc | 1 + src/nodes/targetoption.h | 35 +++++++++++++++++++++++++++++++++++ src/parsers/targetoption.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/nodes/targetoption.h create mode 100644 src/parsers/targetoption.cpp diff --git a/src/Makefile.files b/src/Makefile.files index 9c69a23..d2982cb 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -298,4 +298,6 @@ SRC = analysis/analysis.cpp \ nodes/expr/switch_expr.h \ parsers/expr/switch_expr.cpp \ nodes/stmt/switch_stmt.h \ - parsers/stmt/switch_stmt.cpp \ No newline at end of file + parsers/stmt/switch_stmt.cpp \ + nodes/targetoption.h \ + parsers/targetoption.cpp \ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index 8ef6c56..52bedcb 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -127,3 +127,4 @@ #include "nodes/expr/staticcast_expr.h" #include "nodes/expr/switch_expr.h" #include "nodes/stmt/switch_stmt.h" +#include "nodes/targetoption.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index da960bc..0df5b2c 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -126,3 +126,4 @@ handleNodeType(SCOPE_REF, ScopeRef) handleNodeType(STATIC_CAST_EXPR, StaticCastExpr) handleNodeType(SWITCH_EXPR, SwitchExpr) handleNodeType(SWITCH_STMT, SwitchStmt) +handleNodeType(TARGET_OPTION_NODE, TargetOption) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index e9b98b4..646238e 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -126,3 +126,4 @@ parserDefine(ScopeRef); parserDefine(StaticCastExpr); parserDefine(SwitchExpr); parserDefine(SwitchStmt); +parserDefine(TargetOption); diff --git a/src/nodes/targetoption.h b/src/nodes/targetoption.h new file mode 100644 index 0000000..30b2d32 --- /dev/null +++ b/src/nodes/targetoption.h @@ -0,0 +1,35 @@ +/* + * 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 . + */ + +#ifndef NODES_TARGETOPTIONNODE_H +#define NODES_TARGETOPTIONNODE_H + +#include "nodes/base/node.h" + +#include + +struct TargetOptionNode : public Node +{ + TargetOptionNode() : + Node() + { + } +}; + +#endif // NODES_TARGETOPTIONNODE_H diff --git a/src/parsers/targetoption.cpp b/src/parsers/targetoption.cpp new file mode 100644 index 0000000..ade2359 --- /dev/null +++ b/src/parsers/targetoption.cpp @@ -0,0 +1,38 @@ +/* + * 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 . + */ + +#include "includes/parserincludes.h" + +parserDefine(TargetOption); + + +#include "nodes/targetoption.h" + +namespace Generic +{ + +void parseTargetOptionNode(TargetOptionNode *node) +{ + fillType(node); + Log::dump(node); + + // TREE_TARGET_OPTION look like in internal format +} + +} -- cgit v1.2.3-70-g09d2