Changes in src/Parser/lex.cc [de62360d:68cd1ce]
- File:
-
- 1 edited
-
src/Parser/lex.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.cc
rde62360d r68cd1ce 1390 1390 * Created On : Sat Sep 22 08:58:10 2001 1391 1391 * Last Modified By : Peter A. Buhr 1392 * Last Modified On : Fri Jun 19 11:10:1420151393 * Update Count : 3 921392 * Last Modified On : Thu Jun 11 21:52:35 2015 1393 * Update Count : 382 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 have been1397 // 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.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 to 1398 // the compiler (e.g., 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 // 3655 // tab-width: 4 // 3654 3656 // mode: c++ // 3655 // tab-width: 4 //3656 3657 // compile-command: "make install" // 3657 3658 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.