Changeset 7030dab for src/Parser/lex.ll


Ignore:
Timestamp:
Apr 6, 2020, 4:46:28 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
e3bc51c
Parents:
71d6bd8 (diff), 057298e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into new-ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    r71d6bd8 r7030dab  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sun Aug  4 20:53:47 2019
    13  * Update Count     : 719
     12 * Last Modified On : Sat Feb 15 11:05:50 2020
     13 * Update Count     : 737
    1414 */
    1515
     
    4343#include "TypedefTable.h"
    4444
     45string * build_postfix_name( string * name );
     46
    4547char *yyfilename;
    4648string *strtext;                                                                                // accumulate parts of character and string constant value
     
    6365#define FLOATXX(v) KEYWORD_RETURN(v);
    6466#else
    65 #define FLOATXX(v) IDENTIFIER_RETURN(); 
     67#define FLOATXX(v) IDENTIFIER_RETURN();
    6668#endif // HAVE_KEYWORDS_FLOATXX
    6769
     
    299301_Static_assert  { KEYWORD_RETURN(STATICASSERT); }               // C11
    300302struct                  { KEYWORD_RETURN(STRUCT); }
    301         /* suspend                      { KEYWORD_RETURN(SUSPEND); }                    // CFA */
     303suspend                 { KEYWORD_RETURN(SUSPEND); }                    // CFA
    302304switch                  { KEYWORD_RETURN(SWITCH); }
    303305thread                  { KEYWORD_RETURN(THREAD); }                             // C11
     
    330332                                /* identifier */
    331333{identifier}    { IDENTIFIER_RETURN(); }
    332 "`"{identifier}"`" {                                                                    // CFA
    333         yytext[yyleng - 1] = '\0'; yytext += 1;                         // SKULLDUGGERY: remove backquotes (ok to shorten?)
     334"``"{identifier} {                                                                              // CFA
     335        yytext[yyleng] = '\0'; yytext += 2;                                     // SKULLDUGGERY: remove backquotes (ok to shorten?)
    334336        IDENTIFIER_RETURN();
    335337}
     
    432434"?"({op_unary_pre_post}|"()"|"[?]"|"{}") { IDENTIFIER_RETURN(); }
    433435"^?{}"                  { IDENTIFIER_RETURN(); }
    434 "?`"{identifier} { IDENTIFIER_RETURN(); }                               // postfix operator
     436"?`"{identifier} {                                                                              // postfix operator
     437        yylval.tok.str = new string( &yytext[2] );                      // remove ?`
     438        yylval.tok.str = build_postfix_name( yylval.tok.str ); // add prefix
     439        RETURN_LOCN( typedefTable.isKind( *yylval.tok.str ) );
     440}
    435441"?"{op_binary_over}"?"  { IDENTIFIER_RETURN(); }                // binary
    436442        /*
Note: See TracChangeset for help on using the changeset viewer.