Changeset 5f2f2d7 for src/Parser/lex.ll
- Timestamp:
- Jun 8, 2015, 8:56:35 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 81419b5
- Parents:
- cd623a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
rcd623a4 r5f2f2d7 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Sun Jun 7 07:14:16201513 * Update Count : 3 7412 * Last Modified On : Mon Jun 8 20:24:15 2015 13 * Update Count : 381 14 14 */ 15 15 16 16 %option yylineno 17 %option nounput 17 18 18 19 %{ … … 32 33 std::string *strtext; // accumulate parts of character and string constant value 33 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) 39 34 40 #define WHITE_RETURN(x) // do nothing 35 41 #define NEWLINE_RETURN() WHITE_RETURN('\n') 36 #define RETURN_VAL(x) yylval.tok.str = new std::string( yytext ); \ 37 yylval.tok.loc.file = yyfilename; \ 38 yylval.tok.loc.line = yylineno; \ 39 return(x) 40 #define RETURN_STR(x) yylval.tok.str = strtext; \ 41 yylval.tok.loc.file = yyfilename; \ 42 yylval.tok.loc.line = yylineno; \ 43 return(x) 44 45 #define KEYWORD_RETURN(x) RETURN_VAL(x) // keyword 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 46 #define IDENTIFIER_RETURN() RETURN_VAL((typedefTable.isIdentifier(yytext) ? IDENTIFIER : typedefTable.isTypedef(yytext) ? TYPEDEFname : TYPEGENname)) 47 //#define ATTRIBUTE_RETURN() RETURN_VAL((typedefTable.isIdentifier(yytext) ? ATTR_IDENTIFIER : typedefTable.isTypedef(yytext) ? ATTR_TYPEDEFname : ATTR_TYPEGENname))48 47 #define ATTRIBUTE_RETURN() RETURN_VAL(ATTR_IDENTIFIER) 49 50 #define ASCIIOP_RETURN() RETURN_VAL((int)yytext[0]) // single character operator51 #define NAMEDOP_RETURN(x) RETURN_VAL(x) // multichar operator, with a name52 53 #define NUMERIC_RETURN(x) rm_underscore(); RETURN_VAL(x) // numeric constant54 48 55 49 void rm_underscore() {
Note: See TracChangeset
for help on using the changeset viewer.