Changes in src/Parser/lex.cc [68cd1ce:de62360d]
- File:
-
- 1 edited
-
src/Parser/lex.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.cc
r68cd1ce rde62360d 1390 1390 * Created On : Sat Sep 22 08:58:10 2001 1391 1391 * Last Modified By : Peter A. Buhr 1392 * Last Modified On : Thu Jun 11 21:52:3520151393 * Update Count : 3 821392 * Last Modified On : Fri Jun 19 11:10:14 2015 1393 * Update Count : 392 1394 1394 */ 1395 1395 #line 20 "lex.ll" 1396 // This lexer assumes the program has been preprocessed by cpp. Hence, all user level preprocessor directive 1397 // have been performed and removed from the source. The only exceptions are preprocessor directives passed to1398 // the compiler (e.g.,line-number directives) and C/C++ style comments, which are ignored.1396 // This lexer assumes the program has been preprocessed by cpp. Hence, all user level preprocessor directive have been 1397 // performed and removed from the source. The only exceptions are preprocessor directives passed to the compiler (e.g., 1398 // line-number directives) and C/C++ style comments, which are ignored. 1399 1399 1400 1400 //**************************** Includes and Defines **************************** … … 1409 1409 std::string *strtext; // accumulate parts of character and string constant value 1410 1410 1411 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return( x)1412 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); RETURN_LOCN( x)1413 #define RETURN_CHAR(x) yylval.tok.str = NULL; RETURN_LOCN( x)1414 #define RETURN_STR(x) yylval.tok.str = strtext; RETURN_LOCN( x)1411 #define RETURN_LOCN(x) yylval.tok.loc.file = yyfilename; yylval.tok.loc.line = yylineno; return( x ) 1412 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); RETURN_LOCN( x ) 1413 #define RETURN_CHAR(x) yylval.tok.str = NULL; RETURN_LOCN( x ) 1414 #define RETURN_STR(x) yylval.tok.str = strtext; RETURN_LOCN( x ) 1415 1415 1416 1416 #define WHITE_RETURN(x) // do nothing 1417 #define NEWLINE_RETURN() WHITE_RETURN( '\n')1418 #define ASCIIOP_RETURN() RETURN_CHAR( (int)yytext[0])// single character operator1419 #define NAMEDOP_RETURN(x) RETURN_VAL( x) // multichar operator, with a name1420 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL( x) // numeric constant1421 #define KEYWORD_RETURN(x) RETURN_CHAR( x)// keyword1422 #define IDENTIFIER_RETURN() RETURN_VAL( (typedefTable.isIdentifier(yytext) ? IDENTIFIER : typedefTable.isTypedef(yytext) ? TYPEDEFname : TYPEGENname))1423 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER)1417 #define NEWLINE_RETURN() WHITE_RETURN( '\n' ) 1418 #define ASCIIOP_RETURN() RETURN_CHAR( (int)yytext[0] ) // single character operator 1419 #define NAMEDOP_RETURN(x) RETURN_VAL( x ) // multichar operator, with a name 1420 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL( x ) // numeric constant 1421 #define KEYWORD_RETURN(x) RETURN_CHAR( x ) // keyword 1422 #define IDENTIFIER_RETURN() RETURN_VAL( (typedefTable.isIdentifier( yytext ) ? IDENTIFIER : typedefTable.isTypedef( yytext ) ? TYPEDEFname : TYPEGENname ) ) 1423 #define ATTRIBUTE_RETURN() RETURN_VAL( ATTR_IDENTIFIER ) 1424 1424 1425 1425 void rm_underscore() { … … 3652 3652 3653 3653 // Local Variables: // 3654 // fill-column: 110//3654 // mode: c++ // 3655 3655 // tab-width: 4 // 3656 // mode: c++ //3657 3656 // compile-command: "make install" // 3658 3657 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.