Skip to content

Commit 4c57146

Browse files
committed
Fold function_prototype into function_definition
1 parent 0a6e5cf commit 4c57146

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

chapters/grammar.adoc

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ _function_call_header_with_parameters_ : ::
141141
_function_call_header_ : ::
142142
_function_identifier_ _LEFT_PAREN_
143143

144+
_function_definition_ : ::
145+
_function_declarator_ _RIGHT_PAREN_ _compound_statement_no_new_scope_
146+
147+
_function_identifier_ : ::
148+
_type_specifier_ +
149+
_postfix_expression_
150+
151+
_function_declarator_ : ::
152+
_function_header_ +
153+
_function_header_with_parameters_
154+
155+
_function_header_with_parameters_ : ::
156+
_function_header_ _parameter_declaration_ +
157+
_function_header_with_parameters_ _COMMA_ _parameter_declaration_
158+
159+
_function_header_ : ::
160+
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_
161+
162+
144163
[NOTE]
145164
====
146165
Grammar Note: Constructors look like functions, but lexical analysis
@@ -160,13 +179,6 @@ _postfix_expression_.
160179
endif::ESSL[]
161180
====
162181

163-
_function_definition_ : ::
164-
_function_prototype_ _compound_statement_no_new_scope_
165-
166-
_function_identifier_ : ::
167-
_type_specifier_ +
168-
_postfix_expression_
169-
170182
_unary_expression_ : ::
171183
_postfix_expression_ +
172184
_INC_OP_ _unary_expression_ +
@@ -286,17 +298,6 @@ _identifier_list_ : ::
286298
_COMMA_ _IDENTIFIER_ +
287299
_identifier_list_ _COMMA_ _IDENTIFIER_
288300

289-
_function_declarator_ : ::
290-
_function_header_ +
291-
_function_header_with_parameters_
292-
293-
_function_header_with_parameters_ : ::
294-
_function_header_ _parameter_declaration_ +
295-
_function_header_with_parameters_ _COMMA_ _parameter_declaration_
296-
297-
_function_header_ : ::
298-
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_
299-
300301
_parameter_declarator_ : ::
301302
_type_specifier_ _IDENTIFIER_ +
302303
_type_specifier_ _IDENTIFIER_ _array_specifier_

0 commit comments

Comments
 (0)