Changeset 25744d2 for src


Ignore:
Timestamp:
Oct 6, 2020, 9:43:42 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
fd2f4a9
Parents:
aa5777c
Message:

make suspend a keyword, make @= not a syntax error, deprecated typedef expression, make aggregate exception unimplemented

Location:
src/Parser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/lex.ll

    raa5777c r25744d2  
    1010 * Created On       : Sat Sep 22 08:58:10 2001
    1111 * Last Modified By : Peter A. Buhr
    12  * Last Modified On : Sat Feb 15 11:05:50 2020
    13  * Update Count     : 737
     12 * Last Modified On : Tue Oct  6 18:15:41 2020
     13 * Update Count     : 743
    1414 */
    1515
     
    6262#define IDENTIFIER_RETURN()     RETURN_VAL( typedefTable.isKind( yytext ) )
    6363
    64 #ifdef HAVE_KEYWORDS_FLOATXX                                                            // GCC >= 7 => keyword, otherwise typedef
     64#ifdef HAVE_KEYWORDS_FLOATXX                                                    // GCC >= 7 => keyword, otherwise typedef
    6565#define FLOATXX(v) KEYWORD_RETURN(v);
    6666#else
     
    292292__restrict__    { KEYWORD_RETURN(RESTRICT); }                   // GCC
    293293return                  { KEYWORD_RETURN(RETURN); }
    294         /* resume                       { KEYWORD_RETURN(RESUME); }                             // CFA */
     294 /* resume                      { KEYWORD_RETURN(RESUME); }                             // CFA */
    295295short                   { KEYWORD_RETURN(SHORT); }
    296296signed                  { KEYWORD_RETURN(SIGNED); }
  • src/Parser/parser.yy

    raa5777c r25744d2  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu May 28 12:11:45 2020
    13 // Update Count     : 4500
     12// Last Modified On : Tue Oct  6 18:24:18 2020
     13// Update Count     : 4610
    1414//
    1515
     
    278278%token OTYPE FTYPE DTYPE TTYPE TRAIT                                    // CFA
    279279%token SIZEOF OFFSETOF
    280 // %token RESUME                                                                        // CFA
    281 %token SUSPEND                                                                  // CFA
     280// %token RESUME                                                                                        // CFA
     281%token SUSPEND                                                                                  // CFA
    282282%token ATTRIBUTE EXTENSION                                                              // GCC
    283283%token IF ELSE SWITCH CASE DEFAULT DO WHILE FOR BREAK CONTINUE GOTO RETURN
     
    329329%type<en> conditional_expression                constant_expression                     assignment_expression           assignment_expression_opt
    330330%type<en> comma_expression                              comma_expression_opt
    331 %type<en> argument_expression_list_opt          argument_expression                     default_initialize_opt
     331%type<en> argument_expression_list_opt  argument_expression                     default_initialize_opt
    332332%type<ifctl> if_control_expression
    333333%type<fctl> for_control_expression              for_control_expression_list
     
    370370%type<decl> assertion assertion_list assertion_list_opt
    371371
    372 %type<en>   bit_subrange_size_opt bit_subrange_size
     372%type<en> bit_subrange_size_opt bit_subrange_size
    373373
    374374%type<decl> basic_declaration_specifier basic_type_name basic_type_specifier direct_type indirect_type
     
    793793        | '(' aggregate_control '&' ')' cast_expression         // CFA
    794794                { $$ = new ExpressionNode( build_keyword_cast( $2, $5 ) ); }
    795                 // VIRTUAL cannot be opt because of look ahead issues
    796795        | '(' VIRTUAL ')' cast_expression                                       // CFA
    797796                { $$ = new ExpressionNode( new VirtualCastExpr( maybeMoveBuild< Expression >( $4 ), maybeMoveBuildType( nullptr ) ) ); }
     
    920919        | unary_expression assignment_operator assignment_expression
    921920                {
    922                         if ( $2 == OperKinds::AtAssn ) {
    923                                 SemanticError( yylloc, "C @= assignment is currently unimplemented." ); $$ = nullptr;
    924                         } else {
     921//                      if ( $2 == OperKinds::AtAssn ) {
     922//                              SemanticError( yylloc, "C @= assignment is currently unimplemented." ); $$ = nullptr;
     923//                      } else {
    925924                                $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) );
    926                         } // if
     925//                      } // if
    927926                }
    928927        | unary_expression '=' '{' initializer_list_opt comma_opt '}'
     
    16761675
    16771676typedef_expression:
    1678                 // GCC, naming expression type: typedef name = exp; gives a name to the type of an expression
     1677                // deprecated GCC, naming expression type: typedef name = exp; gives a name to the type of an expression
    16791678        TYPEDEF identifier '=' assignment_expression
    16801679                {
    1681                         // $$ = DeclarationNode::newName( 0 );                  // unimplemented
    1682                         SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr;
     1680                        SemanticError( yylloc, "Typedef expression is deprecated, use typeof(...) instead." ); $$ = nullptr;
    16831681                }
    16841682        | typedef_expression pop ',' push identifier '=' assignment_expression
    16851683                {
    1686                         // $$ = DeclarationNode::newName( 0 );                  // unimplemented
    1687                         SemanticError( yylloc, "Typedef expression is currently unimplemented." ); $$ = nullptr;
    1688                 }
    1689         ;
    1690 
    1691 //c_declaration:
    1692 //      declaring_list pop ';'
    1693 //      | typedef_declaration pop ';'
    1694 //      | typedef_expression pop ';'                                            // GCC, naming expression type
    1695 //      | sue_declaration_specifier pop ';'
    1696 //      ;
    1697 //
    1698 //declaring_list:
    1699 //              // A semantic check is required to ensure asm_name only appears on declarations with implicit or explicit static
    1700 //              // storage-class
    1701 //       declarator asm_name_opt initializer_opt
    1702 //              {
    1703 //                      typedefTable.addToEnclosingScope( IDENTIFIER );
    1704 //                      $$ = ( $2->addType( $1 ))->addAsmName( $3 )->addInitializer( $4 );
    1705 //              }
    1706 //      | declaring_list ',' attribute_list_opt declarator asm_name_opt initializer_opt
    1707 //              {
    1708 //                      typedefTable.addToEnclosingScope( IDENTIFIER );
    1709 //                      $$ = $1->appendList( $1->cloneBaseType( $4->addAsmName( $5 )->addInitializer( $6 ) ) );
    1710 //              }
    1711 //      ;
     1684                        SemanticError( yylloc, "Typedef expression is deprecated, use typeof(...) instead." ); $$ = nullptr;
     1685                }
     1686        ;
    17121687
    17131688c_declaration:
     
    17151690                { $$ = distAttr( $1, $2 ); }
    17161691        | typedef_declaration
    1717         | typedef_expression                                                            // GCC, naming expression type
     1692        | typedef_expression                                                            // deprecated GCC, naming expression type
    17181693        | sue_declaration_specifier
    17191694        ;
     
    20942069                { yyy = true; $$ = AggregateDecl::Union; }
    20952070        | EXCEPTION                                                                                     // CFA
    2096                 { yyy = true; $$ = AggregateDecl::Exception; }
     2071                // { yyy = true; $$ = AggregateDecl::Exception; }
     2072                { SemanticError( yylloc, "exception aggregate is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
    20972073        ;
    20982074
Note: See TracChangeset for help on using the changeset viewer.