Changes in src/Parser/lex.ll [68cd1ce:de62360d]
- File:
-
- 1 edited
-
src/Parser/lex.ll (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r68cd1ce rde62360d 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Thu Jun 11 21:52:35201513 * Update Count : 3 8212 * Last Modified On : Fri Jun 19 11:10:14 2015 13 * Update Count : 392 14 14 */ 15 15 … … 18 18 19 19 %{ 20 // This lexer assumes the program has been preprocessed by cpp. Hence, all user level preprocessor directive 21 // have been performed and removed from the source. The only exceptions are preprocessor directives passed to22 // the compiler (e.g.,line-number directives) and C/C++ style comments, which are ignored.20 // This lexer assumes the program has been preprocessed by cpp. Hence, all user level preprocessor directive have been 21 // performed and removed from the source. The only exceptions are preprocessor directives passed to the compiler (e.g., 22 // line-number directives) and C/C++ style comments, which are ignored. 23 23 24 24 //**************************** Includes and Defines **************************** … … 33 33 std::string *strtext; // accumulate parts of character and string constant value 34 34 35 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return( x)36 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); RETURN_LOCN( x)37 #define RETURN_CHAR(x) yylval.tok.str = NULL; RETURN_LOCN( x)38 #define RETURN_STR(x) yylval.tok.str = strtext; RETURN_LOCN( x)35 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return( x ) 36 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); RETURN_LOCN( x ) 37 #define RETURN_CHAR(x) yylval.tok.str = NULL; RETURN_LOCN( x ) 38 #define RETURN_STR(x) yylval.tok.str = strtext; RETURN_LOCN( x ) 39 39 40 40 #define WHITE_RETURN(x) // do nothing 41 #define NEWLINE_RETURN() WHITE_RETURN( '\n')42 #define ASCIIOP_RETURN() RETURN_CHAR( (int)yytext[0])// single character operator43 #define NAMEDOP_RETURN(x) RETURN_VAL( x) // multichar operator, with a name44 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL( x) // numeric constant45 #define KEYWORD_RETURN(x) RETURN_CHAR( x)// keyword46 #define IDENTIFIER_RETURN() RETURN_VAL( (typedefTable.isIdentifier(yytext) ? IDENTIFIER : typedefTable.isTypedef(yytext) ? TYPEDEFname : TYPEGENname))47 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER)41 #define NEWLINE_RETURN() WHITE_RETURN( '\n' ) 42 #define ASCIIOP_RETURN() RETURN_CHAR( (int)yytext[0] ) // single character operator 43 #define NAMEDOP_RETURN(x) RETURN_VAL( x ) // multichar operator, with a name 44 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL( x ) // numeric constant 45 #define KEYWORD_RETURN(x) RETURN_CHAR( x ) // keyword 46 #define IDENTIFIER_RETURN() RETURN_VAL( (typedefTable.isIdentifier( yytext ) ? IDENTIFIER : typedefTable.isTypedef( yytext ) ? TYPEDEFname : TYPEGENname ) ) 47 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER ) 48 48 49 49 void rm_underscore() { … … 398 398 399 399 // Local Variables: // 400 // fill-column: 110//400 // mode: c++ // 401 401 // tab-width: 4 // 402 // mode: c++ //403 402 // compile-command: "make install" // 404 403 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.