Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify grammar for function headers #252

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions chapters/grammar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,15 @@ _identifier_list_ : ::
_identifier_list_ _COMMA_ _IDENTIFIER_

_function_prototype_ : ::
_function_declarator_ _RIGHT_PAREN_
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_ _parameter_declaration_list_opt_ _RIGHT_PAREN_

_function_declarator_ : ::
_function_header_ +
_function_header_with_parameters_
_parameter_declaration_list_opt_ : ::
/* _empty_ */ +
_parameter_declaration_list_

_function_header_with_parameters_ : ::
_function_header_ _parameter_declaration_ +
_function_header_with_parameters_ _COMMA_ _parameter_declaration_

_function_header_ : ::
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_
_parameter_declaration_list_ : ::
_parameter_declaration_
_parameter_declaration_list_ _COMMA_ _parameter_declaration_

_parameter_declarator_ : ::
_type_specifier_ _IDENTIFIER_ +
Expand Down