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 init-declarators #253

Open
wants to merge 1 commit 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
46 changes: 16 additions & 30 deletions chapters/grammar.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -311,34 +311,25 @@ _function_header_with_parameters_ : ::
_function_header_ : ::
_fully_specified_type_ _IDENTIFIER_ _LEFT_PAREN_

_parameter_declarator_ : ::
_type_specifier_ _IDENTIFIER_ +
_type_specifier_ _IDENTIFIER_ _array_specifier_
_declarator_ : ::
_IDENTIFIER_ +
_IDENTIFIER_ _array_specifier_

_parameter_declaration_ : ::
_type_qualifier_ _parameter_declarator_ +
_parameter_declarator_ +
_type_qualifier_ _parameter_type_specifier_ +
_parameter_type_specifier_
_fully_specified_type_ _declarator_ +
_fully_specified_type_

_parameter_type_specifier_ : ::
_type_specifier_
_init_declarator_ : ::
_declarator_ +
_declarator_ _EQUAL_ _initializer_

_init_declarator_list_ : ::
_single_declaration_ +
_init_declarator_list_ _COMMA_ _IDENTIFIER_ +
_init_declarator_list_ _COMMA_ _IDENTIFIER_ _array_specifier_ +
_init_declarator_list_ _COMMA_ _IDENTIFIER_ _array_specifier_ _EQUAL_
_initializer_ +
_init_declarator_list_ _COMMA_ _IDENTIFIER_ _EQUAL_ _initializer_
_init_declarator_list_ _COMMA_ _init_declarator_

_single_declaration_ : ::
_fully_specified_type_ +
_fully_specified_type_ _IDENTIFIER_ +
_fully_specified_type_ _IDENTIFIER_ _array_specifier_ +
_fully_specified_type_ _IDENTIFIER_ _array_specifier_ _EQUAL_
_initializer_ +
_fully_specified_type_ _IDENTIFIER_ _EQUAL_ _initializer_
_fully_specified_type_ _init_declarator_

[NOTE]
====
Expand Down Expand Up @@ -574,25 +565,20 @@ _precision_qualifier_ : ::
_LOW_PRECISION_

_struct_specifier_ : ::
_STRUCT_ _IDENTIFIER_ _LEFT_BRACE_ _struct_declaration_list_
_RIGHT_BRACE_ +
_STRUCT_ _IDENTIFIER_ _LEFT_BRACE_ _struct_declaration_list_ _RIGHT_BRACE_ +
_STRUCT_ _LEFT_BRACE_ _struct_declaration_list_ _RIGHT_BRACE_

_struct_declaration_list_ : ::
_struct_declaration_ +
_struct_declaration_list_ _struct_declaration_

_struct_declaration_ : ::
_type_specifier_ _struct_declarator_list_ _SEMICOLON_ +
_type_qualifier_ _type_specifier_ _struct_declarator_list_ _SEMICOLON_

_struct_declarator_list_ : ::
_struct_declarator_ +
_struct_declarator_list_ _COMMA_ _struct_declarator_
_type_specifier_ _declarator_list_ _SEMICOLON_ +
_type_qualifier_ _type_specifier_ _declarator_list_ _SEMICOLON_

_struct_declarator_ : ::
_IDENTIFIER_ +
_IDENTIFIER_ _array_specifier_
_declarator_list_ : ::
_declarator_ +
_declarator_list_ _COMMA_ _declarator_

_initializer_ : ::
ifdef::GLSL[]
Expand Down