| 1 | // | |
| 2 | // A3. Main. | |
| 3 | // | |
| 4 | // C++ 2003 Grammar. Standard ISO/IEC 14882. | |
| 5 | // | |
| 6 | ||
| 7 | #include "A00_TerminalSymbols.GRA" | |
| 8 | ||
| 9 | <axioma> translation_unit; | |
| 10 | ||
| 11 | <rules> | |
| 12 | ||
| 13 | 4000 | translation_unit |
| 14 | R0 | : declaration_seq |
| 15 | ; | |
| 16 | ||
| 17 | 4001 | literal |
| 18 | R1 | : number | charconst | string |
| 19 | R4 | : TRUE | FALSE |
| 20 | ; | |
| 21 | ||
| 22 | #include "A04_Expressions.GRA" | |
| 23 | #include "A05_Statements.GRA" | |
| 24 | #include "A06_Declarations.GRA" | |
| 25 | #include "A07_Declarators.GRA" | |
| 26 | #include "A08_Classes.GRA" | |
| 27 | #include "A09_DerivedClasses.GRA" | |
| 28 | #include "A10_SpecialMemberFunctions.GRA" | |
| 29 | #include "A11_Overloading.GRA" | |
| 30 | #include "A12_Templates.GRA" | |
| 31 | #include "A13_ExceptionHandling.GRA" | |
| 32 | ||
| 33 |
| 1 | // | |
| 2 | // Terminal symbols and grammar info. | |
| 3 | // | |
| 4 | // C++ 2003 Grammar. Standard ISO/IEC 14882. | |
| 5 | // | |
| 6 | ||
| 7 | <langtype> | |
| 8 |
| 9 | Cpp, | // Target language type. | |
| 10 | "TCppStandard", | // Name of the preprocessor callbacks handler. | |
| 11 | "Cpp_Stnd"; | // Preferred prefix for emitting cxx tables. |
| 12 | ||
| 13 | <description> "Cpp Standard ISO/IEC 14882."; | |
| 14 | ||
| 15 | <symbols> |
| 16 | ||||
| 17 | 1 | number: | ltx_number; | |
| 18 | 2 | charconst: | ltx_charconst; | |
| 19 | 3 | string: | ltx_string; | |
| 20 | 4 | identifier: | ltx_name; | |
| 21 | ||||
| 22 | // TSeparToken | |||
| 23 | 5 | '{': | ltx_keyword | spr_lcurvbr; |
| 24 | 6 | '}': | ltx_keyword | spr_rcurvbr; |
| 25 | 7 | ';': | ltx_keyword | spr_semicol; |
| 26 | 8 | '...': | ltx_keyword | spr_ellipsis; |
| 27 | ||||
| 28 | // TArifmToken | |||
| 29 | 9 | ',': | ltx_keyword | opr_comma; |
| 30 | 10 | '(': | ltx_keyword | opr_lpar; |
| 31 | 11 | ')': | ltx_keyword | opr_rpar; |
| 32 | 12 | '!': | ltx_keyword | opr_bang; |
| 33 | 13 | '~': | ltx_keyword | opr_tilda; |
| 34 | ||||
| 35 | 14 | '*': | ltx_keyword | opr_mul; |
| 36 | 15 | '/': | ltx_keyword | opr_div; |
| 37 | 16 | '%': | ltx_keyword | opr_rmnd; |
| 38 | 17 | '+': | ltx_keyword | opr_plus; |
| 39 | 18 | '-': | ltx_keyword | opr_minus; |
| 40 | 19 | '<<': | ltx_keyword | opr_bitlsh; |
| 41 | 20 | '>>': | ltx_keyword | opr_bitrsh; |
| 42 | 21 | '&': | ltx_keyword | opr_bitand; |
| 43 | 22 | '|': | ltx_keyword | opr_bitor; |
| 44 | 23 | '^': | ltx_keyword | opr_bitxor; |
| 45 | ||||
| 46 | 24 | '<': | ltx_keyword | opr_lt; |
| 47 | 25 | '<=': | ltx_keyword | opr_le; |
| 48 | 26 | '>': | ltx_keyword | opr_gt; |
| 49 | 27 | '>=': | ltx_keyword | opr_ge; |
| 50 | 28 | '==': | ltx_keyword | opr_eq; |
| 51 | 29 | '!=': | ltx_keyword | opr_ne; |
| 52 | 30 | '&&': | ltx_keyword | opr_logand; |
| 53 | 31 | '||': | ltx_keyword | opr_logor; |
| 54 | 32 | '?': | ltx_keyword | opr_question; |
| 55 | 33 | ':': | ltx_keyword | opr_colon; |
| 56 | ||||
| 57 | 34 | '::': | ltx_keyword | opr_dblcolon; |
| 58 | 35 | '.': | ltx_keyword | opr_dot; |
| 59 | 36 | '->': | ltx_keyword | opr_arrow; |
| 60 | 37 | '.*': | ltx_keyword | opr_dotstar; |
| 61 | 38 | '->*': | ltx_keyword | opr_arrowstar; |
| 62 | 39 | '[': | ltx_keyword | opr_lbracket; |
| 63 | 40 | ']': | ltx_keyword | opr_rbracket; |
| 64 | 41 | '++': | ltx_keyword | opr_plusplus; |
| 65 | 42 | '--': | ltx_keyword | opr_minusminus; |
| 66 | ||||
| 67 | 43 | SIZEOF: | ltx_keyword | opr_sizeof; |
| 68 | 44 | NEW: | ltx_keyword | opr_new; |
| 69 | 45 | DELETE: | ltx_keyword | opr_delete; |
| 70 | ||||
| 71 | 46 | THROW: | ltx_keyword | opr_throw; |
| 72 | 47 | TYPEID: | ltx_keyword | opr_typeid; |
| 73 | 48 | CONST_CAST: | ltx_keyword | opr_const_cast; |
| 74 | 49 | DYNA_CAST: | ltx_keyword | opr_dyna_cast; |
| 75 | 50 | REIN_CAST: | ltx_keyword | opr_rein_cast; |
| 76 | 51 | STATIC_CAST: | ltx_keyword | opr_static_cast; |
| 77 | ||||
| 78 | 52 | '=': | ltx_keyword | opr_assign; |
| 79 | 53 | '*=': | ltx_keyword | opr_mul_asgn; |
| 80 | 54 | '/=': | ltx_keyword | opr_div_asgn; |
| 81 | 55 | '%=': | ltx_keyword | opr_rmnd_asgn; |
| 82 | 56 | '+=': | ltx_keyword | opr_plus_asgn; |
| 83 | 57 | '-=': | ltx_keyword | opr_minus_asgn; |
| 84 | 58 | '<<=': | ltx_keyword | opr_lsh_asgn; |
| 85 | 59 | '>>=': | ltx_keyword | opr_rsh_asgn; |
| 86 | 60 | '&=': | ltx_keyword | opr_btand_asgn; |
| 87 | 61 | '|=': | ltx_keyword | opr_btor_asgn; |
| 88 | 62 | '^=': | ltx_keyword | opr_btxor_asgn; |
| 89 | ||||
| 90 | // TCLangToken | |||
| 91 | 63 | ASM: | ltx_keyword | clg_asm; |
| 92 | 64 | AUTO: | ltx_keyword | clg_auto; |
| 93 | 65 | BREAK: | ltx_keyword | clg_break; |
| 94 | 66 | CASE: | ltx_keyword | clg_case; |
| 95 | 67 | CATCH: | ltx_keyword | clg_catch; |
| 96 | 68 | CHAR: | ltx_keyword | clg_char; |
| 97 | 69 | CONST: | ltx_keyword | clg_const; |
| 98 | 70 | CONTINUE: | ltx_keyword | clg_continue; |
| 99 | 71 | DEFAULT: | ltx_keyword | clg_default; |
| 100 | 72 | DO: | ltx_keyword | clg_do; |
| 101 | 73 | DOUBLE: | ltx_keyword | clg_double; |
| 102 | 74 | ELSE: | ltx_keyword | clg_else; |
| 103 | 75 | ENUM: | ltx_keyword | clg_enum; |
| 104 | 76 | EXTERN: | ltx_keyword | clg_extern; |
| 105 | 77 | FLOAT: | ltx_keyword | clg_float; |
| 106 | 78 | FOR: | ltx_keyword | clg_for; |
| 107 | 79 | GOTO: | ltx_keyword | clg_goto; |
| 108 | 80 | IF: | ltx_keyword | clg_if; |
| 109 | 81 | INT: | ltx_keyword | clg_int; |
| 110 | 82 | LONG: | ltx_keyword | clg_long; |
| 111 | 83 | REGISTER: | ltx_keyword | clg_register; |
| 112 | 84 | RETURN: | ltx_keyword | clg_return; |
| 113 | 85 | SHORT: | ltx_keyword | clg_short; |
| 114 | 86 | SIGNED: | ltx_keyword | clg_signed; |
| 115 | 87 | STATIC: | ltx_keyword | clg_static; |
| 116 | 88 | STRUCT: | ltx_keyword | clg_struct; |
| 117 | 89 | SWITCH: | ltx_keyword | clg_switch; |
| 118 | 90 | TRY: | ltx_keyword | clg_try; |
| 119 | 91 | TYPEDEF: | ltx_keyword | clg_typedef; |
| 120 | 92 | UNION: | ltx_keyword | clg_union; |
| 121 | 93 | UNSIGNED: | ltx_keyword | clg_unsigned; |
| 122 | 94 | VOID: | ltx_keyword | clg_void; |
| 123 | 95 | VOLATILE: | ltx_keyword | clg_volatile; |
| 124 | 96 | WCHAR: | ltx_keyword | clg_wchar_t; |
| 125 | 97 | WHILE: | ltx_keyword | clg_while; |
| 126 | ||||
| 127 | // TCppToken | |||
| 128 | 98 | BOOL: | ltx_keyword | cpp_bool; |
| 129 | 99 | CLASS: | ltx_keyword | cpp_class; |
| 130 | 100 | EXPLICIT: | ltx_keyword | cpp_explicit; |
| 131 | 101 | EXPORT: | ltx_keyword | cpp_export; |
| 132 | 102 | FALSE: | ltx_keyword | cpp_false; |
| 133 | 103 | FRIEND: | ltx_keyword | cpp_friend; |
| 134 | 104 | INLINE: | ltx_keyword | cpp_inline; |
| 135 | 105 | MUTABLE: | ltx_keyword | cpp_mutable; |
| 136 | 106 | NAMESPACE: | ltx_keyword | cpp_namespace; |
| 137 | 107 | OPERATOR: | ltx_keyword | cpp_operator; |
| 138 | 108 | PRIVATE: | ltx_keyword | cpp_private; |
| 139 | 109 | PROTECTED: | ltx_keyword | cpp_protected; |
| 140 | 110 | PUBLIC: | ltx_keyword | cpp_public; |
| 141 | 111 | TEMPLATE: | ltx_keyword | cpp_template; |
| 142 | 112 | THIS: | ltx_keyword | cpp_this; |
| 143 | 113 | TRUE: | ltx_keyword | cpp_true; |
| 144 | 114 | TYPENAME: | ltx_keyword | cpp_typename; |
| 145 | 115 | USING: | ltx_keyword | cpp_using; |
| 146 | 116 | VIRTUAL: | ltx_keyword | cpp_virtual; |
| 147 | ||||
| 148 | <ignore> | |
| 149 | ||
| 150 | ltx_comment; | |
| 151 | ltx_eol; | |
| 152 |
| 1 | // | |
| 2 | // A4. Expressions. | |
| 3 | // | |
| 4 | ||
| 5 | 4002 | primary_expression |
| 6 | R6 | : literal |
| 7 | R7 | : THIS |
| 8 | R8 | : '(' expression ')' |
| 9 | R9 | : id_expression |
| 10 | ; | |
| 11 | ||
| 12 | 4003 | id_expression |
| 13 | R10 | : unqualified_id |
| 14 | R11 | : qualified_id |
| 15 | ; | |
| 16 | ||
| 17 | 4004 | unqualified_id |
| 18 | R12 | : identifier |
| 19 | R13 | : operator_function_id |
| 20 | R14 | : conversion_function_id |
| 21 | R15 | : '~' class_name |
| 22 | R16 | : template_id |
| 23 | ; | |
| 24 | ||
| 25 | 4005 | qualified_id |
| 26 | R17 | : nested_name_specifier unqualified_id |
| 27 | R18 | : nested_name_specifier TEMPLATE unqualified_id |
| 28 | R19 | : '::' nested_name_specifier unqualified_id |
| 29 | R20 | : '::' nested_name_specifier TEMPLATE unqualified_id |
| 30 | /*+*/ | |
| 31 | R21 | : '::' identifier |
| 32 | R22 | : '::' operator_function_id |
| 33 | R23 | : '::' template_id |
| 34 | ; | |
| 35 | ||
| 36 | 4006 | nested_name_specifier |
| 37 | R24 | : class_or_namespace_name '::' |
| 38 | R25 | : class_or_namespace_name '::' nested_name_specifier |
| 39 | R26 | : class_or_namespace_name '::' TEMPLATE nested_name_specifier |
| 40 | ; | |
| 41 | ||
| 42 | 4007 | class_or_namespace_name |
| 43 | R27 | : class_name |
| 44 | R28 | : namespace_name |
| 45 | ; | |
| 46 | ||
| 47 | 4008 | postfix_expression |
| 48 | R29 | : primary_expression |
| 49 | R30 | : postfix_expression '[' expression ']' |
| 50 | R31 | : postfix_expression '(' ')' |
| 51 | R32 | : postfix_expression '(' expression_list ')' |
| 52 | R33 | : simple_type_specifier '(' ')' |
| 53 | R34 | : simple_type_specifier '(' expression_list ')' |
| 54 | /*+*/ | |
| 55 | R35 | : TYPENAME nested_name_specifier identifier '(' ')' |
| 56 | R36 | : TYPENAME nested_name_specifier identifier '(' expression_list ')' |
| 57 | R37 | : TYPENAME '::' nested_name_specifier identifier '(' ')' |
| 58 | R38 | : TYPENAME '::' nested_name_specifier identifier '(' expression_list ')' |
| 59 | /*+*/ | |
| 60 | R39 | : TYPENAME nested_name_specifier template_id '(' ')' |
| 61 | R40 | : TYPENAME nested_name_specifier template_id '(' expression_list ')' |
| 62 | R41 | : TYPENAME nested_name_specifier TEMPLATE template_id '(' ')' |
| 63 | R42 | : TYPENAME nested_name_specifier TEMPLATE template_id '(' expression_list ')' |
| 64 | R43 | : TYPENAME '::' nested_name_specifier template_id '(' ')' |
| 65 | R44 | : TYPENAME '::' nested_name_specifier template_id '(' expression_list ')' |
| 66 | R45 | : TYPENAME '::' nested_name_specifier TEMPLATE template_id '(' ')' |
| 67 | R46 | : TYPENAME '::' nested_name_specifier TEMPLATE template_id '(' expression_list ')' |
| 68 | /*+*/ | |
| 69 | R47 | : postfix_expression '.' id_expression |
| 70 | R48 | : postfix_expression '.' TEMPLATE id_expression |
| 71 | R49 | : postfix_expression '.' pseudo_destructor_name |
| 72 | R50 | : postfix_expression '->' id_expression |
| 73 | R51 | : postfix_expression '->' TEMPLATE id_expression |
| 74 | R52 | : postfix_expression '->' pseudo_destructor_name |
| 75 | /*+*/ | |
| 76 | R53 | : postfix_expression '++' |
| 77 | R54 | : postfix_expression '--' |
| 78 | /*+*/ | |
| 79 | R55 | : CONST_CAST '<' type_id '>' '(' expression ')' |
| 80 | R56 | : STATIC_CAST '<' type_id '>' '(' expression ')' |
| 81 | R57 | : DYNA_CAST '<' type_id '>' '(' expression ')' |
| 82 | R58 | : REIN_CAST '<' type_id '>' '(' expression ')' |
| 83 | /*+*/ | |
| 84 | R59 | : TYPEID '(' expression ')' |
| 85 | R60 | : TYPEID '(' type_id ')' |
| 86 | ; | |
| 87 | ||
| 88 | 4009 | expression_list |
| 89 | R61 | : assignment_expression |
| 90 | R62 | : expression_list ',' assignment_expression |
| 91 | ; | |
| 92 | ||
| 93 | 4010 | pseudo_destructor_name |
| 94 | R63 | : '~' type_name |
| 95 | R64 | : type_name '::' '~' type_name |
| 96 | R65 | : nested_name_specifier '~' type_name |
| 97 | R66 | : nested_name_specifier type_name '::' '~' type_name |
| 98 | R67 | : '::' '~' type_name |
| 99 | R68 | : '::' type_name '::' '~' type_name |
| 100 | R69 | : '::' nested_name_specifier '~' type_name |
| 101 | R70 | : '::' nested_name_specifier type_name '::' '~' type_name |
| 102 | /*+*/ | |
| 103 | R71 | : nested_name_specifier TEMPLATE template_id '::' '~' type_name |
| 104 | R72 | : '::' nested_name_specifier TEMPLATE template_id '::' '~' type_name |
| 105 | ; | |
| 106 | ||
| 107 | 4011 | unary_expression |
| 108 | R73 | : postfix_expression |
| 109 | R74 | : '++' cast_expression |
| 110 | R75 | : '--' cast_expression |
| 111 | R76 | : unary_operator cast_expression |
| 112 | R77 | : SIZEOF unary_expression |
| 113 | R78 | : SIZEOF '(' type_id ')' |
| 114 | R79 | : new_expression |
| 115 | R80 | : delete_expression |
| 116 | ; | |
| 117 | ||
| 118 | 4012 | unary_operator |
| 119 | R81 | : '*' | '&' | '+' | '-' | '!' | '~' |
| 120 | ; | |
| 121 | ||
| 122 | 4013 | new_expression |
| 123 | R87 | : NEW new_type_id |
| 124 | R88 | : NEW new_type_id new_initializer |
| 125 | R89 | : NEW new_placement new_type_id |
| 126 | R90 | : NEW new_placement new_type_id new_initializer |
| 127 | R91 | : '::' NEW new_type_id |
| 128 | R92 | : '::' NEW new_type_id new_initializer |
| 129 | R93 | : '::' NEW new_placement new_type_id |
| 130 | R94 | : '::' NEW new_placement new_type_id new_initializer |
| 131 | /*+*/ | |
| 132 | R95 | : NEW '(' type_id ')' |
| 133 | R96 | : NEW '(' type_id ')' new_initializer |
| 134 | R97 | : NEW new_placement '(' type_id ')' |
| 135 | R98 | : NEW new_placement '(' type_id ')' new_initializer |
| 136 | R99 | : '::' NEW '(' type_id ')' |
| 137 | R100 | : '::' NEW '(' type_id ')' new_initializer |
| 138 | R101 | : '::' NEW new_placement '(' type_id ')' |
| 139 | R102 | : '::' NEW new_placement '(' type_id ')' new_initializer |
| 140 | ; | |
| 141 | ||
| 142 | 4014 | new_placement |
| 143 | R103 | : '(' expression_list ')' |
| 144 | ; | |
| 145 | ||
| 146 | 4015 | new_type_id |
| 147 | R104 | : type_specifier_seq |
| 148 | R105 | : type_specifier_seq new_declarator |
| 149 | ; | |
| 150 | ||
| 151 | 4016 | new_declarator |
| 152 | R106 | : direct_new_declarator |
| 153 | R107 | : ptr_operator |
| 154 | R108 | : ptr_operator new_declarator |
| 155 | ; | |
| 156 | ||
| 157 | 4017 | direct_new_declarator |
| 158 | R109 | : '[' expression ']' |
| 159 | R110 | : direct_new_declarator '[' constant_expression ']' |
| 160 | ; | |
| 161 | ||
| 162 | 4018 | new_initializer |
| 163 | R111 | : '(' ')' |
| 164 | R112 | : '(' expression_list ')' |
| 165 | ; | |
| 166 | ||
| 167 | 4019 | delete_expression |
| 168 | R113 | : DELETE cast_expression |
| 169 | R114 | : DELETE '[' ']' cast_expression |
| 170 | R115 | : '::' DELETE cast_expression |
| 171 | R116 | : '::' DELETE '[' ']' cast_expression |
| 172 | ; | |
| 173 | ||
| 174 | 4020 | cast_expression |
| 175 | R117 | : unary_expression |
| 176 | R118 | : '(' type_id ')' cast_expression |
| 177 | ; | |
| 178 | ||
| 179 | 4021 | pm_expression |
| 180 | R119 | : cast_expression |
| 181 | R120 | : pm_expression '.*' cast_expression |
| 182 | R121 | : pm_expression '->*' cast_expression |
| 183 | ; | |
| 184 | ||
| 185 | 4022 | multiplicative_expression |
| 186 | R122 | : pm_expression |
| 187 | R123 | : multiplicative_expression '*' pm_expression |
| 188 | R124 | : multiplicative_expression '/' pm_expression |
| 189 | R125 | : multiplicative_expression '%' pm_expression |
| 190 | ; | |
| 191 | ||
| 192 | 4023 | additive_expression |
| 193 | R126 | : multiplicative_expression |
| 194 | R127 | : additive_expression '+' multiplicative_expression |
| 195 | R128 | : additive_expression '-' multiplicative_expression |
| 196 | ; | |
| 197 | ||
| 198 | 4024 | shift_expression |
| 199 | R129 | : additive_expression |
| 200 | R130 | : shift_expression '<<' additive_expression |
| 201 | R131 | : shift_expression '>>' additive_expression |
| 202 | ; | |
| 203 | ||
| 204 | 4025 | relational_expression |
| 205 | R132 | : shift_expression |
| 206 | R133 | : relational_expression '<' shift_expression |
| 207 | R134 | : relational_expression '>' shift_expression |
| 208 | R135 | : relational_expression '<=' shift_expression |
| 209 | R136 | : relational_expression '>=' shift_expression |
| 210 | ; | |
| 211 | ||
| 212 | 4026 | equality_expression |
| 213 | R137 | : relational_expression |
| 214 | R138 | : equality_expression '==' relational_expression |
| 215 | R139 | : equality_expression '!=' relational_expression |
| 216 | ; | |
| 217 | ||
| 218 | 4027 | and_expression |
| 219 | R140 | : equality_expression |
| 220 | R141 | : and_expression '&' equality_expression |
| 221 | ; | |
| 222 | ||
| 223 | 4028 | exclusive_or_expression |
| 224 | R142 | : and_expression |
| 225 | R143 | : exclusive_or_expression '^' and_expression |
| 226 | ; | |
| 227 | ||
| 228 | 4029 | inclusive_or_expression |
| 229 | R144 | : exclusive_or_expression |
| 230 | R145 | : inclusive_or_expression '|' exclusive_or_expression |
| 231 | ; | |
| 232 | ||
| 233 | 4030 | logical_and_expression |
| 234 | R146 | : inclusive_or_expression |
| 235 | R147 | : logical_and_expression '&&' inclusive_or_expression |
| 236 | ; | |
| 237 | ||
| 238 | 4031 | logical_or_expression |
| 239 | R148 | : logical_and_expression |
| 240 | R149 | : logical_or_expression '||' logical_and_expression |
| 241 | ; | |
| 242 | ||
| 243 | 4032 | conditional_expression |
| 244 | R150 | : logical_or_expression |
| 245 | R151 | : logical_or_expression '?' expression ':' assignment_expression |
| 246 | ; | |
| 247 | ||
| 248 | 4033 | assignment_expression |
| 249 | R152 | : conditional_expression |
| 250 | R153 | : logical_or_expression assignment_operator assignment_expression |
| 251 | R154 | : throw_expression |
| 252 | ; | |
| 253 | ||
| 254 | 4034 | assignment_operator |
| 255 | R155 | : '=' | '+=' | '-=' | '*=' | '/=' | '%=' | '<<=' | '>>=' | '&=' | '|=' | '^=' |
| 256 | ; | |
| 257 | ||
| 258 | 4035 | expression |
| 259 | R166 | : assignment_expression |
| 260 | R167 | : expression ',' assignment_expression |
| 261 | ; | |
| 262 | ||
| 263 | 4036 | constant_expression |
| 264 | R168 | : conditional_expression |
| 265 | ; | |
| 266 | ||
| 267 | ||
| 268 |
| 1 | // | |
| 2 | // A5. Statements. | |
| 3 | // | |
| 4 | ||
| 5 | 4037 | statement |
| 6 | R169 | : labeled_statement |
| 7 | R170 | : expression_statement |
| 8 | R171 | : compound_statement |
| 9 | R172 | : selection_statement |
| 10 | R173 | : iteration_statement |
| 11 | R174 | : jump_statement |
| 12 | R175 | : declaration_statement |
| 13 | R176 | : try_block |
| 14 | ; | |
| 15 | ||
| 16 | 4038 | labeled_statement |
| 17 | R177 | : identifier ':' statement |
| 18 | R178 | : CASE constant_expression ':' statement |
| 19 | R179 | : DEFAULT ':' statement |
| 20 | ; | |
| 21 | ||
| 22 | 4039 | expression_statement |
| 23 | R180 | : ';' |
| 24 | R181 | : expression ';' |
| 25 | ; | |
| 26 | ||
| 27 | 4040 | compound_statement |
| 28 | R182 | : '{' '}' |
| 29 | R183 | : '{' statement_seq '}' |
| 30 | ; | |
| 31 | ||
| 32 | 4041 | statement_seq |
| 33 | R184 | : statement |
| 34 | R185 | : statement_seq statement |
| 35 | ; | |
| 36 | ||
| 37 | 4042 | selection_statement |
| 38 | R186 | : IF '(' condition ')' statement |
| 39 | R187 | : IF '(' condition ')' statement ELSE statement |
| 40 | R188 | : SWITCH '(' condition ')' statement |
| 41 | ; | |
| 42 | ||
| 43 | 4043 | condition |
| 44 | R189 | : expression |
| 45 | R190 | : type_specifier_seq declarator '=' assignment_expression |
| 46 | ; | |
| 47 | ||
| 48 | 4044 | iteration_statement |
| 49 | R191 | : WHILE '(' condition ')' statement |
| 50 | R192 | : DO statement WHILE '(' expression ')' ';' |
| 51 | /*+*/ | |
| 52 | R193 | : FOR '(' for_init_statement ';' ')' statement |
| 53 | R194 | : FOR '(' for_init_statement ';' expression ')' statement |
| 54 | R195 | : FOR '(' for_init_statement condition ';' ')' statement |
| 55 | R196 | : FOR '(' for_init_statement condition ';' expression ')' statement |
| 56 | ; | |
| 57 | ||
| 58 | 4045 | for_init_statement |
| 59 | R197 | : expression_statement |
| 60 | R198 | : simple_declaration |
| 61 | ; | |
| 62 | ||
| 63 | 4046 | jump_statement |
| 64 | R199 | : BREAK ';' |
| 65 | R200 | : CONTINUE ';' |
| 66 | R201 | : RETURN ';' |
| 67 | R202 | : RETURN expression ';' |
| 68 | R203 | : GOTO identifier ';' |
| 69 | ; | |
| 70 | ||
| 71 | 4047 | declaration_statement |
| 72 | R204 | : block_declaration |
| 73 | ; | |
| 74 | ||
| 75 |
| 1 | // | |
| 2 | // A6. Declarations. | |
| 3 | // | |
| 4 | ||
| 5 | 4048 | declaration_seq |
| 6 | R205 | : declaration |
| 7 | R206 | : declaration_seq declaration |
| 8 | ; | |
| 9 | ||
| 10 | 4049 | declaration |
| 11 | R207 | : block_declaration |
| 12 | R208 | : function_definition |
| 13 | R209 | : template_declaration |
| 14 | R210 | : explicit_instantiation |
| 15 | R211 | : explicit_specialization |
| 16 | R212 | : linkage_specification |
| 17 | R213 | : namespace_definition |
| 18 | ; | |
| 19 | ||
| 20 | 4050 | block_declaration |
| 21 | R214 | : simple_declaration |
| 22 | R215 | : asm_definition |
| 23 | R216 | : namespace_alias_definition |
| 24 | R217 | : using_declaration |
| 25 | R218 | : using_directive |
| 26 | ; | |
| 27 | ||
| 28 | 4051 | simple_declaration |
| 29 | R219 | : ';' |
| 30 | R220 | : init_declarator_list ';' |
| 31 | R221 | : decl_specifier_seq ';' |
| 32 | R222 | : decl_specifier_seq init_declarator_list ';' |
| 33 | ; | |
| 34 | ||
| 35 | 4052 | decl_specifier |
| 36 | R223 | : storage_class_specifier |
| 37 | R224 | : type_specifier |
| 38 | R225 | : function_specifier |
| 39 | R226 | : FRIEND |
| 40 | R227 | : TYPEDEF |
| 41 | ; | |
| 42 | ||
| 43 | 4053 | decl_specifier_seq |
| 44 | R228 | : decl_specifier |
| 45 | R229 | : decl_specifier_seq decl_specifier |
| 46 | ; | |
| 47 | ||
| 48 | 4054 | storage_class_specifier |
| 49 | R230 | : REGISTER |
| 50 | R231 | : AUTO |
| 51 | R232 | : STATIC |
| 52 | R233 | : EXTERN |
| 53 | R234 | : MUTABLE |
| 54 | ; | |
| 55 | ||
| 56 | 4055 | function_specifier |
| 57 | R235 | : INLINE |
| 58 | R236 | : VIRTUAL |
| 59 | R237 | : EXPLICIT |
| 60 | ; | |
| 61 | ||
| 62 | 4056 | typedef_name |
| 63 | R238 | : identifier |
| 64 | ; | |
| 65 | ||
| 66 | 4057 | type_specifier |
| 67 | R239 | : simple_type_specifier |
| 68 | R240 | : class_specifier |
| 69 | R241 | : enum_specifier |
| 70 | R242 | : elaborated_type_specifier |
| 71 | R243 | : cv_qualifier |
| 72 | ; | |
| 73 | ||
| 74 | 4058 | simple_type_specifier |
| 75 | R244 | : type_name |
| 76 | R245 | : nested_name_specifier type_name |
| 77 | R246 | : '::' type_name |
| 78 | R247 | : '::' nested_name_specifier type_name |
| 79 | /*+*/ | |
| 80 | R248 | : nested_name_specifier TEMPLATE template_id |
| 81 | R249 | : '::' nested_name_specifier TEMPLATE template_id |
| 82 | /*+*/ | |
| 83 | R250 | : BOOL |
| 84 | R251 | : CHAR |
| 85 | R252 | : WCHAR |
| 86 | R253 | : SHORT |
| 87 | R254 | : INT |
| 88 | R255 | : LONG |
| 89 | R256 | : SIGNED |
| 90 | R257 | : UNSIGNED |
| 91 | R258 | : FLOAT |
| 92 | R259 | : DOUBLE |
| 93 | R260 | : VOID |
| 94 | ; | |
| 95 | ||
| 96 | 4059 | type_name |
| 97 | R261 | : class_name |
| 98 | R262 | : enum_name |
| 99 | R263 | : typedef_name |
| 100 | ; | |
| 101 | ||
| 102 | 4060 | elaborated_type_specifier |
| 103 | R264 | : class_key identifier |
| 104 | R265 | : class_key nested_name_specifier identifier |
| 105 | R266 | : class_key '::' identifier |
| 106 | R267 | : class_key '::' nested_name_specifier identifier |
| 107 | /*+*/ | |
| 108 | R268 | : class_key template_id |
| 109 | R269 | : class_key TEMPLATE template_id |
| 110 | R270 | : class_key nested_name_specifier template_id |
| 111 | R271 | : class_key nested_name_specifier TEMPLATE template_id |
| 112 | R272 | : class_key '::' template_id |
| 113 | R273 | : class_key '::' TEMPLATE template_id |
| 114 | R274 | : class_key '::' nested_name_specifier template_id |
| 115 | R275 | : class_key '::' nested_name_specifier TEMPLATE template_id |
| 116 | /*+*/ | |
| 117 | R276 | : ENUM identifier |
| 118 | R277 | : ENUM nested_name_specifier identifier |
| 119 | R278 | : ENUM '::' identifier |
| 120 | R279 | : ENUM '::' nested_name_specifier identifier |
| 121 | /*+*/ | |
| 122 | R280 | : TYPENAME nested_name_specifier identifier |
| 123 | R281 | : TYPENAME '::' nested_name_specifier identifier |
| 124 | /*+*/ | |
| 125 | R282 | : TYPENAME nested_name_specifier template_id |
| 126 | R283 | : TYPENAME nested_name_specifier TEMPLATE template_id |
| 127 | R284 | : TYPENAME '::' nested_name_specifier template_id |
| 128 | R285 | : TYPENAME '::' nested_name_specifier TEMPLATE template_id |
| 129 | ; | |
| 130 | ||
| 131 | 4061 | enum_name |
| 132 | R286 | : identifier |
| 133 | ; | |
| 134 | ||
| 135 | 4062 | enum_specifier |
| 136 | R287 | : ENUM '{' '}' |
| 137 | R288 | : ENUM '{' enumerator_list '}' |
| 138 | R289 | : ENUM identifier '{' '}' |
| 139 | R290 | : ENUM identifier '{' enumerator_list '}' |
| 140 | ; | |
| 141 | ||
| 142 | 4063 | enumerator_list |
| 143 | R291 | : enumerator_definition |
| 144 | R292 | : enumerator_list ',' enumerator_definition |
| 145 | ; | |
| 146 | ||
| 147 | 4064 | enumerator_definition |
| 148 | R293 | : enumerator |
| 149 | R294 | : enumerator '=' constant_expression |
| 150 | ; | |
| 151 | ||
| 152 | 4065 | enumerator |
| 153 | R295 | : identifier |
| 154 | ; | |
| 155 | ||
| 156 | 4066 | namespace_name |
| 157 | R296 | : original_namespace_name |
| 158 | R297 | : namespace_alias |
| 159 | ; | |
| 160 | ||
| 161 | 4067 | original_namespace_name |
| 162 | R298 | : identifier |
| 163 | ; | |
| 164 | ||
| 165 | 4068 | namespace_definition |
| 166 | R299 | : named_namespace_definition |
| 167 | R300 | : unnamed_namespace_definition |
| 168 | ; | |
| 169 | ||
| 170 | 4069 | named_namespace_definition |
| 171 | R301 | : original_namespace_definition |
| 172 | R302 | : extension_namespace_definition |
| 173 | ; | |
| 174 | ||
| 175 | 4070 | original_namespace_definition |
| 176 | R303 | : NAMESPACE identifier '{' namespace_body '}' |
| 177 | ; | |
| 178 | ||
| 179 | 4071 | extension_namespace_definition |
| 180 | R304 | : NAMESPACE original_namespace_name '{' namespace_body '}' |
| 181 | ; | |
| 182 | ||
| 183 | 4072 | unnamed_namespace_definition |
| 184 | R305 | : NAMESPACE '{' namespace_body '}' |
| 185 | ; | |
| 186 | ||
| 187 | 4073 | namespace_body |
| 188 | R306 | : declaration_seq |
| 189 | ; | |
| 190 | ||
| 191 | 4074 | namespace_alias |
| 192 | R307 | : identifier |
| 193 | ; | |
| 194 | ||
| 195 | 4075 | namespace_alias_definition |
| 196 | R308 | : NAMESPACE identifier '=' qualified_namespace_specifier ';' |
| 197 | ; | |
| 198 | ||
| 199 | 4076 | qualified_namespace_specifier |
| 200 | R309 | : namespace_name |
| 201 | R310 | : nested_name_specifier namespace_name |
| 202 | R311 | : '::' namespace_name |
| 203 | R312 | : '::' nested_name_specifier namespace_name |
| 204 | ; | |
| 205 | ||
| 206 | 4077 | using_declaration |
| 207 | R313 | : USING nested_name_specifier unqualified_id ';' |
| 208 | R314 | : USING '::' nested_name_specifier unqualified_id ';' |
| 209 | R315 | : USING TYPENAME nested_name_specifier unqualified_id ';' |
| 210 | R316 | : USING TYPENAME '::' nested_name_specifier unqualified_id ';' |
| 211 | /*+*/ | |
| 212 | R317 | : USING '::' unqualified_id ';' |
| 213 | ; | |
| 214 | ||
| 215 | 4078 | using_directive |
| 216 | R318 | : USING NAMESPACE namespace_name ';' |
| 217 | R319 | : USING NAMESPACE nested_name_specifier namespace_name ';' |
| 218 | R320 | : USING NAMESPACE '::' namespace_name ';' |
| 219 | R321 | : USING NAMESPACE '::' nested_name_specifier namespace_name ';' |
| 220 | ; | |
| 221 | ||
| 222 | 4079 | asm_definition |
| 223 | R322 | : ASM '(' string ')' ';' |
| 224 | ; | |
| 225 | ||
| 226 | 4080 | linkage_specification |
| 227 | R323 | : EXTERN string '{' '}' |
| 228 | R324 | : EXTERN string '{' declaration_seq '}' |
| 229 | R325 | : EXTERN string declaration |
| 230 | ; | |
| 231 | ||
| 232 |
| 1 | // | |
| 2 | // A7. Declarators. | |
| 3 | // | |
| 4 | ||
| 5 | 4081 | init_declarator_list |
| 6 | R326 | : init_declarator |
| 7 | R327 | : init_declarator_list ',' init_declarator |
| 8 | ; | |
| 9 | ||
| 10 | 4082 | init_declarator |
| 11 | R328 | : declarator |
| 12 | R329 | : declarator initializer |
| 13 | ; | |
| 14 | ||
| 15 | 4083 | declarator |
| 16 | R330 | : direct_declarator |
| 17 | R331 | : ptr_operator declarator |
| 18 | ; | |
| 19 | ||
| 20 | 4084 | direct_declarator |
| 21 | R332 | : declarator_id |
| 22 | /*+*/ | |
| 23 | R333 | : direct_declarator '(' parameter_declaration_clause ')' |
| 24 | R334 | : direct_declarator '(' parameter_declaration_clause ')' exception_specification |
| 25 | R335 | : direct_declarator '(' parameter_declaration_clause ')' cv_qualifier_seq |
| 26 | R336 | : direct_declarator '(' parameter_declaration_clause ')' cv_qualifier_seq exception_specification |
| 27 | /*+*/ | |
| 28 | R337 | : direct_declarator '[' ']' |
| 29 | R338 | : direct_declarator '[' constant_expression ']' |
| 30 | /*+*/ | |
| 31 | R339 | : '(' declarator ')' |
| 32 | ; | |
| 33 | ||
| 34 | 4085 | ptr_operator |
| 35 | R340 | : '*' |
| 36 | R341 | : '*' cv_qualifier_seq |
| 37 | R342 | : '&' |
| 38 | R343 | : nested_name_specifier '*' |
| 39 | R344 | : nested_name_specifier '*' cv_qualifier_seq |
| 40 | R345 | : '::' nested_name_specifier '*' |
| 41 | R346 | : '::' nested_name_specifier '*' cv_qualifier_seq |
| 42 | ; | |
| 43 | ||
| 44 | 4086 | cv_qualifier_seq |
| 45 | R347 | : cv_qualifier |
| 46 | R348 | : cv_qualifier_seq cv_qualifier |
| 47 | ; | |
| 48 | ||
| 49 | 4087 | cv_qualifier |
| 50 | R349 | : CONST |
| 51 | R350 | : VOLATILE |
| 52 | ; | |
| 53 | ||
| 54 | 4088 | declarator_id |
| 55 | R351 | : id_expression |
| 56 | R352 | : type_name |
| 57 | R353 | : nested_name_specifier type_name |
| 58 | R354 | : '::' type_name |
| 59 | R355 | : '::' nested_name_specifier type_name |
| 60 | ; | |
| 61 | ||
| 62 | 4089 | type_id |
| 63 | R356 | : type_specifier_seq |
| 64 | R357 | : type_specifier_seq abstract_declarator |
| 65 | ; | |
| 66 | ||
| 67 | 4090 | type_specifier_seq |
| 68 | R358 | : type_specifier |
| 69 | R359 | : type_specifier_seq type_specifier |
| 70 | ; | |
| 71 | ||
| 72 | 4091 | abstract_declarator |
| 73 | R360 | : direct_abstract_declarator |
| 74 | R361 | : ptr_operator |
| 75 | R362 | : ptr_operator abstract_declarator |
| 76 | ; | |
| 77 | ||
| 78 | 4092 | direct_abstract_declarator |
| 79 | R363 | : '(' parameter_declaration_clause ')' |
| 80 | R364 | : '(' parameter_declaration_clause ')' exception_specification |
| 81 | R365 | : '(' parameter_declaration_clause ')' cv_qualifier_seq |
| 82 | R366 | : '(' parameter_declaration_clause ')' cv_qualifier_seq exception_specification |
| 83 | R367 | : direct_abstract_declarator '(' parameter_declaration_clause ')' |
| 84 | R368 | : direct_abstract_declarator '(' parameter_declaration_clause ')' exception_specification |
| 85 | R369 | : direct_abstract_declarator '(' parameter_declaration_clause ')' cv_qualifier_seq |
| 86 | R370 | : direct_abstract_declarator '(' parameter_declaration_clause ')' cv_qualifier_seq exception_specification |
| 87 | /*+*/ | |
| 88 | R371 | : '[' ']' |
| 89 | R372 | : '[' constant_expression ']' |
| 90 | R373 | : direct_abstract_declarator '[' ']' |
| 91 | R374 | : direct_abstract_declarator '[' constant_expression ']' |
| 92 | /*+*/ | |
| 93 | R375 | : '(' abstract_declarator ')' |
| 94 | ; | |
| 95 | ||
| 96 | 4093 | parameter_declaration_clause |
| 97 | R376 | : /*nothing*/ |
| 98 | R377 | : '...' |
| 99 | R378 | : parameter_declaration_list |
| 100 | R379 | : parameter_declaration_list '...' |
| 101 | R380 | : parameter_declaration_list ',' '...' |
| 102 | ; | |
| 103 | ||
| 104 | 4094 | parameter_declaration_list |
| 105 | R381 | : parameter_declaration |
| 106 | R382 | : parameter_declaration_list ',' parameter_declaration |
| 107 | ; | |
| 108 | ||
| 109 | 4095 | parameter_declaration |
| 110 | R383 | : decl_specifier_seq declarator |
| 111 | R384 | : decl_specifier_seq declarator '=' assignment_expression |
| 112 | /*+*/ | |
| 113 | R385 | : decl_specifier_seq |
| 114 | R386 | : decl_specifier_seq '=' assignment_expression |
| 115 | R387 | : decl_specifier_seq abstract_declarator |
| 116 | R388 | : decl_specifier_seq abstract_declarator '=' assignment_expression |
| 117 | ; | |
| 118 | ||
| 119 | 4096 | function_definition |
| 120 | R389 | : declarator function_body |
| 121 | R390 | : declarator ctor_initializer function_body |
| 122 | R391 | : decl_specifier_seq declarator function_body |
| 123 | R392 | : decl_specifier_seq declarator ctor_initializer function_body |
| 124 | /*+*/ | |
| 125 | R393 | : declarator function_try_block |
| 126 | R394 | : decl_specifier_seq declarator function_try_block |
| 127 | ; | |
| 128 | ||
| 129 | 4097 | function_body |
| 130 | R395 | : compound_statement |
| 131 | ; | |
| 132 | ||
| 133 | 4098 | initializer |
| 134 | R396 | : '=' initializer_clause |
| 135 | R397 | : '(' expression_list ')' |
| 136 | ; | |
| 137 | ||
| 138 | 4099 | initializer_clause |
| 139 | R398 | : assignment_expression |
| 140 | R399 | : '{' '}' |
| 141 | R400 | : '{' initializer_list '}' |
| 142 | R401 | : '{' initializer_list ',' '}' |
| 143 | ; | |
| 144 | ||
| 145 | 4100 | initializer_list |
| 146 | R402 | : initializer_clause |
| 147 | R403 | : initializer_list ',' initializer_clause |
| 148 | ; | |
| 149 | ||
| 150 |
| 1 | // | |
| 2 | // A8. Classes. | |
| 3 | // | |
| 4 | ||
| 5 | 4101 | class_name |
| 6 | R404 | : identifier |
| 7 | R405 | : template_id |
| 8 | ; | |
| 9 | ||
| 10 | 4102 | class_specifier |
| 11 | R406 | : class_head '{' '}' |
| 12 | R407 | : class_head '{' member_specification '}' |
| 13 | ; | |
| 14 | ||
| 15 | 4103 | class_head |
| 16 | R408 | : class_key |
| 17 | R409 | : class_key base_clause |
| 18 | R410 | : class_key identifier |
| 19 | R411 | : class_key identifier base_clause |
| 20 | /*+*/ | |
| 21 | R412 | : class_key nested_name_specifier identifier |
| 22 | R413 | : class_key nested_name_specifier identifier base_clause |
| 23 | /*+*/ | |
| 24 | R414 | : class_key template_id |
| 25 | R415 | : class_key template_id base_clause |
| 26 | R416 | : class_key nested_name_specifier template_id |
| 27 | R417 | : class_key nested_name_specifier template_id base_clause |
| 28 | ; | |
| 29 | ||
| 30 | 4104 | class_key |
| 31 | R418 | : STRUCT |
| 32 | R419 | : UNION |
| 33 | R420 | : CLASS |
| 34 | ; | |
| 35 | ||
| 36 | 4105 | member_specification |
| 37 | R421 | : member_declaration |
| 38 | R422 | : member_declaration member_specification |
| 39 | R423 | : access_specifier ':' |
| 40 | R424 | : access_specifier ':' member_specification |
| 41 | ; | |
| 42 | ||
| 43 | 4106 | member_declaration |
| 44 | R425 | : ';' |
| 45 | R426 | : member_declarator_list ';' |
| 46 | R427 | : decl_specifier_seq ';' |
| 47 | R428 | : decl_specifier_seq member_declarator_list ';' |
| 48 | /*+*/ | |
| 49 | R429 | : function_definition |
| 50 | R430 | : function_definition ';' |
| 51 | /*+*/ | |
| 52 | R431 | : nested_name_specifier unqualified_id ';' |
| 53 | R432 | : nested_name_specifier TEMPLATE unqualified_id ';' |
| 54 | R433 | : '::' nested_name_specifier unqualified_id ';' |
| 55 | R434 | : '::' nested_name_specifier TEMPLATE unqualified_id ';' |
| 56 | /*+*/ | |
| 57 | R435 | : using_declaration |
| 58 | R436 | : template_declaration |
| 59 | ; | |
| 60 | ||
| 61 | 4107 | member_declarator_list |
| 62 | R437 | : member_declarator |
| 63 | R438 | : member_declarator_list ',' member_declarator |
| 64 | ; | |
| 65 | ||
| 66 | 4108 | member_declarator |
| 67 | R439 | : declarator |
| 68 | R440 | : declarator pure_specifier |
| 69 | R441 | : declarator constant_initializer |
| 70 | R442 | : ':' constant_expression |
| 71 | R443 | : identifier ':' constant_expression |
| 72 | ; | |
| 73 | ||
| 74 | 4109 | pure_specifier |
| 75 | R444 | : '=' number |
| 76 | ; | |
| 77 | ||
| 78 | 4110 | constant_initializer |
| 79 | R445 | : '=' constant_expression |
| 80 | ; | |
| 81 | ||
| 82 |
| 1 | // | |
| 2 | // A9. Derived classes. | |
| 3 | // | |
| 4 | ||
| 5 | 4111 | base_clause |
| 6 | R446 | : base_specifier_list |
| 7 | ; | |
| 8 | ||
| 9 | 4112 | base_specifier_list |
| 10 | R447 | : base_specifier |
| 11 | R448 | : base_specifier_list ',' base_specifier |
| 12 | ; | |
| 13 | ||
| 14 | 4113 | base_specifier |
| 15 | R449 | : class_name |
| 16 | R450 | : nested_name_specifier class_name |
| 17 | R451 | : '::' class_name |
| 18 | R452 | : '::' nested_name_specifier class_name |
| 19 | /*+*/ | |
| 20 | R453 | : VIRTUAL class_name |
| 21 | R454 | : VIRTUAL nested_name_specifier class_name |
| 22 | R455 | : VIRTUAL '::' class_name |
| 23 | R456 | : VIRTUAL '::' nested_name_specifier class_name |
| 24 | R457 | : VIRTUAL access_specifier class_name |
| 25 | R458 | : VIRTUAL access_specifier nested_name_specifier class_name |
| 26 | R459 | : VIRTUAL access_specifier '::' class_name |
| 27 | R460 | : VIRTUAL access_specifier '::' nested_name_specifier class_name |
| 28 | /*+*/ | |
| 29 | R461 | : access_specifier class_name |
| 30 | R462 | : access_specifier nested_name_specifier class_name |
| 31 | R463 | : access_specifier '::' class_name |
| 32 | R464 | : access_specifier '::' nested_name_specifier class_name |
| 33 | R465 | : access_specifier VIRTUAL class_name |
| 34 | R466 | : access_specifier VIRTUAL nested_name_specifier class_name |
| 35 | R467 | : access_specifier VIRTUAL '::' class_name |
| 36 | R468 | : access_specifier VIRTUAL '::' nested_name_specifier class_name |
| 37 | ; | |
| 38 | ||
| 39 | 4114 | access_specifier |
| 40 | R469 | : PUBLIC |
| 41 | R470 | : PROTECTED |
| 42 | R471 | : PRIVATE |
| 43 | ; | |
| 44 | ||
| 45 |
| 1 | // | |
| 2 | // A10. Special member functions. | |
| 3 | // | |
| 4 | ||
| 5 | 4115 | conversion_function_id |
| 6 | R472 | : OPERATOR conversion_type_id |
| 7 | ; | |
| 8 | ||
| 9 | 4116 | conversion_type_id |
| 10 | R473 | : type_specifier_seq |
| 11 | R474 | : type_specifier_seq conversion_declarator |
| 12 | ; | |
| 13 | ||
| 14 | 4117 | conversion_declarator |
| 15 | R475 | : ptr_operator |
| 16 | R476 | : ptr_operator conversion_declarator |
| 17 | ; | |
| 18 | ||
| 19 | 4118 | ctor_initializer |
| 20 | R477 | : mem_initilizer_list |
| 21 | ; | |
| 22 | ||
| 23 | 4119 | mem_initilizer_list |
| 24 | R478 | : mem_initilizer |
| 25 | R479 | : mem_initilizer_list ',' mem_initilizer |
| 26 | ; | |
| 27 | ||
| 28 | 4120 | mem_initilizer |
| 29 | R480 | : mem_initilizer_id '(' ')' |
| 30 | R481 | : mem_initilizer_id '(' expression_list ')' |
| 31 | ; | |
| 32 | ||
| 33 | 4121 | mem_initilizer_id |
| 34 | R482 | : identifier |
| 35 | R483 | : class_name |
| 36 | R484 | : nested_name_specifier class_name |
| 37 | R485 | : '::' class_name |
| 38 | R486 | : '::' nested_name_specifier class_name |
| 39 | ; | |
| 40 | ||
| 41 |
| 1 | // | |
| 2 | // A11. Overloading. | |
| 3 | // | |
| 4 | ||
| 5 | 4122 | operator_function_id |
| 6 | R487 | : OPERATOR overloadable_operator |
| 7 | R488 | : OPERATOR overloadable_operator '<' '>' |
| 8 | R489 | : OPERATOR overloadable_operator '<' template_argument_list '>' |
| 9 | ; | |
| 10 | ||
| 11 | 4123 | overloadable_operator |
| 12 | R490 | : NEW | DELETE | NEW '[' ']' | DELETE '[' ']' |
| 13 | /*+*/ | |
| 14 | R494 | : '+' | '-' | '*' | '/' | '%' | '^' | '&' | '|' | '~' |
| 15 | R503 | : '!' | '=' | '<' | '>' | '+=' | '-=' | '*=' | '/=' | '%=' |
| 16 | R512 | : '^=' | '&=' | '|=' | '<<' | '>>' | '<<=' | '>>=' | '==' | '!=' |
| 17 | R521 | : '<=' | '>=' | '&&' | '||' | '++' | '--' | ',' | '->*' | '->' |
| 18 | /*+*/ | |
| 19 | R530 | : '(' ')' | '[' ']' |
| 20 | ; | |
| 21 | ||
| 22 |
| 1 | // | |
| 2 | // A12. Templates. | |
| 3 | // | |
| 4 | ||
| 5 | 4124 | template_declaration |
| 6 | R532 | : TEMPLATE '<' template_parameter_list '>' declaration |
| 7 | R533 | : EXPORT TEMPLATE '<' template_parameter_list '>' declaration |
| 8 | ; | |
| 9 | ||
| 10 | 4125 | template_parameter_list |
| 11 | R534 | : template_parameter |
| 12 | R535 | : template_parameter_list ',' template_parameter |
| 13 | ; | |
| 14 | ||
| 15 | 4126 | template_parameter |
| 16 | R536 | : type_parameter |
| 17 | R537 | : parameter_declaration |
| 18 | ; | |
| 19 | ||
| 20 | 4127 | type_parameter |
| 21 | R538 | : CLASS |
| 22 | R539 | : CLASS '=' type_id |
| 23 | R540 | : CLASS identifier |
| 24 | R541 | : CLASS identifier '=' type_id |
| 25 | /*+*/ | |
| 26 | R542 | : TYPENAME |
| 27 | R543 | : TYPENAME '=' type_id |
| 28 | R544 | : TYPENAME identifier |
| 29 | R545 | : TYPENAME identifier '=' type_id |
| 30 | /*+*/ | |
| 31 | R546 | : TEMPLATE '<' template_parameter_list '>' CLASS |
| 32 | R547 | : TEMPLATE '<' template_parameter_list '>' CLASS '=' id_expression |
| 33 | R548 | : TEMPLATE '<' template_parameter_list '>' CLASS identifier |
| 34 | R549 | : TEMPLATE '<' template_parameter_list '>' CLASS identifier '=' id_expression |
| 35 | ; | |
| 36 | ||
| 37 | 4128 | template_id |
| 38 | R550 | : template_name '<' '>' |
| 39 | R551 | : template_name '<' template_argument_list '>' |
| 40 | ; | |
| 41 | ||
| 42 | 4129 | template_name |
| 43 | R552 | : identifier |
| 44 | ; | |
| 45 | ||
| 46 | 4130 | template_argument_list |
| 47 | R553 | : template_argument |
| 48 | R554 | : template_argument_list ',' template_argument |
| 49 | ; | |
| 50 | ||
| 51 | 4131 | template_argument |
| 52 | R555 | : assignment_expression |
| 53 | R556 | : type_id |
| 54 | R557 | : id_expression |
| 55 | ; | |
| 56 | ||
| 57 | 4132 | explicit_instantiation |
| 58 | R558 | : TEMPLATE declaration |
| 59 | ; | |
| 60 | ||
| 61 | 4133 | explicit_specialization |
| 62 | R559 | : TEMPLATE '<' '>' declaration |
| 63 | ; | |
| 64 | ||
| 65 |
| 1 | // | |
| 2 | // A13. Exception handling. | |
| 3 | // | |
| 4 | ||
| 5 | 4134 | try_block |
| 6 | R560 | : TRY compound_statement handler_seq |
| 7 | ; | |
| 8 | ||
| 9 | 4135 | function_try_block |
| 10 | R561 | : TRY function_body handler_seq |
| 11 | R562 | : TRY ctor_initializer function_body handler_seq |
| 12 | ; | |
| 13 | ||
| 14 | 4136 | handler_seq |
| 15 | R563 | : handler |
| 16 | R564 | : handler_seq handler |
| 17 | ; | |
| 18 | ||
| 19 | 4137 | handler |
| 20 | R565 | : CATCH '(' exception_declaration ')' compound_statement |
| 21 | ; | |
| 22 | ||
| 23 | 4138 | exception_declaration |
| 24 | R566 | : type_specifier_seq |
| 25 | R567 | : type_specifier_seq declarator |
| 26 | R568 | : type_specifier_seq abstract_declarator |
| 27 | R569 | : '...' |
| 28 | ; | |
| 29 | ||
| 30 | 4139 | throw_expression |
| 31 | R570 | : THROW |
| 32 | R571 | : THROW assignment_expression |
| 33 | ; | |
| 34 | ||
| 35 | 4140 | exception_specification |
| 36 | R572 | : THROW '(' ')' |
| 37 | R573 | : THROW '(' type_id_list ')' |
| 38 | ; | |
| 39 | ||
| 40 | 4141 | type_id_list |
| 41 | R574 | : type_id |
| 42 | R575 | : type_id_list ',' type_id |
| 43 | ; | |
| 44 | ||
| 45 |