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/flexlexer.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/flexlexer.h')
-rw-r--r-- | tools/mhmake/src/flexlexer.h | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/tools/mhmake/src/flexlexer.h b/tools/mhmake/src/flexlexer.h index 48dab04ae..08acef335 100644 --- a/tools/mhmake/src/flexlexer.h +++ b/tools/mhmake/src/flexlexer.h @@ -47,7 +47,18 @@ #ifndef __FLEX_LEXER_H // Never included before - need to define base class. #define __FLEX_LEXER_H -#include "mhmakeparser.h" +class mhmakefileparser; + +#include "refptr.h" + +struct YYSTYPE +{ + string theString; + int ival; +}; +typedef struct YYSTYPE YYSTYPE; + +#include "location.hh" #include <iostream> # ifndef FLEX_STD @@ -62,7 +73,7 @@ typedef int yy_state_type; class FlexLexer { public: - FlexLexer() : yylineno(1), m_BraceIndent(0) {} + FlexLexer() : m_BraceIndent(0) {} virtual ~FlexLexer() { } const char* YYText() const { return yytext; } @@ -75,23 +86,19 @@ public: virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0; virtual void yyrestart( FLEX_STD istream* s ) = 0; - virtual int yylex(TOKENVALUE &theValue) = 0; - + virtual int yylex(YYSTYPE *yylval, yy::location* yylloc) = 0; // Switch to new input/output streams. A nil stream pointer // indicates "keep the current one". virtual void switch_streams( FLEX_STD istream* new_in = 0, FLEX_STD ostream* new_out = 0 ) = 0; - int lineno() const { return yylineno; } - int debug() const { return yy_flex_debug; } void set_debug( int flag ) { yy_flex_debug = flag; } protected: char* yytext; int yyleng; - int yylineno; // only maintained if you use %option yylineno int yy_flex_debug; // only has effect with -d or "%option debug" public: @@ -101,11 +108,11 @@ public: YY_BUFFER_STATE m_BufferState; ifstream m_Stream; string m_FileName; - int yylineno; - INSTACK(YY_BUFFER_STATE BufferState, const string &FileToOpen, const string &PrevFileName, int Line) : + yy::location yylloc; + INSTACK(YY_BUFFER_STATE BufferState, const string &FileToOpen, const string &PrevFileName, yy::location *pLocInfo) : m_BufferState(BufferState), m_FileName(PrevFileName), - yylineno(Line), + yylloc(*pLocInfo), m_Stream(FileToOpen.c_str(), ios_base::in) { } @@ -144,16 +151,19 @@ public: string m_InputFileName; string m_curtoken; mystack m_IncludeStack; - mhmakeparser *m_pParser; - mhmakeparser *GetParser() + mhmakefileparser *m_pParser; + mhmakefileparser *GetParser() { return m_pParser; } - +public: + string &GetInputFilename() + { + return m_InputFileName; + } }; } -#endif // FLEXLEXER_H #if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce) // Either this is the first time through (yyFlexLexerOnce not defined), @@ -179,7 +189,7 @@ public: void yypush_buffer_state( struct yy_buffer_state* new_buffer ); void yypop_buffer_state(); - virtual int yylex(TOKENVALUE &theValue); + virtual int yylex(YYSTYPE* yylval, yy::location* yylloc); virtual void switch_streams( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0 ); protected: @@ -258,3 +268,4 @@ protected: #endif // yyFlexLexer || ! yyFlexLexerOnce +#endif // FLEXLEXER_H |