Changeset aac37fa


Ignore:
Timestamp:
Feb 12, 2022, 1:51:52 PM (2 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
c655650
Parents:
5910fc0
Message:

remove SemanticError? for "else" extension, support extern "..." for single declaration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r5910fc0 raac37fa  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  1 11:06:13 2022
    13 // Update Count     : 5167
     12// Last Modified On : Fri Feb 11 14:26:15 2022
     13// Update Count     : 5174
    1414//
    1515
     
    11971197                { $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ) ) ); }
    11981198        | WHILE '(' conditional_declaration ')' statement ELSE statement // CFA
    1199                 // { SemanticError( yylloc, "Loop default block is currently unimplemented." ); $$ = nullptr; }
    12001199                { $$ = new StatementNode( build_while( $3, maybe_build_compound( $5 ), $7 ) ); }
    12011200        | DO statement WHILE '(' ')' ';'                                        // CFA => do while( 1 )
     
    12041203                { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ) ) ); }
    12051204        | DO statement WHILE '(' comma_expression ')' ELSE statement // CFA
    1206                 // { SemanticError( yylloc, "Loop default block is currently unimplemented." ); $$ = nullptr; }
    12071205                { $$ = new StatementNode( build_do_while( $5, maybe_build_compound( $2 ), $8 ) ); }
    12081206        | FOR '(' ')' statement                                                         // CFA => for ( ;; )
     
    12111209                { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ) ) ); }
    12121210        | FOR '(' for_control_expression_list ')' statement ELSE statement // CFA
    1213                 // { SemanticError( yylloc, "Loop default block is currently unimplemented." ); $$ = nullptr; }
    12141211                { $$ = new StatementNode( build_for( $3, maybe_build_compound( $5 ), $7 ) ); }
    12151212        ;
     
    27292726        | ASM '(' string_literal ')' ';'                                        // GCC, global assembler statement
    27302727                { $$ = DeclarationNode::newAsmStmt( new StatementNode( build_asm( false, $3, 0 ) ) ); }
     2728        | EXTERN STRINGliteral
     2729                {
     2730                        linkageStack.push( linkage );                           // handle nested extern "C"/"Cforall"
     2731                        linkage = LinkageSpec::update( yylloc, linkage, $2 );
     2732                }
     2733          up external_definition down
     2734                {
     2735                        linkage = linkageStack.top();
     2736                        linkageStack.pop();
     2737                        $$ = $5;
     2738                }
    27312739        | EXTERN STRINGliteral                                                          // C++-style linkage specifier
    27322740                {
Note: See TracChangeset for help on using the changeset viewer.