Changeset de62360d for src/Parser/lex.ll


Ignore:
Timestamp:
Jun 24, 2015, 4:04:19 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
94e0864d
Parents:
a1d5d2a
Message:

fix computed goto, fixed -std=, implicit typedefs for enum and aggregates, add _Noreturn _Thread_local

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    ra1d5d2a rde62360d  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Thu Jun 11 21:52:35 2015
    13  * Update Count     : 382
     12 * Last Modified On : Fri Jun 19 11:10:14 2015
     13 * Update Count     : 392
    1414 */
    1515
     
    1818
    1919%{
    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 to
    22 // 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.
    2323
    2424//**************************** Includes and Defines ****************************
     
    3333std::string *strtext;                                                                   // accumulate parts of character and string constant value
    3434
    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 )
    3939
    4040#define WHITE_RETURN(x)                                                                 // do nothing
    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)
     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 )
    4848
    4949void rm_underscore() {
     
    398398
    399399// Local Variables: //
    400 // fill-column: 110 //
     400// mode: c++ //
    401401// tab-width: 4 //
    402 // mode: c++ //
    403402// compile-command: "make install" //
    404403// End: //
Note: See TracChangeset for help on using the changeset viewer.