diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-03 18:26:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-03 18:26:36 +0300 |
commit | 353973e99f0be7d685e98bbdd7a020c9cbd282e4 (patch) | |
tree | be5bd75f315424388ed5ebbae881d5bc038cfa7e | |
parent | 35109669823accf98cd1563e3d4f9a3aceaf0207 (diff) | |
download | paranucker-353973e99f0be7d685e98bbdd7a020c9cbd282e4.tar.gz paranucker-353973e99f0be7d685e98bbdd7a020c9cbd282e4.tar.bz2 paranucker-353973e99f0be7d685e98bbdd7a020c9cbd282e4.tar.xz paranucker-353973e99f0be7d685e98bbdd7a020c9cbd282e4.zip |
Remove useless extern variable plugin_is_GPL_compatible from files.
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/logger.cpp | 3 | ||||
-rw-r--r-- | src/parsers/functiondeclnode.cpp | 4 | ||||
-rw-r--r-- | src/parsers/functiontypenode.cpp | 2 | ||||
-rw-r--r-- | src/parsers/generic.cpp | 9 | ||||
-rw-r--r-- | src/parsers/resultdeclnode.cpp | 40 | ||||
-rw-r--r-- | src/parsers/resultdeclnode.h | 34 |
7 files changed, 87 insertions, 7 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 462bebc..be8da61 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,8 @@ SRC = nodes/functiondeclnode.h \ parsers/functiondeclnode.h \ parsers/functiontypenode.cpp \ parsers/functiontypenode.h \ + parsers/resultdeclnode.cpp \ + parsers/resultdeclnode.h \ parsers/generic.cpp \ parsers/generic.h \ includes.h \ diff --git a/src/logger.cpp b/src/logger.cpp index 6e057c9..330337e 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -50,11 +50,12 @@ void log(const Node *const node) return; } fprintf(stderr, "%s", node->getIndent().c_str()); + fprintf(stderr, "%s ", node->nodeType.c_str()); if (!node->label.empty()) fprintf(stderr, "%s ", node->label.c_str()); if (!node->file.empty()) fprintf(stderr, "%s %d:%d ", node->file.c_str(), node->line, node->column); - fprintf(stderr, "%s\n", node->nodeType.c_str()); + fprintf(stderr, "\n"); } }
\ No newline at end of file diff --git a/src/parsers/functiondeclnode.cpp b/src/parsers/functiondeclnode.cpp index d88d292..2d76333 100644 --- a/src/parsers/functiondeclnode.cpp +++ b/src/parsers/functiondeclnode.cpp @@ -27,8 +27,6 @@ #include "localconsts.h" -extern int plugin_is_GPL_compatible; - namespace Generic { @@ -39,6 +37,8 @@ void parseFunctionDeclNode(Node *node) Log::log(node); Node *typeNode = createEmptyNode(node, TREE_TYPE(node->gccNode)); parseNode(typeNode); + Node *resultNode = createEmptyNode(node, DECL_RESULT(node->gccNode)); + parseNode(resultNode); } } diff --git a/src/parsers/functiontypenode.cpp b/src/parsers/functiontypenode.cpp index 323735a..b5548ca 100644 --- a/src/parsers/functiontypenode.cpp +++ b/src/parsers/functiontypenode.cpp @@ -27,8 +27,6 @@ #include "localconsts.h" -extern int plugin_is_GPL_compatible; - namespace Generic { diff --git a/src/parsers/generic.cpp b/src/parsers/generic.cpp index 2b20a72..2db51aa 100644 --- a/src/parsers/generic.cpp +++ b/src/parsers/generic.cpp @@ -26,11 +26,10 @@ #include "parsers/functiondeclnode.h" #include "parsers/functiontypenode.h" +#include "parsers/resultdeclnode.h" #include "localconsts.h" -extern int plugin_is_GPL_compatible; - namespace Generic { @@ -50,6 +49,9 @@ Node *createEmptyNode(Node *parent, tree gccNode) case FUNCTION_TYPE: node = new FunctionTypeNode; break; + case RESULT_DECL: + node = new Node; + break; default: Log::log(parent, "Not supported node type: %s", get_tree_code_name(TREE_CODE(node->gccNode))); @@ -80,6 +82,9 @@ void parseNode(Node *node) case FUNCTION_TYPE: parseFunctionTypeNode(node); break; + case RESULT_DECL: + parseResultDeclNode(node); + break; default: Log::log(node, "Not supported node type: %s", get_tree_code_name(TREE_CODE(node->gccNode))); diff --git a/src/parsers/resultdeclnode.cpp b/src/parsers/resultdeclnode.cpp new file mode 100644 index 0000000..9d32fa3 --- /dev/null +++ b/src/parsers/resultdeclnode.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 <http://www.gnu.org/licenses/>. + */ + +#include "parsers/resultdeclnode.h" + +#include "logger.h" + +#include "parsers/generic.h" + +#include "nodes/node.h" + +#include "localconsts.h" + +namespace Generic +{ + +void parseResultDeclNode(Node *node) +{ + fillType(node); + fillLocation(node); + Log::log(node); +} + +} diff --git a/src/parsers/resultdeclnode.h b/src/parsers/resultdeclnode.h new file mode 100644 index 0000000..4ed3e2f --- /dev/null +++ b/src/parsers/resultdeclnode.h @@ -0,0 +1,34 @@ +/* + * 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 PARSERS_RESULTDECLNODE_H +#define PARSERS_RESULTDECLNODE_H + +#include "includes.h" + +#include <string> + +struct Node; + +namespace Generic +{ + void parseResultDeclNode(Node *parent); +} + +#endif // PARSERS_RESULTDECLNODE_H |