From 09eafa08b2496374d985ad0369c1f498be0656ad Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Tue, 2 Jul 2024 09:35:11 +0200 Subject: [PATCH] Remove duplicated files from libCxxParser --- CodeLite/expression_result.cpp | 45 ------------------ CodeLite/expression_result.h | 66 -------------------------- CodeLite/function.cpp | 41 ---------------- CodeLite/function.h | 74 ----------------------------- CodeLite/variable.cpp | 87 ---------------------------------- CodeLite/variable.h | 76 ----------------------------- CxxParser/CMakeLists.txt | 3 ++ ctagsd/CMakeLists.txt | 6 +++ 8 files changed, 9 insertions(+), 389 deletions(-) delete mode 100644 CodeLite/expression_result.cpp delete mode 100644 CodeLite/expression_result.h delete mode 100644 CodeLite/function.cpp delete mode 100644 CodeLite/function.h delete mode 100644 CodeLite/variable.cpp delete mode 100644 CodeLite/variable.h diff --git a/CodeLite/expression_result.cpp b/CodeLite/expression_result.cpp deleted file mode 100644 index 481458d98b..0000000000 --- a/CodeLite/expression_result.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "expression_result.h" - -#define BOOL_TO_STR(b) b ? "true" : "false" - -ExpressionResult::ExpressionResult() -{ - Reset(); -} - -ExpressionResult::~ExpressionResult() -{ -} - -void ExpressionResult::Print() -{ - printf("%s\n", ToString().c_str()); -} - -std::string ExpressionResult::ToString() const -{ - char tmp[256]; - sprintf(tmp, "{m_name:%s, m_isFunc:%s, m_isTemplate:%s, m_isThis:%s, m_isaType:%s, m_isPtr:%s, m_scope:%s, m_templateInitList:%s}", - m_name.c_str(), - BOOL_TO_STR(m_isFunc), - BOOL_TO_STR(m_isTemplate), - BOOL_TO_STR(m_isThis), - BOOL_TO_STR(m_isaType), - BOOL_TO_STR(m_isPtr), - m_scope.c_str(), - m_templateInitList.c_str()); - return tmp; -} - -void ExpressionResult::Reset() -{ - m_isFunc = false; - m_name = ""; - m_isThis = false; - m_isaType = false; - m_isPtr = false; - m_scope = ""; - m_isTemplate = false; - m_isGlobalScope = false; - m_templateInitList = ""; -} diff --git a/CodeLite/expression_result.h b/CodeLite/expression_result.h deleted file mode 100644 index 9071feafb2..0000000000 --- a/CodeLite/expression_result.h +++ /dev/null @@ -1,66 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : expression_result.h -// -// ------------------------------------------------------------------------- -// A -// _____ _ _ _ _ -// / __ \ | | | | (_) | -// | / \/ ___ __| | ___| | _| |_ ___ -// | | / _ \ / _ |/ _ \ | | | __/ _ ) -// | \__/\ (_) | (_| | __/ |___| | || __/ -// \____/\___/ \__,_|\___\_____/_|\__\___| -// -// F i l e -// -// 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 2 of the License, or -// (at your option) any later version. -// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#ifndef EXPRESSION_RESULT_H -#define EXPRESSION_RESULT_H - -#include -#include - -#ifndef WXDLLIMPEXP_CL - -#ifdef WXMAKINGDLL_CL -# define WXDLLIMPEXP_CL __declspec(dllexport) -#elif defined(WXUSINGDLL_CL) -# define WXDLLIMPEXP_CL __declspec(dllimport) -#else // not making nor using DLL -# define WXDLLIMPEXP_CL -#endif - -#endif - - -class WXDLLIMPEXP_CL ExpressionResult -{ -public: - - bool m_isFunc; - std::string m_name; - bool m_isThis; - bool m_isaType; - bool m_isPtr; - std::string m_scope; - bool m_isTemplate; - std::string m_templateInitList; - bool m_isGlobalScope; - -public: - ExpressionResult(); - virtual ~ExpressionResult(); - void Reset(); - void Print(); - std::string ToString() const; -}; -#endif //EXPRESSION_RESULT_H diff --git a/CodeLite/function.cpp b/CodeLite/function.cpp deleted file mode 100644 index 0391dc29fa..0000000000 --- a/CodeLite/function.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "function.h" - -clFunction::clFunction() { Reset(); } - -clFunction::~clFunction() {} - -void clFunction::Reset() -{ - m_name = ""; - m_scope = ""; - m_returnValue.Reset(); - m_name = ""; - m_signature = ""; - m_lineno = 0; - m_retrunValusConst = ""; - m_isVirtual = false; - m_isPureVirtual = false; - m_isConst = false; - m_isFinal = false; -} - -void clFunction::Print() -{ - fprintf(stdout, - "{m_name=%s, m_isConst=%s, m_lineno=%d, m_scope=%s, m_signature=%s, m_isVirtual=%s, m_isPureVirtual=%s, " - "m_isFinal=%s, m_retrunValusConst=%s, m_throws=%s\nm_returnValue=", - m_name.c_str(), - m_isConst ? "yes" : "no", - m_lineno, - m_scope.c_str(), - m_signature.c_str(), - m_isVirtual ? "yes" : "no", - m_isPureVirtual ? "yes" : "no", - m_isFinal ? "yes" : "no", - m_retrunValusConst.c_str(), - m_throws.c_str()); - - m_returnValue.Print(); - fprintf(stdout, "}\n"); - fflush(stdout); -} diff --git a/CodeLite/function.h b/CodeLite/function.h deleted file mode 100644 index a568ea26c0..0000000000 --- a/CodeLite/function.h +++ /dev/null @@ -1,74 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : function.h -// -// ------------------------------------------------------------------------- -// A -// _____ _ _ _ _ -// / __ \ | | | | (_) | -// | / \/ ___ __| | ___| | _| |_ ___ -// | | / _ \ / _ |/ _ \ | | | __/ _ ) -// | \__/\ (_) | (_| | __/ |___| | || __/ -// \____/\___/ \__,_|\___\_____/_|\__\___| -// -// F i l e -// -// 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 2 of the License, or -// (at your option) any later version. -// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#ifndef FUNCTION_H -#define FUNCTION_H - -#include "variable.h" - -#include -#include -#include - -#ifndef WXDLLIMPEXP_CL - -#ifdef WXMAKINGDLL_CL -#define WXDLLIMPEXP_CL __declspec(dllexport) -#elif defined(WXUSINGDLL_CL) -#define WXDLLIMPEXP_CL __declspec(dllimport) -#else // not making nor using DLL -#define WXDLLIMPEXP_CL -#endif - -#endif - -class WXDLLIMPEXP_CL clFunction -{ -public: - std::string m_name; - std::string m_scope; // functions' scope - std::string m_retrunValusConst; // is the return value a const? - std::string m_signature; - Variable m_returnValue; - int m_lineno; - bool m_isVirtual; - bool m_isPureVirtual; - bool m_isConst; - bool m_isFinal; - std::string m_throws; - -public: - clFunction(); - virtual ~clFunction(); - - // clear the class content - void Reset(); - - // print the variable to stdout - void Print(); -}; - -typedef std::list FunctionList; -#endif // FUNCTION_H diff --git a/CodeLite/variable.cpp b/CodeLite/variable.cpp deleted file mode 100644 index 79c502fd33..0000000000 --- a/CodeLite/variable.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "variable.h" -#include - -Variable::Variable() -{ - Reset(); -} - -Variable::~Variable() -{ -} - -Variable::Variable(const Variable &src) -{ - *this = src; -} - -Variable & Variable::operator =(const Variable &src) -{ - m_type = src.m_type; - m_templateDecl = src.m_templateDecl; - m_name = src.m_name; - m_isTemplate = src.m_isTemplate; - m_isPtr = src.m_isPtr; - m_typeScope = src.m_typeScope; - m_pattern = src.m_pattern; - m_starAmp = src.m_starAmp; - m_lineno = src.m_lineno; - m_isConst = src.m_isConst; - m_defaultValue = src.m_defaultValue; - m_arrayBrackets = src.m_arrayBrackets; - m_isEllipsis = src.m_isEllipsis; - m_isBasicType = src.m_isBasicType; - m_rightSideConst= src.m_rightSideConst; - m_completeType = src.m_completeType; - m_isVolatile = src.m_isVolatile; - m_isAuto = src.m_isAuto; - m_enumInTypeDecl= src.m_enumInTypeDecl; - return *this; -} - -void Variable::Reset() -{ - m_type = ""; - m_templateDecl = ""; - m_name = ""; - m_isTemplate = false; - m_isPtr = false; - m_typeScope = ""; - m_pattern = ""; - m_starAmp = ""; - m_lineno = 0; - m_isConst = false; - m_defaultValue = ""; - m_arrayBrackets = ""; - m_isEllipsis = false; - m_isBasicType = false; - m_rightSideConst = ""; - m_completeType = ""; - m_isVolatile = false; - m_isAuto = false; - m_enumInTypeDecl = false; -} - -void Variable::Print() -{ - std::cout << "------------------" << "\n" - << "m_name :" << m_name.c_str() << "\n" - << "m_defaultValue :" << m_defaultValue.c_str() << "\n" - << "m_lineno :" << m_lineno << "\n" - << "m_starAmp :" << m_starAmp.c_str() << "\n" - << "m_type :" << m_type.c_str() << "\n" - << "m_isConst :" << m_isConst << "\n" - << "m_rightSideConst :" << m_rightSideConst.c_str() << "\n" - << "m_typeScope :" << m_typeScope.c_str() << "\n" - << "m_templateDecl :" << m_templateDecl.c_str() << "\n" - << "m_arrayBrackets :" << m_arrayBrackets.c_str() << "\n" - << "m_isPtr :" << m_isPtr << "\n" - << "m_isTemplate :" << m_isTemplate << "\n" - << "m_isEllips :" << m_isEllipsis << "\n" - << "m_isBasicType :" << m_isBasicType << "\n" - << "m_pattern :" << m_pattern.c_str() << "\n" - << "m_completeType :" << m_completeType.c_str() << "\n" - << "m_isVolatile :" << m_isVolatile << "\n" - << "m_isAuto :" << m_isAuto << "\n" - << "m_enumInTypeDecl :" << m_enumInTypeDecl << "\n"; -} diff --git a/CodeLite/variable.h b/CodeLite/variable.h deleted file mode 100644 index b2a7eeb49b..0000000000 --- a/CodeLite/variable.h +++ /dev/null @@ -1,76 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : variable.h -// -// ------------------------------------------------------------------------- -// A -// _____ _ _ _ _ -// / __ \ | | | | (_) | -// | / \/ ___ __| | ___| | _| |_ ___ -// | | / _ \ / _ |/ _ \ | | | __/ _ ) -// | \__/\ (_) | (_| | __/ |___| | || __/ -// \____/\___/ \__,_|\___\_____/_|\__\___| -// -// F i l e -// -// 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 2 of the License, or -// (at your option) any later version. -// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -#ifndef VARIABLE_H -#define VARIABLE_H - -#include "codelite_exports.h" - -#include -#include -#include - -class WXDLLIMPEXP_CL Variable -{ -public: - std::string m_name; - bool m_isTemplate; - std::string m_templateDecl; - bool m_isPtr; - std::string m_type; // as in 'int a;' -> type=int - std::string m_typeScope; // as in 'std::string a;' -> typeScope = std, type=string - std::string m_pattern; - std::string m_completeType; - std::string m_starAmp; - int m_lineno; - bool m_isConst; - std::string m_rightSideConst; - std::string m_defaultValue; // used mainly for function arguments with default values foo(int = 0); - std::string m_arrayBrackets; - bool m_isEllipsis; - bool m_isBasicType; - bool m_isVolatile; - bool m_isAuto; - bool m_enumInTypeDecl; // e.g. enum MyENum e - -public: - Variable(); - virtual ~Variable(); - - // copy ctor - Variable(const Variable& src); - - // operator = - Variable& operator=(const Variable& src); - - // clear the class content - void Reset(); - - // print the variable to stdout - void Print(); -}; - -typedef std::list VariableList; -#endif // VARIABLE_H diff --git a/CxxParser/CMakeLists.txt b/CxxParser/CMakeLists.txt index 3fecd74483..38bd524ed9 100644 --- a/CxxParser/CMakeLists.txt +++ b/CxxParser/CMakeLists.txt @@ -59,6 +59,9 @@ target_include_directories(libCxxParser PUBLIC "${CL_SRC_ROOT}/CxxParser" PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" ) +if(WIN32) + target_compile_definitions(libCxxParser PRIVATE WXMAKINGDLL_CL) +endif() # "testing" application add_executable(CxxParser diff --git a/ctagsd/CMakeLists.txt b/ctagsd/CMakeLists.txt index 8fd95b335e..c62591bbdb 100644 --- a/ctagsd/CMakeLists.txt +++ b/ctagsd/CMakeLists.txt @@ -51,6 +51,12 @@ endif(UNIX) file(GLOB LIBSRC "lib/*.cpp") add_library(ctagdslib STATIC "${LIBSRC}") +target_include_directories( + ctagdslib + PUBLIC + "${CL_SRC_ROOT}/CxxParser" +) + add_executable(ctagsd "main.cpp") target_link_libraries( ctagsd