diff options
author | marha <marha@users.sourceforge.net> | 2011-01-19 20:29:24 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-01-19 20:29:24 +0000 |
commit | cbe6ed88f01b654241301539d8fa3f6111a0a6de (patch) | |
tree | 0fe25b7083dc4cc0c3e162fe18e9d427fcb712a5 /tools/mhmake/src/mhmakefileparser.h | |
parent | cdc60fdcddbe5666aac11af34c6c030d4a670b99 (diff) | |
download | vcxsrv-cbe6ed88f01b654241301539d8fa3f6111a0a6de.tar.gz vcxsrv-cbe6ed88f01b654241301539d8fa3f6111a0a6de.tar.bz2 vcxsrv-cbe6ed88f01b654241301539d8fa3f6111a0a6de.zip |
Use bison instead of bison++
The += operator should also take the environment variables into account
Solved problem when & in redirect operator on command line
Solved syntax error when SPACE was follewed by SPACE
Removed kdevelop3 project files
Enable debug info in debug build on linux
Added support for foreach function
Fixed dependency problem for implicit rules with extra dependencies
Increased gnu make compatibility: allow implicit rules without commands
Solved wrong error message when it cannot build a target in mhmake_dbg
On windows: when checking the extension of a command: make sure a / does not cause a wrong decision
Added safety against recursive implicit rules.
Fixed wrong check on failure to open makefiles.
Make sure no message is printed when -include is used
flex and bison generated files: make sure the #line statements have the correct line numbers for the debugger after having added one line in the beginning of the file after running the flex/bison.
Make sure that the variable defined just before an error or message/info macro is defined when the message is generated.
mhmake_dbg: print error message when a target cannot be build because the directory of the target does not exist (and no rule is defined for it)
Reformatted message/info macro output
Also print makefile and line number when using error and message macro
Solved crash in mhmake_dbg when -C is specified on the command line
Solved problem in macro expansion when 2 patsubst inside each other
addprefix should not give an error when done on an empty string
Use comspec when echo is followed by a pipe character (piping is not supported by the echo internal command of mhmake)
Solved possible stack curruption (there was little chance that this was occuring)
Diffstat (limited to 'tools/mhmake/src/mhmakefileparser.h')
-rw-r--r-- | tools/mhmake/src/mhmakefileparser.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/tools/mhmake/src/mhmakefileparser.h b/tools/mhmake/src/mhmakefileparser.h index f1c9cb280..49c8aedb3 100644 --- a/tools/mhmake/src/mhmakefileparser.h +++ b/tools/mhmake/src/mhmakefileparser.h @@ -27,13 +27,7 @@ class rule;
-class mhmakeFlexLexer;
-
-struct TOKENVALUE
-{
- string theString;
- int ival;
-};
+#include "flexlexer.h"
class mhmakefileparser;
typedef string (mhmakefileparser::*function_f)(const string &, const string *) const;
@@ -52,13 +46,18 @@ typedef set<fileinfo*> deps_t; typedef pair< bool, deps_t > autodeps_entry_t;
typedef map<fileinfo*, autodeps_entry_t > autodeps_t;
-class mhmakefileparser : public refbase
+namespace yy
{
+ class location;
+}
+class mhmakefileparser : public refbase
+{
private:
static commandqueue sm_CommandQueue;
-
+protected:
mhmakeFlexLexer *m_ptheLexer;
+private:
int m_yyloc;
fileinfo *m_RuleThatIsBuild;
vector<string> m_ToBeIncludeAfterBuild;
@@ -74,7 +73,6 @@ private: protected:
map<string,string> m_Variables;
map<string,string> m_CommandLineVars;
- TOKENVALUE m_theTokenValue;
const fileinfo *m_MakeDir;
refptr<rule> m_pCurrentRule;
refptr<fileinfoarray> m_pCurrentItems;
@@ -106,6 +104,8 @@ protected: autodeps_t m_AutoDeps;
set< const fileinfo* > m_Targets; // List of targets that are build by this makefile
+ vector<string> m_FilesToRemoveAtEnd;
+
static mh_time_t m_sBuildTime;
private:
string ResolveExpression(const string &InExpr,string &Rest) const;
@@ -223,6 +223,13 @@ public: virtual ~mhmakefileparser() /* virtual to be sure the correct destructor is called when we delete with a pointer to this class which in reality is a pointer to a derived class */
{
SaveAutoDepsFile();
+ /* remove generated temporary batch files */
+ vector<string>::const_iterator It=m_FilesToRemoveAtEnd.begin();
+ while (It!=m_FilesToRemoveAtEnd.end())
+ {
+ remove(It->c_str());
+ It++;
+ }
#ifndef WIN32
char **pEnv=m_pEnv;
if (pEnv)
@@ -230,9 +237,12 @@ public: #endif
free(m_pEnv);
}
- virtual int yylex(void);
- virtual void yyerror(const char *m);
- virtual int yyparse()
+ int yylex (YYSTYPE* yylval, yy::location* yylloc)
+ {
+ return m_ptheLexer->yylex(yylval,yylloc);
+ }
+
+ virtual int parse()
{
throw("Please derive if you want to execute yyparse.");
}
|