Changeset 948fdef for src


Ignore:
Timestamp:
Feb 1, 2020, 1:27:09 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
33a484f
Parents:
c334ecd
Message:

change backquotes identifiers to xxx syntax, change priority of postfix function call

Location:
src/Parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    rc334ecd r948fdef  
    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  1 07:16:44 2020
     13 * Update Count     : 724
    1414 */
    1515
     
    330330                                /* identifier */
    331331{identifier}    { IDENTIFIER_RETURN(); }
    332 "`"{identifier}"`" {                                                                    // CFA
    333         yytext[yyleng - 1] = '\0'; yytext += 1;                         // SKULLDUGGERY: remove backquotes (ok to shorten?)
     332"``"{identifier}"``" {                                                                  // CFA
     333        yytext[yyleng - 2] = '\0'; yytext += 2;                         // SKULLDUGGERY: remove backquotes (ok to shorten?)
    334334        IDENTIFIER_RETURN();
    335335}
  • src/Parser/parser.yy

    rc334ecd r948fdef  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 17 14:54:55 2020
    13 // Update Count     : 4426
     12// Last Modified On : Sat Feb  1 10:04:40 2020
     13// Update Count     : 4440
    1414//
    1515
     
    579579        | '(' compound_statement ')'                                            // GCC, lambda expression
    580580                { $$ = new ExpressionNode( new StmtExpr( dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >($2) ) ) ); }
    581         | constant '`' IDENTIFIER                                                       // CFA, postfix call
    582                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
    583         | string_literal '`' IDENTIFIER                                         // CFA, postfix call
    584                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }
    585         | IDENTIFIER '`' IDENTIFIER                                                     // CFA, postfix call
    586                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( build_varref( $1 ) ) ) ); }
    587         | tuple '`' IDENTIFIER                                                          // CFA, postfix call
    588                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
    589         | '(' comma_expression ')' '`' IDENTIFIER                       // CFA, postfix call
    590                 { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $5 ) ), $2 ) ); }
    591581        | type_name '.' identifier                                                      // CFA, nested type
    592582                { SemanticError( yylloc, "Qualified name is currently unimplemented." ); $$ = nullptr; }
     
    642632        | postfix_expression '(' argument_expression_list ')'
    643633                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
     634        | postfix_expression '`' identifier                                     // CFA, postfix call
     635                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
     636        | constant '`' identifier                                                       // CFA, postfix call
     637                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), $1 ) ); }
     638        | string_literal '`' identifier                                         // CFA, postfix call
     639                { $$ = new ExpressionNode( build_func( new ExpressionNode( build_postfix_name( $3 ) ), new ExpressionNode( $1 ) ) ); }
    644640        | postfix_expression '.' identifier
    645641                { $$ = new ExpressionNode( build_fieldSel( $1, build_varref( $3 ) ) ); }
     
    666662        | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal
    667663                { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); }
    668         | '^' primary_expression '{' argument_expression_list '}' // CFA
     664        | '^' primary_expression '{' argument_expression_list '}' // CFA, destructor call
    669665                {
    670666                        Token fn;
Note: See TracChangeset for help on using the changeset viewer.