From d4d1b73adc682457c6950d96113c7468107872b0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Jun 2015 23:17:02 +0300 Subject: Add parsing node SCOPE_REF. --- src/Makefile.files | 4 +++- src/includes/nodeincludes.h | 1 + src/includes/nodeshandling.inc | 1 + src/includes/parserdefines.inc | 1 + src/nodes/ref/scope_ref.h | 35 +++++++++++++++++++++++++++++++++++ src/parsers/ref/scope_ref.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 src/nodes/ref/scope_ref.h create mode 100644 src/parsers/ref/scope_ref.cpp diff --git a/src/Makefile.files b/src/Makefile.files index f10c68f..8ec2b38 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -290,4 +290,6 @@ SRC = analysis/analysis.cpp \ nodes/expr/range_expr.h \ parsers/expr/range_expr.cpp \ nodes/expr/rrotate_expr.h \ - parsers/expr/rrotate_expr.cpp \ No newline at end of file + parsers/expr/rrotate_expr.cpp \ + nodes/ref/scope_ref.h \ + parsers/ref/scope_ref.cpp \ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index 62a1130..494b41b 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -123,3 +123,4 @@ #include "nodes/cst/ptrmem_cst.h" #include "nodes/expr/range_expr.h" #include "nodes/expr/rrotate_expr.h" +#include "nodes/ref/scope_ref.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index 4fc0d6c..0e77f12 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -122,3 +122,4 @@ handleNodeType(MAX_EXPR, MaxExpr) handleNodeType(PTRMEM_CST, PtrMemCst) handleNodeType(RANGE_EXPR, RangeExpr) handleNodeType(RROTATE_EXPR, RRotateExpr) +handleNodeType(SCOPE_REF, ScopeRef) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index c6091b6..498fc31 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -122,3 +122,4 @@ parserDefine(MaxExpr); parserDefine(PtrMemCst); parserDefine(RangeExpr); parserDefine(RRotateExpr); +parserDefine(ScopeRef); diff --git a/src/nodes/ref/scope_ref.h b/src/nodes/ref/scope_ref.h new file mode 100644 index 0000000..46403d1 --- /dev/null +++ b/src/nodes/ref/scope_ref.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_REF_SCOPEREFNODE_H +#define NODES_REF_SCOPEREFNODE_H + +#include "nodes/base/ref.h" + +#include + +struct ScopeRefNode : public RefNode +{ + ScopeRefNode() : + RefNode() + { + } +}; + +#endif // NODES_REF_SCOPEREFNODE_H diff --git a/src/parsers/ref/scope_ref.cpp b/src/parsers/ref/scope_ref.cpp new file mode 100644 index 0000000..1dc98c1 --- /dev/null +++ b/src/parsers/ref/scope_ref.cpp @@ -0,0 +1,40 @@ +/* + * 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(ScopeRef); + +#include "parsers/base/ref.h" + +#include "nodes/ref/scope_ref.h" + +namespace Generic +{ + +void parseScopeRefNode(ScopeRefNode *node) +{ + fillType(node); + fillRefLocation(node); + Log::dump(node); + + fillRefOperands(node); +} + +} -- cgit v1.2.3-70-g09d2