-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Compiles, but that's all) git-svn-id: https://codelite.svn.sourceforge.net/svnroot/codelite/trunk@1027 9da81c78-c036-0410-9e1f-a2b0375e4b5a
- Loading branch information
srabbelier
committed
Jan 30, 2008
1 parent
6c6b567
commit c103886
Showing
11 changed files
with
786 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<CodeLite_Project Name="MakefileImporter"> | ||
<VirtualDirectory Name="src"> | ||
<File Name="main.cpp"/> | ||
<File Name="MakefileParser.cpp"/> | ||
<File Name="Target.cpp"/> | ||
<File Name="TargetLexer.cpp"/> | ||
<File Name="makefileimporter.cpp"/> | ||
<File Name="VariableLexer.cpp"/> | ||
</VirtualDirectory> | ||
<VirtualDirectory Name="include"> | ||
<File Name="makefileimporter.h"/> | ||
<File Name="LineTypes.h"/> | ||
<File Name="MakefileParser.h"/> | ||
<File Name="Target.h"/> | ||
<File Name="TargetLexer.h"/> | ||
<File Name="VariableLexer.h"/> | ||
</VirtualDirectory> | ||
<VirtualDirectory Name="grammar"> | ||
<File Name="makefile_parser.l"/> | ||
<File Name="makefile_parser.y"/> | ||
</VirtualDirectory> | ||
<VirtualDirectory Name="UI"/> | ||
<VirtualDirectory Name="generated"> | ||
<File Name="makefile_lexer.cpp"/> | ||
<File Name="makefile_lexer.h"/> | ||
<File Name="makefile_parser.cpp"/> | ||
</VirtualDirectory> | ||
<Settings Type="Dynamic Library"> | ||
<Configuration Name="DebugUnicode" CompilerType="gnu g++" DebuggerType="GNU gdb debugger"> | ||
<General OutputFile="$(ConfigurationName)/MakefileImporter.so" IntermediateDirectory="./DebugUnicode" Command="" CommandArguments="" WorkingDirectory="./DebugUnicode"/> | ||
<Compiler Required="yes" Options="-g;$(shell wx-config --cxxflags --debug=yes --unicode=yes)"> | ||
<IncludePath Value="."/> | ||
<IncludePath Value="../../trunk/Interfaces"/> | ||
<IncludePath Value="../../trunk/CodeLite"/> | ||
<IncludePath Value="../../trunk/Plugin"/> | ||
<IncludePath Value="../../trunk/sdk/wxflatnotebook/include"/> | ||
<IncludePath Value="../../trunk/sqlite3"/> | ||
<IncludePath Value="../../trunk/sdk/wxsqlite3/include"/> | ||
<Preprocessor Value="__WX__"/> | ||
<Preprocessor Value="WXUSINGDLL"/> | ||
<Preprocessor Value="YY_NEVER_INTERACTIVE=1"/> | ||
</Compiler> | ||
<Linker Required="yes" Options="$(shell wx-config --debug=yes --libs --unicode=yes);"> | ||
<LibraryPath Value="../../trunk/lib/gcc_lib"/> | ||
<Library Value="libplugin_sdkud.a"/> | ||
<Library Value="libwxflatnotebookud.a"/> | ||
<Library Value="libCodeLiteud.a"/> | ||
<Library Value="libwxsqlite3ud.a"/> | ||
<Library Value="libsqlite3.a"/> | ||
</Linker> | ||
<ResourceCompiler Required="no" Options=""/> | ||
<PreBuild/> | ||
<PostBuild/> | ||
<CustomBuild Enabled="no"> | ||
<CleanCommand></CleanCommand> | ||
<BuildCommand></BuildCommand> | ||
<WorkingDirectory></WorkingDirectory> | ||
</CustomBuild> | ||
<AdditionalRules> | ||
<CustomPostBuild></CustomPostBuild> | ||
<CustomPreBuild>makefile_parser.cpp makefile_lexer.cpp | ||
makefile_parser.cpp: makefile_parser.y | ||
yacc -dl -t -v makefile_parser.y | ||
mv y.tab.c makefile_parser.cpp | ||
mv y.tab.h makefile_lexer.h | ||
|
||
makefile_lexer.cpp: makefile_parser.l | ||
flex -L makefile_parser.l | ||
mv lex.yy.c makefile_lexer.cpp | ||
</CustomPreBuild> | ||
</AdditionalRules> | ||
</Configuration> | ||
<Configuration Name="ReleaseUnicode" CompilerType="gnu g++" DebuggerType=""> | ||
<General OutputFile="$(ConfigurationName)/MakefileImporter.so" IntermediateDirectory="./ReleaseUnicode" Command="" CommandArguments="" WorkingDirectory="./ReleaseUnicode"/> | ||
<Compiler Required="yes" Options="$(shell wx-config --cxxflags --debug=no --unicode=yes); -O2"> | ||
<IncludePath Value="."/> | ||
<IncludePath Value="../../trunk/Interfaces"/> | ||
<IncludePath Value="../../trunk/CodeLite"/> | ||
<IncludePath Value="../../trunk/Plugin"/> | ||
<IncludePath Value="../../trunk/sdk/wxflatnotebook/include"/> | ||
<IncludePath Value="../../trunk/sqlite3"/> | ||
<IncludePath Value="../../trunk/sdk/wxsqlite3/include"/> | ||
<Preprocessor Value="__WX__"/> | ||
<Preprocessor Value="WXUSINGDLL"/> | ||
<Preprocessor Value="YY_NEVER_INTERACTIVE=1"/> | ||
</Compiler> | ||
<Linker Required="yes" Options="-O2;$(shell wx-config --debug=no --libs --unicode=yes);"> | ||
<LibraryPath Value="../../trunk/lib/gcc_lib"/> | ||
<Library Value="libwxflatnotebooku.a"/> | ||
<Library Value="libplugin_sdku.a"/> | ||
<Library Value="libCodeLiteu.a"/> | ||
<Library Value="libwxsqlite3u.a"/> | ||
<Library Value="libsqlite3.a"/> | ||
</Linker> | ||
<ResourceCompiler Required="no" Options=""/> | ||
<PreBuild/> | ||
<PostBuild/> | ||
<CustomBuild Enabled="no"> | ||
<CleanCommand></CleanCommand> | ||
<BuildCommand></BuildCommand> | ||
<WorkingDirectory></WorkingDirectory> | ||
</CustomBuild> | ||
<AdditionalRules> | ||
<CustomPostBuild></CustomPostBuild> | ||
<CustomPreBuild></CustomPreBuild> | ||
</AdditionalRules> | ||
</Configuration> | ||
<Configuration Name="WinDebugUnicode" CompilerType="gnu g++" DebuggerType="GNU gdb debugger"> | ||
<General OutputFile="$(ConfigurationName)/MakefileImporter.so" IntermediateDirectory="./WinDebugUnicode" Command="" CommandArguments="" WorkingDirectory=""/> | ||
<Compiler Required="yes" Options="-g;$(shell wx-config --cxxflags --unicode=yes --debug=yes)"> | ||
<IncludePath Value="."/> | ||
<IncludePath Value="../../trunk/Interfaces"/> | ||
<IncludePath Value="../../trunk/CodeLite"/> | ||
<IncludePath Value="../../trunk/Plugin"/> | ||
<IncludePath Value="../../trunk/sdk/wxflatnotebook/include"/> | ||
<IncludePath Value="../../trunk/sqlite3"/> | ||
<IncludePath Value="../../trunk/sdk/wxsqlite3/include"/> | ||
<Preprocessor Value="__WX__"/> | ||
<Preprocessor Value="WXUSINGDLL"/> | ||
<Preprocessor Value="_WIN32_WINNT=0x501"/> | ||
<Preprocessor Value="ASTYLE_LIB"/> | ||
</Compiler> | ||
<Linker Required="yes" Options="-O2;$(shell wx-config --debug=yes --libs --unicode=yes);"> | ||
<LibraryPath Value="../../trunk/lib/gcc_lib"/> | ||
<Library Value="libplugin_sdkud.a"/> | ||
<Library Value="libCodeLiteud.a"/> | ||
<Library Value="libwxsqlite3u.a"/> | ||
<Library Value="libsqlite3.a"/> | ||
<Library Value="libwxflatnotebookud.a"/> | ||
<Library Value="libwxmsw28ud.a"/> | ||
</Linker> | ||
<ResourceCompiler Required="no" Options=""/> | ||
<PreBuild/> | ||
<PostBuild/> | ||
<CustomBuild Enabled="no"> | ||
<CleanCommand></CleanCommand> | ||
<BuildCommand></BuildCommand> | ||
<WorkingDirectory></WorkingDirectory> | ||
</CustomBuild> | ||
<AdditionalRules> | ||
<CustomPostBuild></CustomPostBuild> | ||
<CustomPreBuild></CustomPreBuild> | ||
</AdditionalRules> | ||
</Configuration> | ||
<Configuration Name="WinReleaseUnicode" CompilerType="gnu g++" DebuggerType="GNU gdb debugger"> | ||
<General OutputFile="$(ConfigurationName)/MakefileImporter.so" IntermediateDirectory="./WinReleaseUnicode" Command="" CommandArguments="" WorkingDirectory="./WinReleaseUnicode"/> | ||
<Compiler Required="yes" Options="-g;$(shell wx-config --cxxflags --unicode=yes --debug=no)"> | ||
<IncludePath Value="."/> | ||
<IncludePath Value="../../trunk/Interfaces"/> | ||
<IncludePath Value="../../trunk/CodeLite"/> | ||
<IncludePath Value="../../trunk/Plugin"/> | ||
<IncludePath Value="../../trunk/sdk/wxflatnotebook/include"/> | ||
<IncludePath Value="../../trunk/sqlite3"/> | ||
<IncludePath Value="../../trunk/sdk/wxsqlite3/include"/> | ||
<Preprocessor Value="__WX__"/> | ||
<Preprocessor Value="WXUSINGDLL"/> | ||
<Preprocessor Value="_WIN32_WINNT=0x501"/> | ||
<Preprocessor Value="ASTYLE_LIB"/> | ||
</Compiler> | ||
<Linker Required="yes" Options="-O2;$(shell wx-config --debug=no --libs --unicode=yes);"> | ||
<LibraryPath Value="../../trunk/lib/gcc_lib"/> | ||
<Library Value="libplugin_sdku.a"/> | ||
<Library Value="libCodeLiteu.a"/> | ||
<Library Value="libwxsqlite3u.a"/> | ||
<Library Value="libsqlite3.a"/> | ||
<Library Value="libwxflatnotebooku.a"/> | ||
<Library Value="libwxmsw28u.a"/> | ||
</Linker> | ||
<ResourceCompiler Required="no" Options=""/> | ||
<PreBuild/> | ||
<PostBuild/> | ||
<CustomBuild Enabled="no"> | ||
<CleanCommand></CleanCommand> | ||
<BuildCommand></BuildCommand> | ||
<WorkingDirectory></WorkingDirectory> | ||
</CustomBuild> | ||
<AdditionalRules> | ||
<CustomPostBuild></CustomPostBuild> | ||
<CustomPreBuild></CustomPreBuild> | ||
</AdditionalRules> | ||
</Configuration> | ||
</Settings> | ||
<Dependencies/> | ||
</CodeLite_Project> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,66 @@ | ||
#include "makefile_lexer.h" | ||
#include "VariableLexer.h" | ||
#include "precompiled_header.h" | ||
#include <string> | ||
#include <vector> | ||
#include <map> | ||
//#include <wx/msgdlg.h> // wxMessageBox | ||
#include <wx/wx.h> | ||
#include <wx/log.h> | ||
#include <wx/string.h> | ||
|
||
void initLexer(const char *filename); | ||
|
||
#define YYSTYPE wxString | ||
#define YYSTYPE std::string | ||
|
||
YYSTYPE yyparse(); | ||
|
||
typedef wxArrayString Strings; | ||
typedef std::map<wxString, wxString> Tokens; | ||
typedef Tokens::iterator Itokens; | ||
typedef std::vector<std::string> Strings; | ||
typedef Strings::iterator IStrings; | ||
typedef std::map<std::string, std::string> Tokens; | ||
typedef Tokens::iterator ITokens; | ||
|
||
Strings TheOutput; | ||
Strings TheUnmatched; | ||
Strings TheError; | ||
Tokens TheTokens; | ||
|
||
void VariableLexer::DebugMessage(const wxString& msg) | ||
{ | ||
wxUnusedVar(msg); | ||
} | ||
|
||
VariableLexer::VariableLexer(wxString path) | ||
{ | ||
initLexer(path.mb_str()); | ||
yyparse(); | ||
|
||
for(IStrings it = TheOutput.begin(); it != TheOutput.end(); it++) | ||
m_output.Add(_U(it->c_str())); | ||
|
||
for(IStrings it = TheUnmatched.begin(); it != TheUnmatched.end(); it++) | ||
m_unmatched.Add(_U(it->c_str())); | ||
|
||
m_output = TheOutput; | ||
m_unmatched = TheUnmatched; | ||
m_error = TheError; | ||
m_tokens = TheTokens; | ||
for(IStrings it = TheError.begin(); it != TheError.end(); it++) | ||
m_error.Add(_U(it->c_str())); | ||
|
||
for(ITokens it = TheTokens.begin(); it != TheTokens.end(); it++) | ||
m_tokens[_U(it->first.c_str())] = _U(it->second.c_str()); | ||
} | ||
|
||
/** | ||
* Get result, constructor ensures that m_result is available when we get to this point. | ||
*/ | ||
wxArrayString VariableLexer::getResult() | ||
const wxArrayString& VariableLexer::getResult() | ||
{ | ||
return m_output; | ||
} | ||
|
||
const wxArrayString& VariableLexer::getUnmatched() | ||
{ | ||
return m_unmatched; | ||
} | ||
|
||
const wxArrayString& VariableLexer::getError() | ||
{ | ||
return m_error; | ||
} | ||
|
||
const std::map<wxString,wxString>& VariableLexer::getTokens() | ||
{ | ||
return m_tokens; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.