From 1356e77d8e711acd06bee16911ec568902eca54d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 13 Jun 2015 19:19:51 +0300 Subject: Add parsing node BREAK_STMT. --- src/Makefile.files | 4 +++- src/includes/nodeincludes.h | 1 + src/includes/nodeshandling.inc | 1 + src/includes/parserdefines.inc | 1 + src/nodes/stmt/break_stmt.h | 35 +++++++++++++++++++++++++++++++++++ src/parsers/stmt/break_stmt.cpp | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 src/nodes/stmt/break_stmt.h create mode 100644 src/parsers/stmt/break_stmt.cpp (limited to 'src') diff --git a/src/Makefile.files b/src/Makefile.files index d3718cd..d0897f5 100644 --- a/src/Makefile.files +++ b/src/Makefile.files @@ -227,4 +227,6 @@ SRC = analysis/analysis.cpp \ nodes/expr/abs_expr.h \ parsers/expr/abs_expr.cpp \ nodes/cst/void_cst.h \ - parsers/cst/void_cst.cpp \ No newline at end of file + parsers/cst/void_cst.cpp \ + nodes/stmt/break_stmt.h \ + parsers/stmt/break_stmt.cpp \ No newline at end of file diff --git a/src/includes/nodeincludes.h b/src/includes/nodeincludes.h index af3dd83..54e4298 100644 --- a/src/includes/nodeincludes.h +++ b/src/includes/nodeincludes.h @@ -93,3 +93,4 @@ #include "nodes/type/union_type.h" #include "nodes/expr/abs_expr.h" #include "nodes/cst/void_cst.h" +#include "nodes/stmt/break_stmt.h" diff --git a/src/includes/nodeshandling.inc b/src/includes/nodeshandling.inc index b3676d4..2b27be6 100644 --- a/src/includes/nodeshandling.inc +++ b/src/includes/nodeshandling.inc @@ -92,3 +92,4 @@ handleNodeType(STRING_CST, StringCst) handleNodeType(UNION_TYPE, UnionType) handleNodeType(ABS_EXPR, AbsExpr) handleNodeType(VOID_CST, VoidCst) +handleNodeType(BREAK_STMT, BreakStmt) diff --git a/src/includes/parserdefines.inc b/src/includes/parserdefines.inc index a8f2a1f..6fe0456 100644 --- a/src/includes/parserdefines.inc +++ b/src/includes/parserdefines.inc @@ -92,3 +92,4 @@ parserDefine(StringCst); parserDefine(UnionType); parserDefine(AbsExpr); parserDefine(VoidCst); +parserDefine(BreakStmt); diff --git a/src/nodes/stmt/break_stmt.h b/src/nodes/stmt/break_stmt.h new file mode 100644 index 0000000..a64ff43 --- /dev/null +++ b/src/nodes/stmt/break_stmt.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_STMT_BREAKSTMTNODE_H +#define NODES_STMT_BREAKSTMTNODE_H + +#include "nodes/base/stmt.h" + +#include + +struct BreakStmtNode : public StmtNode +{ + BreakStmtNode() : + StmtNode() + { + } +}; + +#endif // NODES_STMT_BREAKSTMTNODE_H diff --git a/src/parsers/stmt/break_stmt.cpp b/src/parsers/stmt/break_stmt.cpp new file mode 100644 index 0000000..0055835 --- /dev/null +++ b/src/parsers/stmt/break_stmt.cpp @@ -0,0 +1,37 @@ +/* + * 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(BreakStmt); + +#include "parsers/base/stmt.h" + +#include "nodes/stmt/break_stmt.h" + +namespace Generic +{ + +void parseBreakStmtNode(BreakStmtNode *node) +{ + fillType(node); + Log::dump(node); +} + +} -- cgit v1.2.3-70-g09d2