Changes in src/Parser/parser.yy [44a81853:8f60f0b]
- File:
-
- 1 edited
-
src/Parser/parser.yy (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/parser.yy
r44a81853 r8f60f0b 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 18 15:51:25 201713 // Update Count : 2 13512 // Last Modified On : Wed Dec 14 21:28:22 2016 13 // Update Count : 2090 14 14 // 15 15 … … 32 32 // 33 33 // 1. designation with and without '=' (use ':' instead) 34 // 2. attributes not allowed in parenthesis of declarator 34 35 // 35 36 // All of the syntactic extensions for GCC C are marked with the comment "GCC". The second extensions are for Cforall … … 135 136 136 137 %type<tok> identifier no_01_identifier no_attr_identifier zero_one 137 %type<tok> identifier_or_type_name no_attr_identifier_or_type_name no_01_identifier_or_type_name attr_name138 %type<tok> identifier_or_type_name no_attr_identifier_or_type_name no_01_identifier_or_type_name 138 139 %type<constant> string_literal 139 140 %type<str> string_literal_list … … 252 253 %type<decl> variable_abstract_ptr variable_array variable_declarator variable_function variable_ptr 253 254 254 %type<decl> attribute_list_opt attribute_list attribute _name_list attribute attribute_name255 %type<decl> attribute_list_opt attribute_list attribute 255 256 256 257 // initializers … … 708 709 709 710 labeled_statement: 710 // labels cannot be identifiers 0 or 1 or ATTR_IDENTIFIER711 identifier_or_type_name':' attribute_list_opt statement712 { 713 $$ = $4->add_label( $1 , $3);711 // labels cannot be identifiers 0 or 1 712 IDENTIFIER ':' attribute_list_opt statement 713 { 714 $$ = $4->add_label( $1 ); 714 715 } 715 716 ; … … 876 877 877 878 jump_statement: 878 GOTO identifier_or_type_name';'879 GOTO IDENTIFIER ';' 879 880 { $$ = new StatementNode( build_branch( $2, BranchStmt::Goto ) ); } 880 881 | GOTO '*' comma_expression ';' // GCC, computed goto … … 885 886 // A semantic check is required to ensure this statement appears only in the body of an iteration statement. 886 887 { $$ = new StatementNode( build_branch( BranchStmt::Continue ) ); } 887 | CONTINUE identifier_or_type_name ';'// CFA, multi-level continue888 | CONTINUE IDENTIFIER ';' // CFA, multi-level continue 888 889 // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and 889 890 // the target of the transfer appears only at the start of an iteration statement. … … 892 893 // A semantic check is required to ensure this statement appears only in the body of an iteration statement. 893 894 { $$ = new StatementNode( build_branch( BranchStmt::Break ) ); } 894 | BREAK identifier_or_type_name ';'// CFA, multi-level exit895 | BREAK IDENTIFIER ';' // CFA, multi-level exit 895 896 // A semantic check is required to ensure this statement appears only in the body of an iteration statement, and 896 897 // the target of the transfer appears only at the start of an iteration statement. … … 1325 1326 type_qualifier_name 1326 1327 | attribute 1328 //{ $$ = DeclarationNode::newQualifier( DeclarationNode::Attribute ); } 1327 1329 ; 1328 1330 … … 2175 2177 2176 2178 attribute: // GCC 2177 ATTRIBUTE '(' '(' attribute_ name_list ')' ')'2178 { $$ = $4; }2179 ;2180 2181 attribute_name_list: // GCC 2182 attribute_name 2183 | attribute_name_list ',' attribute_name2184 { $$ = $1->addQualifiers( $3 ); }2185 ; 2186 2187 attrib ute_name:// GCC2179 ATTRIBUTE '(' '(' attribute_parameter_list ')' ')' 2180 // { $$ = DeclarationNode::newQualifier( DeclarationNode::Attribute ); } 2181 { $$ = nullptr; } 2182 ; 2183 2184 attribute_parameter_list: // GCC 2185 attrib 2186 | attribute_parameter_list ',' attrib 2187 ; 2188 2189 attrib: // GCC 2188 2190 // empty 2189 { $$ = nullptr; } 2190 | attr_name 2191 { $$ = DeclarationNode::newAttribute( $1 ); } 2192 | attr_name '(' argument_expression_list ')' 2193 { $$ = DeclarationNode::newAttribute( $1, $3 ); } 2194 ; 2195 2196 attr_name: // GCC 2197 IDENTIFIER 2198 | TYPEDEFname 2199 | TYPEGENname 2200 | CONST 2201 { $$ = Token{ new string( "__const__" ) }; } 2191 | any_word 2192 | any_word '(' comma_expression_opt ')' { delete $3; } // FIX ME: unimplemented 2193 ; 2194 2195 any_word: // GCC 2196 identifier_or_type_name { delete $1; } // FIX ME: unimplemented 2197 | storage_class { delete $1; } // FIX ME: unimplemented 2198 | basic_type_name { delete $1; } // FIX ME: unimplemented 2199 | type_qualifier { delete $1; } // FIX ME: unimplemented 2202 2200 ; 2203 2201
Note:
See TracChangeset
for help on using the changeset viewer.