Changes in / [6ea87486:bac5158]
- Location:
- src/Parser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/lex.ll
r6ea87486 rbac5158 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Jul 12 18:04:44201713 * Update Count : 5 3512 * Last Modified On : Sat Jul 15 08:31:47 2017 13 * Update Count : 541 14 14 */ 15 15 … … 125 125 op_unary {op_unary_only}|{op_unary_binary}|{op_unary_pre_post} 126 126 127 op_binary_only "/"|"%"|" ^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"&="|"|="|"^="|"<<="|">>="127 op_binary_only "/"|"%"|"\\"|"^"|"&"|"|"|"<"|">"|"="|"=="|"!="|"<<"|">>"|"<="|">="|"+="|"-="|"*="|"/="|"%="|"\\="|"&="|"|="|"^="|"<<="|">>=" 128 128 op_binary_over {op_unary_binary}|{op_binary_only} 129 129 // op_binary_not_over "?"|"->"|"."|"&&"|"||"|"@=" … … 136 136 137 137 %% 138 /* line directives */138 /* line directives */ 139 139 ^{h_white}*"#"{h_white}*[0-9]+{h_white}*["][^"\n]+["].*"\n" { 140 140 /* " stop highlighting */ … … 339 339 "/" { ASCIIOP_RETURN(); } 340 340 "%" { ASCIIOP_RETURN(); } 341 "\\" { ASCIIOP_RETURN(); } // CFA, exponentiation 341 342 "^" { ASCIIOP_RETURN(); } 342 343 "~" { ASCIIOP_RETURN(); } … … 364 365 "/=" { NAMEDOP_RETURN(DIVassign); } 365 366 "%=" { NAMEDOP_RETURN(MODassign); } 367 "\\=" { NAMEDOP_RETURN(MODassign); } // CFA, exponentiation 366 368 "&=" { NAMEDOP_RETURN(ANDassign); } 367 369 "|=" { NAMEDOP_RETURN(ORassign); } -
src/Parser/parser.yy
r6ea87486 rbac5158 9 9 // Author : Peter A. Buhr 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Jul 14 16:58:00201713 // Update Count : 24 3211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 15 09:46:26 2017 13 // Update Count : 2451 14 14 // 15 15 … … 168 168 %type<op> ptrref_operator unary_operator assignment_operator 169 169 %type<en> primary_expression postfix_expression unary_expression 170 %type<en> cast_expression multiplicative_expression additive_expression shift_expression 171 %type<en> relational_expression equality_expression AND_expression exclusive_OR_expression 172 %type<en> inclusive_OR_expression logical_AND_expression logical_OR_expression conditional_expression 173 %type<en> constant_expression assignment_expression assignment_expression_opt 170 %type<en> cast_expression exponential_expression multiplicative_expression additive_expression 171 %type<en> shift_expression relational_expression equality_expression 172 %type<en> AND_expression exclusive_OR_expression inclusive_OR_expression 173 %type<en> logical_AND_expression logical_OR_expression 174 %type<en> conditional_expression constant_expression assignment_expression assignment_expression_opt 174 175 %type<en> comma_expression comma_expression_opt 175 %type<en> argument_expression_list argument_expression assignment_opt176 %type<en> argument_expression_list argument_expression default_initialize_opt 176 177 %type<fctl> for_control_expression 177 178 %type<en> subrange … … 573 574 ; 574 575 576 exponential_expression: 577 cast_expression 578 | exponential_expression '\\' cast_expression 579 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mod, $1, $3 ) ); } 580 ; 581 575 582 multiplicative_expression: 576 cast_expression577 | multiplicative_expression '*' cast_expression583 exponential_expression 584 | multiplicative_expression '*' exponential_expression 578 585 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mul, $1, $3 ) ); } 579 | multiplicative_expression '/' cast_expression586 | multiplicative_expression '/' exponential_expression 580 587 { $$ = new ExpressionNode( build_binary_val( OperKinds::Div, $1, $3 ) ); } 581 | multiplicative_expression '%' cast_expression588 | multiplicative_expression '%' exponential_expression 582 589 { $$ = new ExpressionNode( build_binary_val( OperKinds::Mod, $1, $3 ) ); } 583 590 ; … … 972 979 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); } 973 980 974 | handler_key '(' push push exception_declaration pop ')' compound_statement pop 975 { $$ = new StatementNode( build_catch( $1, $5, nullptr, $8 ) ); } 976 | handler_clause handler_key '(' push push exception_declaration pop ')' compound_statement pop 977 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $9 ) ) ); } 981 | handler_key '(' push push exception_declaration handler_predicate_opt pop ')' compound_statement pop 982 { $$ = new StatementNode( build_catch( $1, $5, nullptr, $9 ) ); } 983 | handler_clause handler_key '(' push push exception_declaration handler_predicate_opt pop ')' compound_statement pop 984 { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( $2, $6, nullptr, $10 ) ) ); } 985 ; 986 987 handler_predicate_opt: 988 //empty 989 | ':' conditional_expression 978 990 ; 979 991 … … 1869 1881 cfa_parameter_declaration: // CFA, new & old style parameter declaration 1870 1882 parameter_declaration 1871 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name assignment_opt1883 | cfa_identifier_parameter_declarator_no_tuple identifier_or_type_name default_initialize_opt 1872 1884 { $$ = $1->addName( $2 ); } 1873 | cfa_abstract_tuple identifier_or_type_name assignment_opt1885 | cfa_abstract_tuple identifier_or_type_name default_initialize_opt 1874 1886 // To obtain LR(1), these rules must be duplicated here (see cfa_abstract_declarator). 1875 1887 { $$ = $1->addName( $2 ); } 1876 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name assignment_opt1888 | type_qualifier_list cfa_abstract_tuple identifier_or_type_name default_initialize_opt 1877 1889 { $$ = $2->addName( $3 )->addQualifiers( $1 ); } 1878 1890 | cfa_function_specifier … … 1891 1903 parameter_declaration: 1892 1904 // No SUE declaration in parameter list. 1893 declaration_specifier_nobody identifier_parameter_declarator assignment_opt1905 declaration_specifier_nobody identifier_parameter_declarator default_initialize_opt 1894 1906 { 1895 1907 typedefTable.addToEnclosingScope( TypedefTable::ID ); 1896 1908 $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); 1897 1909 } 1898 | declaration_specifier_nobody type_parameter_redeclarator assignment_opt1910 | declaration_specifier_nobody type_parameter_redeclarator default_initialize_opt 1899 1911 { 1900 1912 typedefTable.addToEnclosingScope( TypedefTable::ID ); … … 1904 1916 1905 1917 abstract_parameter_declaration: 1906 declaration_specifier_nobody assignment_opt1918 declaration_specifier_nobody default_initialize_opt 1907 1919 { $$ = $1->addInitializer( $2 ? new InitializerNode( $2 ) : nullptr ); } 1908 | declaration_specifier_nobody abstract_parameter_declarator assignment_opt1920 | declaration_specifier_nobody abstract_parameter_declarator default_initialize_opt 1909 1921 { $$ = $2->addType( $1 )->addInitializer( $3 ? new InitializerNode( $3 ) : nullptr ); } 1910 1922 ; … … 3069 3081 ; 3070 3082 3071 assignment_opt:3083 default_initialize_opt: 3072 3084 // empty 3073 3085 { $$ = nullptr; }
Note:
See TracChangeset
for help on using the changeset viewer.