diff --git a/CodeLite/CIncludeStatementCollector.cpp b/CodeLite/CIncludeStatementCollector.cpp deleted file mode 100644 index 808e9033f2..0000000000 --- a/CodeLite/CIncludeStatementCollector.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "CIncludeStatementCollector.h" -#include "CxxPreProcessor.h" -#include "CxxScannerTokens.h" -#include "file_logger.h" - -CIncludeStatementCollector::CIncludeStatementCollector(CxxPreProcessor* pp, const wxFileName& filename, - std::unordered_set& visitedFiles) - : CxxScannerBase(pp, filename) - , m_visitedFiles(visitedFiles) -{ -} - -CIncludeStatementCollector::~CIncludeStatementCollector() -{ -} - -void CIncludeStatementCollector::OnToken(CxxLexerToken& token) -{ - // Pre Processor state - switch(token.GetType()) { - case T_PP_INCLUDE_FILENAME: { - // we found an include statement, recurse into it - wxFileName include; - if(m_preProcessor->ExpandInclude(m_filename, token.GetWXString(), include)) { - CIncludeStatementCollector scanner(m_preProcessor, include, m_visitedFiles); - scanner.Parse(); - clDEBUG1() << "<== Resuming parser on file:" << m_filename << clEndl; - } - break; - } - default: - break; - } -} diff --git a/CodeLite/CIncludeStatementCollector.h b/CodeLite/CIncludeStatementCollector.h deleted file mode 100644 index 7083556c6a..0000000000 --- a/CodeLite/CIncludeStatementCollector.h +++ /dev/null @@ -1,47 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : CIncludeStatementCollector.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 CXXPREPROCESSORSCANNERBASE_H -#define CXXPREPROCESSORSCANNERBASE_H - -#include "CxxLexerAPI.h" -#include "CxxScannerBase.h" -#include "codelite_exports.h" -#include -#include - -class WXDLLIMPEXP_CL CxxPreProcessor; -class WXDLLIMPEXP_CL CIncludeStatementCollector : public CxxScannerBase -{ - std::unordered_set& m_visitedFiles; - -public: - CIncludeStatementCollector(CxxPreProcessor* pp, const wxFileName& filename, - std::unordered_set& visitedFiles); - virtual ~CIncludeStatementCollector(); - void OnToken(CxxLexerToken& token) override; -}; - -#endif // CXXPREPROCESSORSCANNERBASE_H diff --git a/CodeLite/CxxScannerBase.cpp b/CodeLite/CxxScannerBase.cpp deleted file mode 100644 index 2f89bc7248..0000000000 --- a/CodeLite/CxxScannerBase.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "CxxScannerBase.h" -#include "CxxPreProcessor.h" -#include "fileutils.h" - -CxxScannerBase::CxxScannerBase(CxxPreProcessor* preProcessor, const wxFileName& filename) - : m_scanner(NULL) - , m_filename(filename) - , m_options(0) - , m_preProcessor(preProcessor) -{ - wxString content; - FileUtils::ReadFileContent(filename, content, wxConvISO8859_1); - m_scanner = ::LexerNew(content, m_preProcessor->GetOptions()); -} - -CxxScannerBase::~CxxScannerBase() -{ - if(m_scanner) { - ::LexerDestroy(&m_scanner); - } -} - -void CxxScannerBase::Parse() -{ - CxxLexerToken token; - while(::LexerNext(m_scanner, token)) { - OnToken(token); - } -} diff --git a/CodeLite/CxxScannerBase.h b/CodeLite/CxxScannerBase.h deleted file mode 100644 index 6ce56a1e99..0000000000 --- a/CodeLite/CxxScannerBase.h +++ /dev/null @@ -1,57 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : CxxScannerBase.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 CXXSCANNERBASE_H -#define CXXSCANNERBASE_H - -#include -#include "CxxLexerAPI.h" - -class CxxPreProcessor; -class WXDLLIMPEXP_CL CxxScannerBase -{ -protected: - Scanner_t m_scanner; - wxFileName m_filename; - size_t m_options; - CxxPreProcessor* m_preProcessor; - -public: - CxxScannerBase(CxxPreProcessor* preProcessor, const wxFileName& filename); - virtual ~CxxScannerBase(); - - /** - * @brief main loop - */ - void Parse(); - - /** - * @brief - * @param token - */ - virtual void OnToken(CxxLexerToken& token) { wxUnusedVar(token); } -}; - -#endif // CXXSCANNERBASE_H diff --git a/CodeLite/CxxUsingNamespaceCollector.cpp b/CodeLite/CxxUsingNamespaceCollector.cpp deleted file mode 100644 index 49ba833ad3..0000000000 --- a/CodeLite/CxxUsingNamespaceCollector.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "CxxUsingNamespaceCollector.h" -#include "CxxPreProcessor.h" -#include "CxxScannerTokens.h" - -CxxUsingNamespaceCollector::CxxUsingNamespaceCollector(CxxPreProcessor* preProcessor, const wxFileName& filename, - std::unordered_set& visitedFiles) - : CxxScannerBase(preProcessor, filename) - , m_visitedFiles(visitedFiles) -{ -} - -CxxUsingNamespaceCollector::~CxxUsingNamespaceCollector() {} - -void CxxUsingNamespaceCollector::OnToken(CxxLexerToken& token) -{ - switch(token.GetType()) { - case T_PP_INCLUDE_FILENAME: { - // we found an include statement, recurse into it - wxFileName include; - if(m_preProcessor->CanGoDeeper() && m_preProcessor->ExpandInclude(m_filename, token.GetText(), include) && - m_visitedFiles.count(include.GetFullPath()) == 0) { - m_visitedFiles.insert(include.GetFullPath()); - CxxUsingNamespaceCollector scanner{ m_preProcessor, include, m_visitedFiles }; - m_preProcessor->IncDepth(); - scanner.Parse(); - m_preProcessor->DecDepth(); - - // Append the matched results to the current parser results - for(const auto& ns : scanner.GetUsingNamespaces()) { - if(!ns.empty() && m_usingNamespaces.Index(ns) == wxNOT_FOUND) { - m_usingNamespaces.Add(ns); - } - } - } - break; - } - case T_USING: - ParseUsingNamespace(); - break; - default: - break; - } -} - -void CxxUsingNamespaceCollector::ParseUsingNamespace() -{ - // Get the next token - CxxLexerToken token; - if(!::LexerNext(m_scanner, token)) - return; - if(token.GetType() != T_NAMESPACE) - return; - - // Read everything until we find the ';' - wxString usingNamespace; - while(::LexerNext(m_scanner, token)) { - if(token.GetType() == ';') { - break; - } - usingNamespace << token.GetText(); - } - - if(!usingNamespace.IsEmpty() && m_usingNamespaces.Index(usingNamespace) == wxNOT_FOUND) { - m_usingNamespaces.Add(usingNamespace); - } -} diff --git a/CodeLite/CxxUsingNamespaceCollector.h b/CodeLite/CxxUsingNamespaceCollector.h deleted file mode 100644 index 57e50310b9..0000000000 --- a/CodeLite/CxxUsingNamespaceCollector.h +++ /dev/null @@ -1,56 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// Copyright : (C) 2015 Eran Ifrah -// File name : CxxUsingNamespaceCollector.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 CXXUSINGNAMESPACECOLLECTOR_H -#define CXXUSINGNAMESPACECOLLECTOR_H - -#include "CxxScannerBase.h" -#include "codelite_exports.h" - -class WXDLLIMPEXP_CL CxxUsingNamespaceCollector : public CxxScannerBase -{ - wxArrayString m_usingNamespaces; - std::unordered_set& m_visitedFiles; - -private: - void ParseUsingNamespace(); - -public: - virtual void OnToken(CxxLexerToken& token); - - void SetUsingNamespaces(const wxArrayString& usingNamespaces) - { - this->m_usingNamespaces = usingNamespaces; - } - const wxArrayString& GetUsingNamespaces() const - { - return m_usingNamespaces; - } - CxxUsingNamespaceCollector(CxxPreProcessor* preProcessor, const wxFileName& filename, - std::unordered_set& visitedFiles); - virtual ~CxxUsingNamespaceCollector(); -}; - -#endif // CXXUSINGNAMESPACECOLLECTOR_H diff --git a/CodeLite/MyCreatePipe.cpp b/CodeLite/MyCreatePipe.cpp deleted file mode 100644 index 622287352a..0000000000 --- a/CodeLite/MyCreatePipe.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/*++ - CreatePipe-like function that lets one or both handles be overlapped -Author: - Dave Hart Summer 1997 ---*/ -#ifdef __WXMSW__ -#include "MyCreatePipe.h" - -ULONG PipeSerialNumber = 0; - -/*++ -Routine Description: - The MyCreatePipe API is used to create an anonymous pipe I/O device. - Unlike CreatePipe FILE_FLAG_OVERLAPPED may be specified for one or - both handles. - Two handles to the device are created. One handle is opened for - reading and the other is opened for writing. These handles may be - used in subsequent calls to ReadFile and WriteFile to transmit data - through the pipe. -Arguments: - lpReadPipe - Returns a handle to the read side of the pipe. Data - may be read from the pipe by specifying this handle value in a - subsequent call to ReadFile. - lpWritePipe - Returns a handle to the write side of the pipe. Data - may be written to the pipe by specifying this handle value in a - subsequent call to WriteFile. - lpPipeAttributes - An optional parameter that may be used to specify - the attributes of the new pipe. If the parameter is not - specified, then the pipe is created without a security - descriptor, and the resulting handles are not inherited on - process creation. Otherwise, the optional security attributes - are used on the pipe, and the inherit handles flag effects both - pipe handles. - nSize - Supplies the requested buffer size for the pipe. This is - only a suggestion and is used by the operating system to - calculate an appropriate buffering mechanism. A value of zero - indicates that the system is to choose the default buffering - scheme. -Return Value: - TRUE - The operation was successful. - FALSE/NULL - The operation failed. Extended error status is available - using GetLastError. ---*/ -BOOL APIENTRY MyCreatePipe(OUT LPHANDLE lpReadPipe, OUT LPHANDLE lpWritePipe, IN LPSECURITY_ATTRIBUTES lpPipeAttributes, - IN DWORD nSize) - -{ - HANDLE ReadPipeHandle, WritePipeHandle; - DWORD dwError; - CHAR PipeNameBuffer[MAX_PATH]; - - // - // Only one valid OpenMode flag - FILE_FLAG_OVERLAPPED - // - DWORD dwReadMode = FILE_FLAG_OVERLAPPED; - DWORD dwWriteMode = FILE_FLAG_OVERLAPPED; - - // - // Set the default timeout to 120 seconds - // - if(nSize == 0) { nSize = 4096; } - - // Increment the pipe number, in a MT safe way - InterlockedIncrement(&PipeSerialNumber); - sprintf(PipeNameBuffer, "\\\\.\\Pipe\\LOCAL\\RemoteExeAnon.%08x.%08x", (unsigned int)GetCurrentProcessId(), - (unsigned int)PipeSerialNumber); - - ReadPipeHandle = CreateNamedPipeA(PipeNameBuffer, PIPE_ACCESS_INBOUND | dwReadMode, PIPE_TYPE_BYTE | PIPE_WAIT, - 1, // Number of pipes - nSize, // Out buffer size - nSize, // In buffer size - 120 * 1000, // Timeout in ms - lpPipeAttributes); - - if(!ReadPipeHandle) { return FALSE; } - - WritePipeHandle = CreateFileA(PipeNameBuffer, GENERIC_WRITE, - 0, // No sharing - lpPipeAttributes, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | dwWriteMode, - NULL // Template file - ); - - if(INVALID_HANDLE_VALUE == WritePipeHandle) { - dwError = GetLastError(); - CloseHandle(ReadPipeHandle); - SetLastError(dwError); - return FALSE; - } - - *lpReadPipe = ReadPipeHandle; - *lpWritePipe = WritePipeHandle; - return (TRUE); -} -#endif // __WXMSW__ diff --git a/CodeLite/MyCreatePipe.h b/CodeLite/MyCreatePipe.h deleted file mode 100644 index e2a68862d8..0000000000 --- a/CodeLite/MyCreatePipe.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef __WXMSW__ -#include "wx/msw/wrapwin.h" // includes windows.h -#include -BOOL APIENTRY MyCreatePipe(OUT LPHANDLE lpReadPipe, OUT LPHANDLE lpWritePipe, IN LPSECURITY_ATTRIBUTES lpPipeAttributes, - IN DWORD nSize); -#endif diff --git a/CodeLite/language.cpp b/CodeLite/language.cpp index 2299fa7cf9..edb812a022 100644 --- a/CodeLite/language.cpp +++ b/CodeLite/language.cpp @@ -29,7 +29,6 @@ #include "CxxPreProcessor.h" #include "CxxScannerTokens.h" #include "CxxTemplateFunction.h" -#include "CxxUsingNamespaceCollector.h" #include "CxxVariableScanner.h" #include "ctags_manager.h" #include "file_logger.h" diff --git a/Plugin/tabicons.cpp b/Plugin/tabicons.cpp deleted file mode 100644 index 8e319c8403..0000000000 --- a/Plugin/tabicons.cpp +++ /dev/null @@ -1,26 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// copyright : (C) 2014 Eran Ifrah -// file name : tabicons.cpp -// -// ------------------------------------------------------------------------- -// 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. -// -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// - -// Images diff --git a/Plugin/tabicons.h b/Plugin/tabicons.h deleted file mode 100644 index 92e87c09d6..0000000000 --- a/Plugin/tabicons.h +++ /dev/null @@ -1,29 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -// -// copyright : (C) 2013 by Eran Ifrah -// file name : tabicons.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 TAB_ICONS_H -#define TAB_ICONS_H - -#endif // TAB_ICONS_H diff --git a/ctagsd/lib/ProtocolHandler.cpp b/ctagsd/lib/ProtocolHandler.cpp index 402dac8851..8562eb52ad 100644 --- a/ctagsd/lib/ProtocolHandler.cpp +++ b/ctagsd/lib/ProtocolHandler.cpp @@ -6,7 +6,6 @@ #include "CxxPreProcessor.h" #include "CxxScannerTokens.h" #include "CxxTokenizer.h" -#include "CxxUsingNamespaceCollector.h" #include "CxxVariableScanner.h" #include "LSP/LSPEvent.h" #include "LSP/basic_types.h" diff --git a/ctagsd/tests/strings.hpp b/ctagsd/tests/strings.hpp index 6960834c39..0d39b9cce7 100644 --- a/ctagsd/tests/strings.hpp +++ b/ctagsd/tests/strings.hpp @@ -516,7 +516,6 @@ const wxString cc_text_ProtocolHandler = R"( #include "CxxPreProcessor.h" #include "CxxScannerTokens.h" #include "CxxTokenizer.h" -#include "CxxUsingNamespaceCollector.h" #include "CxxVariableScanner.h" #include "LSP/LSPEvent.h" #include "LSP/basic_types.h"