Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    ra491a3c r0a6d8204  
    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 : Mon Apr 27 12:25:42 2020
     13// Update Count     : 4483
    1414//
    1515
     
    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              argument_expression                     default_initialize_opt
    332332%type<ifctl> if_control_expression
    333333%type<fctl> for_control_expression              for_control_expression_list
     
    624624                // equivalent to the old x[i,j].
    625625                { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, $3 ) ); }
    626         | postfix_expression '{' argument_expression_list_opt '}' // CFA, constructor call
     626        | postfix_expression '{' argument_expression_list '}' // CFA, constructor call
    627627                {
    628628                        Token fn;
     
    630630                        $$ = new ExpressionNode( new ConstructorExpr( build_func( new ExpressionNode( build_varref( fn ) ), (ExpressionNode *)( $1 )->set_last( $3 ) ) ) );
    631631                }
    632         | postfix_expression '(' argument_expression_list_opt ')'
     632        | postfix_expression '(' argument_expression_list ')'
    633633                { $$ = new ExpressionNode( build_func( $1, $3 ) ); }
    634634        | postfix_expression '`' identifier                                     // CFA, postfix call
     
    662662        | '(' type_no_function ')' '@' '{' initializer_list_opt comma_opt '}' // CFA, explicit C compound-literal
    663663                { $$ = new ExpressionNode( build_compoundLiteral( $2, (new InitializerNode( $6, true ))->set_maybeConstructed( false ) ) ); }
    664         | '^' primary_expression '{' argument_expression_list_opt '}' // CFA, destructor call
     664        | '^' primary_expression '{' argument_expression_list '}' // CFA, destructor call
    665665                {
    666666                        Token fn;
     
    670670        ;
    671671
    672 argument_expression_list_opt:
     672argument_expression_list:
    673673        // empty
    674674                { $$ = nullptr; }
    675675        | argument_expression
    676         | argument_expression_list_opt ',' argument_expression
     676        | argument_expression_list ',' argument_expression
    677677                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    678678        ;
     
    11961196                { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
    11971197                                                OperKinds::LThan, $1->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
    1198         | '=' comma_expression                                                          // CFA
     1198        | '=' comma_expression                                                                  // CFA
    11991199                { $$ = forCtrl( $2, new string( DeclarationNode::anonymous.newName() ), new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
    12001200                                                OperKinds::LEThan, $2->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
     
    12031203        | comma_expression inclexcl comma_expression '~' comma_expression // CFA
    12041204                { $$ = forCtrl( $1, new string( DeclarationNode::anonymous.newName() ), $1->clone(), $2, $3, $5 ); }
    1205         | comma_expression ';'                                                          // CFA
    1206                 { $$ = forCtrl( new ExpressionNode( build_constantInteger( *new string( "0u" ) ) ), $1, nullptr, OperKinds::LThan, nullptr, nullptr ); }
    12071205        | comma_expression ';' comma_expression                         // CFA
    12081206                { $$ = forCtrl( $3, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
    12091207                                                OperKinds::LThan, $3->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
    1210         | comma_expression ';' '=' comma_expression                     // CFA
     1208        | comma_expression ';' '=' comma_expression                             // CFA
    12111209                { $$ = forCtrl( $4, $1, new ExpressionNode( build_constantInteger( *new string( "0" ) ) ),
    12121210                                                OperKinds::LEThan, $4->clone(), new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ); }
     
    13061304// If MUTEX becomes a general qualifier, there are shift/reduce conflicts, so change syntax to "with mutex".
    13071305mutex_statement:
    1308         MUTEX '(' argument_expression_list_opt ')' statement
     1306        MUTEX '(' argument_expression_list ')' statement
    13091307                { SemanticError( yylloc, "Mutex statement is currently unimplemented." ); $$ = nullptr; }
    13101308        ;
     
    13231321        WAITFOR '(' cast_expression ')'
    13241322                { $$ = $3; }
    1325 //      | WAITFOR '(' cast_expression ',' argument_expression_list_opt ')'
     1323//      | WAITFOR '(' cast_expression ',' argument_expression_list ')'
    13261324//              { $$ = (ExpressionNode *)$3->set_last( $5 ); }
    1327         | WAITFOR '(' cast_expression_list ':' argument_expression_list_opt ')'
     1325        | WAITFOR '(' cast_expression_list ':' argument_expression_list ')'
    13281326                { $$ = (ExpressionNode *)($3->set_last( $5 )); }
    13291327        ;
     
    13321330        cast_expression
    13331331        | cast_expression_list ',' cast_expression
    1334                 // { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    1335                 { SemanticError( yylloc, "List of mutex member is currently unimplemented." ); $$ = nullptr; }
     1332                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
    13361333        ;
    13371334
     
    20982095
    20992096aggregate_control:                                                                              // CFA
    2100         MONITOR
    2101                 { yyy = true; $$ = AggregateDecl::Monitor; }
    2102         | MUTEX STRUCT
    2103                 { yyy = true; $$ = AggregateDecl::Monitor; }
    2104         | GENERATOR
     2097        GENERATOR
    21052098                { yyy = true; $$ = AggregateDecl::Generator; }
    2106         | MUTEX GENERATOR
     2099        | MONITOR GENERATOR
    21072100                { SemanticError( yylloc, "monitor generator is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
    21082101        | COROUTINE
    21092102                { yyy = true; $$ = AggregateDecl::Coroutine; }
    2110         | MUTEX COROUTINE
     2103        | MONITOR
     2104                { yyy = true; $$ = AggregateDecl::Monitor; }
     2105        | MONITOR COROUTINE
    21112106                { SemanticError( yylloc, "monitor coroutine is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
    21122107        | THREAD
    21132108                { yyy = true; $$ = AggregateDecl::Thread; }
    2114         | MUTEX THREAD
     2109        | MONITOR THREAD
    21152110                { SemanticError( yylloc, "monitor thread is currently unimplemented." ); $$ = AggregateDecl::NoAggregate; }
    21162111        ;
     
    27792774        | attr_name
    27802775                { $$ = DeclarationNode::newAttribute( $1 ); }
    2781         | attr_name '(' argument_expression_list_opt ')'
     2776        | attr_name '(' argument_expression_list ')'
    27822777                { $$ = DeclarationNode::newAttribute( $1, $3 ); }
    27832778        ;
Note: See TracChangeset for help on using the changeset viewer.