Browse Source

Prevent conflict of definition of yyguts_t from different lex files.

ObjPtr
Michael Uleysky 9 years ago
parent
commit
92a617eaac
  1. 4
      src/parser/lexical.l

4
src/parser/lexical.l

@ -26,7 +26,9 @@ class ObjectBase;
#include "grammatical.h" #include "grammatical.h"
// Get rid of warning on unused function // Get rid of warning on unused function
#define YY_NO_INPUT #define YY_NO_INPUT
// Termination (mostly. in case of errors) // struct yyguts_t defined in each flex output file, this emits warning at linking stage
#define yyguts_t confguts_t
// Termination (mostly, in case of errors)
#define yyterminate(ret) { while(0!=YY_CURRENT_BUFFER) yypop_buffer_state(yyscanner); str.erase(); yyextra->retcode=-(ret); return (ret); } #define yyterminate(ret) { while(0!=YY_CURRENT_BUFFER) yypop_buffer_state(yyscanner); str.erase(); yyextra->retcode=-(ret); return (ret); }
// Abnormal termination with description of error // Abnormal termination with description of error
#define yyerrormessage(message,ret) {COUT(ERROR)<<std::endl<<" Lexical error in file "<<yyextra->state.curdir<<yyextra->state.filename<<" at line "<<yyextra->state.curline<<": "<<(message)<<std::endl; yyterminate(ret);} #define yyerrormessage(message,ret) {COUT(ERROR)<<std::endl<<" Lexical error in file "<<yyextra->state.curdir<<yyextra->state.filename<<" at line "<<yyextra->state.curline<<": "<<(message)<<std::endl; yyterminate(ret);}

Loading…
Cancel
Save