Skip to content

Commit

Permalink
Fold function_prototype into function_definition
Browse files Browse the repository at this point in the history
  • Loading branch information
dj2 committed Sep 26, 2024
1 parent 0a6e5cf commit 4c57146
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions chapters/grammar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ _function_call_header_with_parameters_ : ::
_function_call_header_ : ::
_function_identifier_ _LEFT_PAREN_

_function_definition_ : ::
_function_declarator_ _RIGHT_PAREN_ _compound_statement_no_new_scope_

_function_identifier_ : ::
_type_specifier_ +
_postfix_expression_

_function_declarator_ : ::
_function_header_ +
_function_header_with_parameters_

_function_header_with_parameters_ : ::
_function_header_ _parameter_declaration_ +
_function_header_with_parameters_ _COMMA_ _parameter_declaration_

_function_header_ : ::
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_


[NOTE]
====
Grammar Note: Constructors look like functions, but lexical analysis
Expand All @@ -160,13 +179,6 @@ _postfix_expression_.
endif::ESSL[]
====

_function_definition_ : ::
_function_prototype_ _compound_statement_no_new_scope_

_function_identifier_ : ::
_type_specifier_ +
_postfix_expression_

_unary_expression_ : ::
_postfix_expression_ +
_INC_OP_ _unary_expression_ +
Expand Down Expand Up @@ -286,17 +298,6 @@ _identifier_list_ : ::
_COMMA_ _IDENTIFIER_ +
_identifier_list_ _COMMA_ _IDENTIFIER_

_function_declarator_ : ::
_function_header_ +
_function_header_with_parameters_

_function_header_with_parameters_ : ::
_function_header_ _parameter_declaration_ +
_function_header_with_parameters_ _COMMA_ _parameter_declaration_

_function_header_ : ::
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_

_parameter_declarator_ : ::
_type_specifier_ _IDENTIFIER_ +
_type_specifier_ _IDENTIFIER_ _array_specifier_
Expand Down

0 comments on commit 4c57146

Please sign in to comment.