From 6d7a1faaa45bd4aa3932bc98ec173097bb1f79c6 Mon Sep 17 00:00:00 2001 From: malte_langkabel Date: Mon, 7 Mar 2016 10:59:39 +0100 Subject: [PATCH] src: code cleanup * removed unused code: ParseFunction, ParseVariable and ParseTypeUsage. All this is handled using NameHierarchies now. * Moved the getErrorCount method from ParserClient to the StorageAccess * MessageFinishedParsing doesn't know the error count anymore. * StatusBarController now has a StorageAccess to fetch the error count when needed. --- bin/test/data/log/test_log.txt | 349 ------------------ src/app/data/parser/cxx/TaskParseCxx.cpp | 3 +- src/lib/CMakeLists.txt | 6 - src/lib/Project.cpp | 2 +- src/lib/component/ComponentFactory.cpp | 2 +- .../controller/StatusBarController.cpp | 19 +- .../controller/StatusBarController.h | 5 +- src/lib/data/Storage.cpp | 13 +- src/lib/data/Storage.h | 2 +- src/lib/data/access/StorageAccess.h | 2 + src/lib/data/access/StorageAccessProxy.cpp | 10 + src/lib/data/access/StorageAccessProxy.h | 1 + src/lib/data/parser/ParseFunction.cpp | 23 -- src/lib/data/parser/ParseFunction.h | 26 -- src/lib/data/parser/ParseTypeUsage.cpp | 7 - src/lib/data/parser/ParseTypeUsage.h | 16 - src/lib/data/parser/ParseVariable.cpp | 15 - src/lib/data/parser/ParseVariable.h | 20 - src/lib/data/parser/ParserClient.cpp | 31 -- src/lib/data/parser/ParserClient.h | 15 +- .../messaging/type/MessageFinishedParsing.h | 13 +- src/lib_parser/data/parser/cxx/ASTVisitor.cpp | 74 +++- .../data/parser/cxx/CommentHandler.cpp | 1 + src/test/CxxParserTestSuite.h | 39 +- src/test/StorageTestSuite.h | 17 +- 25 files changed, 121 insertions(+), 590 deletions(-) delete mode 100644 src/lib/data/parser/ParseFunction.cpp delete mode 100644 src/lib/data/parser/ParseFunction.h delete mode 100644 src/lib/data/parser/ParseTypeUsage.cpp delete mode 100644 src/lib/data/parser/ParseTypeUsage.h delete mode 100644 src/lib/data/parser/ParseVariable.cpp delete mode 100644 src/lib/data/parser/ParseVariable.h diff --git a/bin/test/data/log/test_log.txt b/bin/test/data/log/test_log.txt index b9610a0e..3ef756d5 100644 --- a/bin/test/data/log/test_log.txt +++ b/bin/test/data/log/test_log.txt @@ -1,358 +1,22 @@ -ConfigManager.cpp WARNING: value path/to/nowhere is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:11 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:1:13 CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:7:15 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:5:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:48 CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:7:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:3:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. CxxDeclNameResolver.cpp ERROR: could not resolve name of decl at: input.cc:4:20 -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. -Settings.cpp WARNING: File for Settings not found: data/TestSettings.xml -ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. Token.cpp ERROR: Location Id was not referenced by this Token. Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class Edge.cpp ERROR: Nodes are not plain copies. @@ -401,20 +65,7 @@ Edge.cpp ERROR: Nodes are not plain copies. NetworkProtocolHelper.cpp ERROR: Failed to parse message, invalid type token NetworkProtocolHelper.cpp ERROR: Failed to parse setActiveToken message, invalid token count Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml -ConfigManager.cpp WARNING: value Bool is not present in config. -ConfigManager.cpp WARNING: value Int is not present in config. -ConfigManager.cpp WARNING: value Float is not present in config. -ConfigManager.cpp WARNING: value String is not present in config. Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml -ConfigManager.cpp WARNING: value Bool is not present in config. -ConfigManager.cpp WARNING: value Int is not present in config. -ConfigManager.cpp WARNING: value Float is not present in config. -ConfigManager.cpp WARNING: value String is not present in config. -ConfigManager.cpp WARNING: value Bool is not present in config. -ConfigManager.cpp WARNING: value Int is not present in config. -ConfigManager.cpp WARNING: value Float is not present in config. -ConfigManager.cpp WARNING: value String is not present in config. -ConfigManager.cpp WARNING: value NewBool is not present in config. INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: typedef: type diff --git a/src/app/data/parser/cxx/TaskParseCxx.cpp b/src/app/data/parser/cxx/TaskParseCxx.cpp index c266085d..5059ed44 100644 --- a/src/app/data/parser/cxx/TaskParseCxx.cpp +++ b/src/app/data/parser/cxx/TaskParseCxx.cpp @@ -95,8 +95,7 @@ void TaskParseCxx::exit() MessageFinishedParsing( fileRegister->getParsedFilesCount(), fileRegister->getFilesCount(), - utility::duration(m_start), - m_parser->getParserClient()->getErrorCount() + utility::duration(m_start) ).dispatch(); } diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 5e963946..367e6b4a 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -123,18 +123,12 @@ add_files( data/parser/cxx/TaskParseCxx.h - data/parser/ParseFunction.cpp - data/parser/ParseFunction.h data/parser/ParseLocation.cpp data/parser/ParseLocation.h data/parser/Parser.cpp data/parser/Parser.h data/parser/ParserClient.cpp data/parser/ParserClient.h - data/parser/ParseTypeUsage.cpp - data/parser/ParseTypeUsage.h - data/parser/ParseVariable.cpp - data/parser/ParseVariable.h data/search/SearchIndex.cpp data/search/SearchIndex.h diff --git a/src/lib/Project.cpp b/src/lib/Project.cpp index d3885b4e..e0d9e887 100644 --- a/src/lib/Project.cpp +++ b/src/lib/Project.cpp @@ -43,7 +43,7 @@ bool Project::load(const FilePath& projectSettingsFile) { m_storage->startParsing(); m_storage->finishParsing(); - MessageFinishedParsing(0, 0, 0, m_storage->getErrorCount()).dispatch(); + MessageFinishedParsing(0, 0, 0).dispatch(); } else { diff --git a/src/lib/component/ComponentFactory.cpp b/src/lib/component/ComponentFactory.cpp index c5e2caa2..e18e0ecd 100644 --- a/src/lib/component/ComponentFactory.cpp +++ b/src/lib/component/ComponentFactory.cpp @@ -85,7 +85,7 @@ std::shared_ptr ComponentFactory::createUndoRedoComponent(ViewLayout* std::shared_ptr ComponentFactory::createStatusBarComponent(ViewLayout* viewLayout) { std::shared_ptr view = m_viewFactory->createStatusBarView(viewLayout); - std::shared_ptr controller = std::make_shared(); + std::shared_ptr controller = std::make_shared(m_storageAccess); return std::make_shared(view, controller); } diff --git a/src/lib/component/controller/StatusBarController.cpp b/src/lib/component/controller/StatusBarController.cpp index 3fdfc676..47c806bb 100644 --- a/src/lib/component/controller/StatusBarController.cpp +++ b/src/lib/component/controller/StatusBarController.cpp @@ -1,10 +1,11 @@ #include "component/controller/StatusBarController.h" +#include "component/view/StatusBarView.h" +#include "data/access/StorageAccess.h" #include "utility/logging/logging.h" -#include "component/view/StatusBarView.h" - -StatusBarController::StatusBarController() +StatusBarController::StatusBarController(StorageAccess* storageAccess) + : m_storageAccess(storageAccess) { } @@ -24,7 +25,17 @@ void StatusBarController::handleMessage(MessageClearErrorCount* message) void StatusBarController::handleMessage(MessageFinishedParsing* message) { - getView()->setErrorCount(message->errorCount); + ErrorCountInfo errorCount = m_storageAccess->getErrorCount(); + getView()->setErrorCount(errorCount); + + std::string status = message->getStatusStr(); + status += " " + std::to_string(errorCount.total) + " error" + (errorCount.total > 1 ? "s" : ""); + if (errorCount.fatal > 0) + { + status += " (" + std::to_string(errorCount.fatal) + " fatal)"; + } + + MessageStatus(status, errorCount.total > 0).dispatch(); } void StatusBarController::handleMessage(MessageShowErrors* message) diff --git a/src/lib/component/controller/StatusBarController.h b/src/lib/component/controller/StatusBarController.h index 81f8cdf1..ba722e26 100644 --- a/src/lib/component/controller/StatusBarController.h +++ b/src/lib/component/controller/StatusBarController.h @@ -12,6 +12,7 @@ #include "utility/messaging/type/MessageStatus.h" class StatusBarView; +class StorageAccess; class StatusBarController : public Controller @@ -21,7 +22,7 @@ class StatusBarController , public MessageListener { public: - StatusBarController(void); + StatusBarController(StorageAccess* storageAccess); virtual ~StatusBarController(void); StatusBarView* getView(); @@ -33,6 +34,8 @@ private: virtual void handleMessage(MessageStatus* message); void setStatus(const std::string& status, bool isError, bool showLoader); + + StorageAccess* m_storageAccess; }; #endif // STATUS_BAR_CONTROLLER_H diff --git a/src/lib/data/Storage.cpp b/src/lib/data/Storage.cpp index 99b30261..5ff462fd 100644 --- a/src/lib/data/Storage.cpp +++ b/src/lib/data/Storage.cpp @@ -19,10 +19,7 @@ #include "data/location/TokenLocation.h" #include "data/location/TokenLocationFile.h" #include "data/location/TokenLocationLine.h" -#include "data/parser/ParseFunction.h" #include "data/parser/ParseLocation.h" -#include "data/parser/ParseTypeUsage.h" -#include "data/parser/ParseVariable.h" #include "data/type/DataType.h" #include "settings/ApplicationSettings.h" @@ -209,11 +206,6 @@ void Storage::onError(const ParseLocation& location, const std::string& message, } } -ErrorCountInfo Storage::getErrorCount() const -{ - return ErrorCountInfo(m_sqliteStorage.getAllErrors().size(), m_sqliteStorage.getFatalErrors().size()); -} - Id Storage::onTypedefParsed( const ParseLocation& location, const NameHierarchy& typedefName, AccessType access ){ @@ -1091,6 +1083,11 @@ TimePoint Storage::getFileModificationTime(const FilePath& filePath) const return TimePoint(m_sqliteStorage.getFileByPath(filePath.str()).modificationTime); } +ErrorCountInfo Storage::getErrorCount() const +{ + return ErrorCountInfo(m_sqliteStorage.getAllErrors().size(), m_sqliteStorage.getFatalErrors().size()); +} + StorageStats Storage::getStorageStats() const { StorageStats stats; diff --git a/src/lib/data/Storage.h b/src/lib/data/Storage.h index c9000e51..8f46b548 100644 --- a/src/lib/data/Storage.h +++ b/src/lib/data/Storage.h @@ -90,7 +90,7 @@ public: const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, const NameHierarchy& templateNameHierarchy); virtual Id onTemplateDefaultArgumentTypeParsed( - const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, + const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, const NameHierarchy& templateParameterNameHierarchy); virtual Id onTemplateParameterTypeParsed( const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy); diff --git a/src/lib/data/access/StorageAccess.h b/src/lib/data/access/StorageAccess.h index eee6f96c..ca39fc78 100644 --- a/src/lib/data/access/StorageAccess.h +++ b/src/lib/data/access/StorageAccess.h @@ -10,6 +10,7 @@ #include "data/graph/Node.h" #include "data/search/SearchMatch.h" +#include "data/ErrorCountInfo.h" #include "data/StorageStats.h" struct FileInfo; @@ -62,6 +63,7 @@ public: virtual std::shared_ptr getFileContent(const FilePath& filePath) const = 0; virtual TimePoint getFileModificationTime(const FilePath& filePath) const = 0; + virtual ErrorCountInfo getErrorCount() const = 0; virtual StorageStats getStorageStats() const = 0; }; diff --git a/src/lib/data/access/StorageAccessProxy.cpp b/src/lib/data/access/StorageAccessProxy.cpp index a24e6c8b..c4ce7197 100644 --- a/src/lib/data/access/StorageAccessProxy.cpp +++ b/src/lib/data/access/StorageAccessProxy.cpp @@ -275,6 +275,16 @@ TimePoint StorageAccessProxy::getFileModificationTime(const FilePath& filePath) return TimePoint(boost::posix_time::not_a_date_time); } +ErrorCountInfo StorageAccessProxy::getErrorCount() const +{ + if (hasSubject()) + { + return m_subject->getErrorCount(); + } + + return ErrorCountInfo(); +} + StorageStats StorageAccessProxy::getStorageStats() const { if (hasSubject()) diff --git a/src/lib/data/access/StorageAccessProxy.h b/src/lib/data/access/StorageAccessProxy.h index ff5137b7..6d25439c 100644 --- a/src/lib/data/access/StorageAccessProxy.h +++ b/src/lib/data/access/StorageAccessProxy.h @@ -51,6 +51,7 @@ public: virtual std::shared_ptr getFileContent(const FilePath& filePath) const; virtual TimePoint getFileModificationTime(const FilePath& filePath) const; + virtual ErrorCountInfo getErrorCount() const; virtual StorageStats getStorageStats() const; private: diff --git a/src/lib/data/parser/ParseFunction.cpp b/src/lib/data/parser/ParseFunction.cpp deleted file mode 100644 index 14cbd79a..00000000 --- a/src/lib/data/parser/ParseFunction.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "data/parser/ParseFunction.h" - -#include "utility/utilityString.h" - -ParseFunction::ParseFunction( - const ParseTypeUsage& returnType, - const NameHierarchy& nameHierarchy, - const std::vector& parameters, - bool isStatic, - bool isConst -) - : returnType(returnType) - , nameHierarchy(nameHierarchy) - , parameters(parameters) - , isStatic(isStatic) - , isConst(isConst) -{ -} - -std::string ParseFunction::getFullName() const -{ - return nameHierarchy.getQualifiedNameWithSignature(); -} diff --git a/src/lib/data/parser/ParseFunction.h b/src/lib/data/parser/ParseFunction.h deleted file mode 100644 index 2efa185e..00000000 --- a/src/lib/data/parser/ParseFunction.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef PARSE_FUNCTION_H -#define PARSE_FUNCTION_H - -#include "data/name/NameHierarchy.h" -#include "data/parser/ParseTypeUsage.h" - -struct ParseFunction -{ - ParseFunction( - const ParseTypeUsage& returnType, - const NameHierarchy& nameHierarchy, - const std::vector& parameters, - bool isStatic = false, - bool isConst = false - ); - - std::string getFullName() const; - - const ParseTypeUsage returnType; - const NameHierarchy nameHierarchy; - const std::vector parameters; - const bool isStatic; - const bool isConst; -}; - -#endif // PARSE_FUNCTION_H diff --git a/src/lib/data/parser/ParseTypeUsage.cpp b/src/lib/data/parser/ParseTypeUsage.cpp deleted file mode 100644 index a00e04b3..00000000 --- a/src/lib/data/parser/ParseTypeUsage.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "data/parser/ParseTypeUsage.h" - -ParseTypeUsage::ParseTypeUsage(const ParseLocation& location, const std::shared_ptr dataType) - : location(location) - , dataType(dataType) -{ -} diff --git a/src/lib/data/parser/ParseTypeUsage.h b/src/lib/data/parser/ParseTypeUsage.h deleted file mode 100644 index 5824a8a5..00000000 --- a/src/lib/data/parser/ParseTypeUsage.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef PARSE_TYPE_USAGE_H -#define PARSE_TYPE_USAGE_H - -#include -#include "data/type/DataType.h" -#include "data/parser/ParseLocation.h" - -struct ParseTypeUsage -{ - ParseTypeUsage(const ParseLocation& location, const std::shared_ptr dataType); - - const ParseLocation location; - const std::shared_ptr dataType; -}; - -#endif // PARSE_TYPE_USAGE_H diff --git a/src/lib/data/parser/ParseVariable.cpp b/src/lib/data/parser/ParseVariable.cpp deleted file mode 100644 index 72ebe998..00000000 --- a/src/lib/data/parser/ParseVariable.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "data/parser/ParseVariable.h" - -#include "utility/utilityString.h" - -ParseVariable::ParseVariable(const ParseTypeUsage& type, const NameHierarchy& nameHierarchy, bool isStatic) - : type(type) - , nameHierarchy(nameHierarchy) - , isStatic(isStatic) -{ -} - -std::string ParseVariable::getFullName() const -{ - return nameHierarchy.getQualifiedNameWithSignature(); -} diff --git a/src/lib/data/parser/ParseVariable.h b/src/lib/data/parser/ParseVariable.h deleted file mode 100644 index 4055ce6b..00000000 --- a/src/lib/data/parser/ParseVariable.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef PARSE_VARIABLE_H -#define PARSE_VARIABLE_H - -#include - -#include "data/name/NameHierarchy.h" -#include "data/parser/ParseTypeUsage.h" - -struct ParseVariable -{ - ParseVariable(const ParseTypeUsage& type, const NameHierarchy& nameHierarchy, bool isStatic); - - std::string getFullName() const; - - const ParseTypeUsage type; - const NameHierarchy nameHierarchy; - const bool isStatic; -}; - -#endif // PARSE_VARIABLE_H diff --git a/src/lib/data/parser/ParserClient.cpp b/src/lib/data/parser/ParserClient.cpp index 98e75333..134cf9d9 100644 --- a/src/lib/data/parser/ParserClient.cpp +++ b/src/lib/data/parser/ParserClient.cpp @@ -2,10 +2,7 @@ #include -#include "data/parser/ParseFunction.h" #include "data/parser/ParseLocation.h" -#include "data/parser/ParseTypeUsage.h" -#include "data/parser/ParseVariable.h" #include "data/type/DataType.h" #include "utility/utilityString.h" @@ -85,34 +82,6 @@ std::string ParserClient::addLocationSuffix( return ss.str(); } -std::string ParserClient::variableStr(const ParseVariable& variable) -{ - std::string str = variable.type.dataType->getFullTypeName() + " " + variable.getFullName(); - return addStaticPrefix(str, variable.isStatic); -} - -std::string ParserClient::parameterStr(const std::vector parameters) -{ - std::string str = "("; - for (size_t i = 0; i < parameters.size(); i++) - { - str += parameters[i].dataType->getFullTypeName(); - if (i < parameters.size() - 1) - { - str += ", "; - } - } - return str + ")"; -} - -std::string ParserClient::functionStr(const ParseFunction& function) -{ - /*std::string str = - function.returnType.dataType->getFullTypeName() + " " + function.getFullName() + parameterStr(function.parameters); - return addConstPrefix(addStaticPrefix(str, function.isStatic), function.isConst, false);*/ - return function.nameHierarchy.getQualifiedNameWithSignature(); -} - ParserClient::ParserClient() { } diff --git a/src/lib/data/parser/ParserClient.h b/src/lib/data/parser/ParserClient.h index 5ab4dd6a..ca20f28d 100644 --- a/src/lib/data/parser/ParserClient.h +++ b/src/lib/data/parser/ParserClient.h @@ -6,17 +6,10 @@ #include "utility/types.h" #include "data/name/NameHierarchy.h" -#include "data/ErrorCountInfo.h" #include "utility/file/FileInfo.h" -#include "ParseLocation.h" - - -struct ParseFunction; struct ParseLocation; -struct ParseTypeUsage; -struct ParseVariable; class DataType; class ParserClient @@ -48,10 +41,6 @@ public: static std::string addLocationSuffix( const std::string& str, const ParseLocation& location, const ParseLocation& scopeLocation); - static std::string variableStr(const ParseVariable& variable); - static std::string parameterStr(const std::vector parameters); - static std::string functionStr(const ParseFunction& function); - static std::string functionSignatureStr(const ParseFunction& function); // should this be in here? consider languages other than c++. ParserClient(); virtual ~ParserClient(); @@ -63,7 +52,6 @@ public: virtual void finishParsingFile(const FilePath& filePath) = 0; virtual void onError(const ParseLocation& location, const std::string& message, bool fatal) = 0; - virtual ErrorCountInfo getErrorCount() const = 0; virtual Id onTypedefParsed( const ParseLocation& location, const NameHierarchy& typedefName, AccessType access) = 0; @@ -107,7 +95,7 @@ public: const ParseLocation& location, const NameHierarchy& argumentTypeNameHierarchy, const NameHierarchy& templateNameHierarchy) = 0; virtual Id onTemplateDefaultArgumentTypeParsed( - const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, + const ParseLocation& location, const NameHierarchy& defaultArgumentTypeNameHierarchy, const NameHierarchy& templateArgumentTypeNameHierarchy) = 0; virtual Id onTemplateParameterTypeParsed( const ParseLocation& location, const NameHierarchy& templateParameterTypeNameHierarchy) = 0; @@ -121,7 +109,6 @@ public: virtual Id onFileIncludeParsed( const ParseLocation& location, const FileInfo& fileInfo, const FileInfo& includedFileInfo) = 0; - virtual Id onMacroDefineParsed( const ParseLocation& location, const NameHierarchy& macroNameHierarchy, const ParseLocation& scopeLocation) = 0; virtual Id onMacroExpandParsed( diff --git a/src/lib/utility/messaging/type/MessageFinishedParsing.h b/src/lib/utility/messaging/type/MessageFinishedParsing.h index fd0c8fc8..dec65a97 100644 --- a/src/lib/utility/messaging/type/MessageFinishedParsing.h +++ b/src/lib/utility/messaging/type/MessageFinishedParsing.h @@ -12,11 +12,10 @@ class MessageFinishedParsing : public Message { public: - MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime, ErrorCountInfo errorCount) + MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime) : fileCount(fileCount) , totalFileCount(totalFileCount) , parseTime(parseTime) - , errorCount(errorCount) { } @@ -27,8 +26,6 @@ public: virtual void dispatch() { - MessageStatus(getStatusStr(), errorCount.total > 0).dispatch(); - Message::dispatch(); } @@ -37,12 +34,7 @@ public: std::stringstream ss; ss << "Finished analysis: "; ss << fileCount << "/" << totalFileCount << " files, "; - ss << std::setprecision(2) << std::fixed << parseTime << " seconds, "; - ss << errorCount.total << " error" << (errorCount.total > 1 ? "s" : ""); - if (errorCount.fatal > 0) - { - ss << " (" << errorCount.fatal << " fatal)"; - } + ss << std::setprecision(2) << std::fixed << parseTime << " seconds."; return ss.str(); } @@ -54,7 +46,6 @@ public: size_t fileCount; size_t totalFileCount; float parseTime; - ErrorCountInfo errorCount; }; #endif // MESSAGE_FINISHED_PARSING_H diff --git a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp index 73cd4c78..d3584a32 100644 --- a/src/lib_parser/data/parser/cxx/ASTVisitor.cpp +++ b/src/lib_parser/data/parser/cxx/ASTVisitor.cpp @@ -7,6 +7,8 @@ #include #include "data/parser/cxx/utilityCxx.h" +#include "data/parser/ParseLocation.h" + #include "utility/file/FileManager.h" #include "utility/file/FileSystem.h" #include "utility/ScopedSwitcher.h" @@ -131,7 +133,9 @@ bool ASTVisitor::TraverseDecl(clang::Decl *d) if (d && clang::isa(d) && clang::isa(d) && !clang::isa(d)) { clang::NamedDecl* nd = clang::dyn_cast(d); - sw3 = std::make_shared>>(m_contextNameGenerator, std::make_shared(nd, m_declNameCache)); + sw3 = std::make_shared>>( + m_contextNameGenerator, std::make_shared(nd, m_declNameCache) + ); } return base::TraverseDecl(d); @@ -139,25 +143,33 @@ bool ASTVisitor::TraverseDecl(clang::Decl *d) bool ASTVisitor::TraverseLambdaExpr(clang::LambdaExpr* e) { - ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(e->getCallOperator(), m_declNameCache)); + ScopedSwitcher> switcher( + m_contextNameGenerator, std::make_shared(e->getCallOperator(), m_declNameCache) + ); return base::TraverseLambdaExpr(e); } bool ASTVisitor::TraverseFunctionDecl(clang::FunctionDecl* d) { - ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(d, m_declNameCache)); // store context for template arguments of function specialitzation + ScopedSwitcher> switcher( + m_childContextNameGenerator, std::make_shared(d, m_declNameCache) + ); // store context for template arguments of function specialitzation return base::TraverseFunctionDecl(d); } bool ASTVisitor::TraverseTypedefDecl(clang::TypedefDecl *d) { - ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> switcher( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); return base::TraverseTypedefDecl(d); } bool ASTVisitor::TraverseFieldDecl(clang::FieldDecl *d) { - ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> switcher( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); return base::TraverseFieldDecl(d); } @@ -168,21 +180,27 @@ bool ASTVisitor::TraverseVarDecl(clang::VarDecl *d) NameHierarchy contextNameHierarchy = getContextName(); if (!(contextNameHierarchy.size() > 0 && contextNameHierarchy.back()->hasSignature())) // TODO: whle test if its a function. optimize this: remove requirement to get the name here! { - switcher = std::make_shared>>(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + switcher = std::make_shared>>( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); } return base::TraverseVarDecl(d); } bool ASTVisitor::TraverseClassTemplateDecl(clang::ClassTemplateDecl* d) { - ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> switcher( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); return base::TraverseClassTemplateDecl(d); } bool ASTVisitor::TraverseFunctionTemplateDecl(clang::FunctionTemplateDecl* d) { // we need to use the templated decl here because name resolving for FunctionTemplateDecl is not returning a correct signature yet. - ScopedSwitcher> switcher(m_contextNameGenerator, std::make_shared(d->getTemplatedDecl(), m_declNameCache)); + ScopedSwitcher> switcher( + m_contextNameGenerator, std::make_shared(d->getTemplatedDecl(), m_declNameCache) + ); return base::TraverseFunctionTemplateDecl(d); } @@ -194,7 +212,9 @@ bool ASTVisitor::TraverseTemplateTypeParmDecl(clang::TemplateTypeParmDecl* d) if (d->hasDefaultArgument() && !d->defaultArgumentWasInherited()) { ScopedSwitcher sw1(m_typeContext, RT_TemplateDefaultArgument); - ScopedSwitcher> sw2(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> sw2( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); TraverseTypeLoc(d->getDefaultArgumentInfo()->getTypeLoc()); } @@ -212,7 +232,9 @@ bool ASTVisitor::TraverseTemplateTemplateParmDecl(clang::TemplateTemplateParmDec if (d->hasDefaultArgument() && !d->defaultArgumentWasInherited()) { ScopedSwitcher sw1(m_typeContext, RT_TemplateDefaultArgument); - ScopedSwitcher> sw2(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> sw2( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); TraverseTemplateArgumentLoc(d->getDefaultArgument()); } @@ -232,20 +254,26 @@ bool ASTVisitor::TraverseTemplateTemplateParmDecl(clang::TemplateTemplateParmDec bool ASTVisitor::TraverseClassTemplatePartialSpecializationDecl(clang::ClassTemplatePartialSpecializationDecl* d) { - ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> switcher( + m_childContextNameGenerator, std::make_shared(d, m_declNameCache) + ); return base::TraverseClassTemplatePartialSpecializationDecl(d); } bool ASTVisitor::TraverseDeclRefExpr(clang::DeclRefExpr* e) { - ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(e->getDecl(), m_declNameCache)); + ScopedSwitcher> switcher( + m_childContextNameGenerator, std::make_shared(e->getDecl(), m_declNameCache) + ); return base::TraverseDeclRefExpr(e); } bool ASTVisitor::TraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc) { const clang::Type* t = loc.getTypePtr(); - ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(t, m_typeNameCache)); + ScopedSwitcher> switcher( + m_childContextNameGenerator, std::make_shared(t, m_typeNameCache) + ); return base::TraverseTemplateSpecializationTypeLoc(loc); } @@ -262,12 +290,12 @@ bool ASTVisitor::TraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& l std::shared_ptr>> sw2; if (m_typeContext != RT_TemplateDefaultArgument - && - m_childContextNameGenerator - ) + && m_childContextNameGenerator) { sw1 = std::make_shared>(m_typeContext, RT_TemplateArgument); - sw2 = std::make_shared>>(m_contextNameGenerator, m_childContextNameGenerator); + sw2 = std::make_shared>>( + m_contextNameGenerator, m_childContextNameGenerator + ); } clang::TemplateArgument::ArgKind kk = loc.getArgument().getKind(); @@ -652,8 +680,12 @@ bool ASTVisitor::TraverseCXXRecordDecl(clang::CXXRecordDecl *d) ++it) { clang::CXXBaseSpecifier *baseSpecifier = it; ScopedSwitcher sw1(m_typeContext, RT_BaseClass); - ScopedSwitcher sw2(m_contextAccess, convertAccessType(baseSpecifier->getAccessSpecifier())); - ScopedSwitcher> sw3(m_contextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher sw2( + m_contextAccess, convertAccessType(baseSpecifier->getAccessSpecifier()) + ); + ScopedSwitcher> sw3( + m_contextNameGenerator, std::make_shared(d, m_declNameCache) + ); TraverseTypeLoc(baseSpecifier->getTypeSourceInfo()->getTypeLoc()); } } @@ -678,7 +710,9 @@ bool ASTVisitor::TraverseClassTemplateSpecializationDecl( if (clang::TypeSourceInfo* tsi = d->getTypeAsWritten()) { - ScopedSwitcher> switcher(m_childContextNameGenerator, std::make_shared(d, m_declNameCache)); + ScopedSwitcher> switcher( + m_childContextNameGenerator, std::make_shared(d, m_declNameCache) + ); clang::TypeLoc tl = tsi->getTypeLoc(); clang::TemplateSpecializationTypeLoc tstl = tl.castAs(); for (unsigned I = 0, E = tstl.getNumArgs(); I != E; ++I) diff --git a/src/lib_parser/data/parser/cxx/CommentHandler.cpp b/src/lib_parser/data/parser/cxx/CommentHandler.cpp index 45578e13..afd0cfb2 100644 --- a/src/lib_parser/data/parser/cxx/CommentHandler.cpp +++ b/src/lib_parser/data/parser/cxx/CommentHandler.cpp @@ -1,5 +1,6 @@ #include "data/parser/cxx/CommentHandler.h" +#include "data/parser/ParseLocation.h" #include "data/parser/ParserClient.h" #include "utility/file/FileManager.h" #include "utility/file/FileRegister.h" diff --git a/src/test/CxxParserTestSuite.h b/src/test/CxxParserTestSuite.h index 2c940401..07124a47 100644 --- a/src/test/CxxParserTestSuite.h +++ b/src/test/CxxParserTestSuite.h @@ -5,16 +5,12 @@ #include "utility/utilityString.h" #include "data/parser/cxx/CxxParser.h" -#include "data/parser/ParseFunction.h" #include "data/parser/ParseLocation.h" #include "data/parser/ParserClient.h" -#include "data/parser/ParseTypeUsage.h" -#include "data/parser/ParseVariable.h" #include "settings/ApplicationSettings.h" #include "helper/TestFileManager.h" - class CxxParserTestSuite: public CxxTest::TestSuite { public: @@ -110,7 +106,7 @@ public: TS_ASSERT_EQUALS(client->functions.size(), 1); TS_ASSERT_EQUALS(client->functions[0], "int ceil(float) <1:1 <1:5 1:8> 4:1>"); } - + void test_cxx_parser_finds_static_function_declaration() { std::shared_ptr client = parseCode( @@ -773,7 +769,7 @@ public: TS_ASSERT_EQUALS(client->structs.size(), 1); TS_ASSERT_EQUALS(client->structs[0], "private A::B <3:2 <3:9 3:9> 5:2>"); } - + void test_cxx_parser_finds_struct_definition_in_namespace() { std::shared_ptr client = parseCode( @@ -823,7 +819,7 @@ public: TS_ASSERT_EQUALS(client->globalVariables.size(), 1); TS_ASSERT_EQUALS(client->globalVariables[0], "n::x <2:6 2:6>"); } - + void test_cxx_parser_finds_field_in_nested_class() { std::shared_ptr client = parseCode( @@ -1002,7 +998,7 @@ public: std::shared_ptr client = parseCode( "int x;\n" ); - + TS_ASSERT_EQUALS(client->typeUses.size(), 1); TS_ASSERT_EQUALS(client->typeUses[0], "x -> int <1:1 1:3>"); } @@ -1012,9 +1008,9 @@ public: std::shared_ptr client = parseCode( "typedef unsigned int uint;\n" ); - + TS_ASSERT_EQUALS(client->typeUses.size(), 1); - TS_ASSERT_EQUALS(client->typeUses[0], "uint -> unsigned int <1:9 1:16>"); + TS_ASSERT_EQUALS(client->typeUses[0], "uint -> unsigned int <1:9 1:16>"); } void test_cxx_parser_finds_typedef_that_uses_type_defined_in_named_namespace() @@ -1052,7 +1048,7 @@ public: TS_ASSERT_EQUALS(client->inheritances.size(), 1); TS_ASSERT_EQUALS(client->inheritances[0], "B : private A <2:11 2:11>"); } - + void test_cxx_parser_finds_class_public_inheritance() { std::shared_ptr client = parseCode( @@ -1161,7 +1157,7 @@ public: TS_ASSERT_EQUALS(client->inheritances[0], "C : public A <4:11 4:11>"); TS_ASSERT_EQUALS(client->inheritances[1], "C : private B <5:12 5:12>"); } - + void test_cxx_parser_finds_method_override_when_virtual() { std::shared_ptr client = parseCode( @@ -1240,7 +1236,7 @@ public: TS_ASSERT_EQUALS(client->overrides.size(), 0); } - + void test_cxx_parser_finds_call_in_function() { std::shared_ptr client = parseCode( @@ -1300,7 +1296,7 @@ public: TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <11:2 11:4>"); TS_ASSERT_EQUALS(client->calls[1], "int main() -> float sum(float, float) <12:2 12:4>"); } - + void test_cxx_parser_finds_function_call_in_function_parameter_list() { std::shared_ptr client = parseCode( @@ -1318,7 +1314,7 @@ public: TS_ASSERT_EQUALS(client->calls[0], "int main() -> int sum(int, int) <7:9 7:11>"); TS_ASSERT_EQUALS(client->calls[1], "int main() -> int sum(int, int) <7:16 7:18>"); } - + void test_cxx_parser_finds_function_call_in_method() { std::shared_ptr client = parseCode( @@ -2669,7 +2665,7 @@ public: TS_ASSERT_EQUALS(client->calls.size(), 2); TS_ASSERT_EQUALS(client->calls[1], "int main() -> void n::App::App(int) <11:16 11:18>"); } - + void test_cxx_parser_finds_macro_define_scope() { std::shared_ptr client = parseCode( @@ -2679,7 +2675,7 @@ public: TS_ASSERT_EQUALS(client->macros.size(), 1); TS_ASSERT_EQUALS(client->macros[0], "MAX <1:9 <1:9 1:11> 2:17>"); } - + //void __test_cxx_parser_finds_type_template_argument_of_static_cast_expression() //{ // std::shared_ptr client = parseCode( @@ -2708,7 +2704,7 @@ public: // TS_ASSERT_EQUALS(client->calls.size(), 1); // TS_ASSERT_EQUALS(client->calls[0], "void B::B() -> A::A() <6:2 6:2>"); //} - + void test_cxx_parser_parses_multiple_files() { TestFileManager fm; @@ -2741,7 +2737,7 @@ public: TS_ASSERT_EQUALS(client.inheritances.size(), 1); TS_ASSERT_EQUALS(client.calls.size(), 1); TS_ASSERT_EQUALS(client.usages.size(), 3); - TS_ASSERT_EQUALS(client.typeUses.size(), 19); // TODO: this test fails?! + TS_ASSERT_EQUALS(client.typeUses.size(), 17); TS_ASSERT_EQUALS(client.files.size(), 3); TS_ASSERT_EQUALS(client.includes.size(), 1); @@ -2820,11 +2816,6 @@ private: errors.push_back(addLocationSuffix(message, location)); } - virtual ErrorCountInfo getErrorCount() const - { - return ErrorCountInfo(); - } - virtual Id onTypedefParsed( const ParseLocation& location, const NameHierarchy& typedefName, AccessType access ) diff --git a/src/test/StorageTestSuite.h b/src/test/StorageTestSuite.h index 1f58a14b..44f59e73 100644 --- a/src/test/StorageTestSuite.h +++ b/src/test/StorageTestSuite.h @@ -6,10 +6,7 @@ #include "data/graph/token_component/TokenComponentAccess.h" #include "data/graph/token_component/TokenComponentStatic.h" #include "data/location/TokenLocation.h" -#include "data/parser/ParseFunction.h" #include "data/parser/ParseLocation.h" -#include "data/parser/ParseTypeUsage.h" -#include "data/parser/ParseVariable.h" #include "data/Storage.h" #include "data/type/DataType.h" #include "data/type/NamedDataType.h" @@ -263,16 +260,16 @@ public: NameHierarchy b = createFunctionNameHierarchy("void", "B::isMethod", "(bool)"); storage.onMethodParsed( - validLocation(9), - a, - ParserClient::ACCESS_PRIVATE, - ParserClient::ABSTRACTION_VIRTUAL, + validLocation(9), + a, + ParserClient::ACCESS_PRIVATE, + ParserClient::ABSTRACTION_VIRTUAL, validLocation(4)); storage.onMethodParsed( - validLocation(7), + validLocation(7), b, - ParserClient::ACCESS_PRIVATE, - ParserClient::ABSTRACTION_NONE, + ParserClient::ACCESS_PRIVATE, + ParserClient::ABSTRACTION_NONE, validLocation(3)); storage.onMethodOverrideParsed(validLocation(4), a, b);