@@ -100,11 +100,9 @@ endif::GLSL[]
100100
101101[role="bnf"]
102102--
103- _variable_identifier_ : ::
104- _IDENTIFIER_
105103
106104_primary_expression_ : ::
107- _variable_identifier_ +
105+ _IDENTIFIER_ +
108106 _INTCONSTANT_ +
109107 _UINTCONSTANT_ +
110108 _FLOATCONSTANT_ +
@@ -116,7 +114,7 @@ endif::GLSL[]
116114
117115_postfix_expression_ : ::
118116 _primary_expression_ +
119- _postfix_expression_ _LEFT_BRACKET_ _integer_expression_ _RIGHT_BRACKET_ +
117+ _postfix_expression_ _LEFT_BRACKET_ _expression_ _RIGHT_BRACKET_ +
120118 _function_call_ +
121119 _postfix_expression_ _DOT_ _FIELD_SELECTION_ +
122120 _postfix_expression_ _INC_OP_ +
@@ -128,16 +126,7 @@ FIELD_SELECTION includes members in structures, component selection for
128126vectors and the 'length' identifier for the length() method
129127====
130128
131- _integer_expression_ : ::
132- _expression_
133-
134129_function_call_ : ::
135- _function_call_or_method_
136-
137- _function_call_or_method_ : ::
138- _function_call_generic_
139-
140- _function_call_generic_ : ::
141130 _function_call_header_with_parameters_ _RIGHT_PAREN_ +
142131 _function_call_header_no_parameters_ _RIGHT_PAREN_
143132
@@ -171,6 +160,9 @@ _postfix_expression_.
171160endif::ESSL[]
172161====
173162
163+ _function_definition_ : ::
164+ _function_prototype_ _compound_statement_no_new_scope_
165+
174166_function_identifier_ : ::
175167 _type_specifier_ +
176168 _postfix_expression_
@@ -276,11 +268,8 @@ _expression_ : ::
276268 _assignment_expression_ +
277269 _expression_ _COMMA_ _assignment_expression_
278270
279- _constant_expression_ : ::
280- _conditional_expression_
281-
282271_declaration_ : ::
283- _function_prototype_ _SEMICOLON_ +
272+ _function_declarator_ _RIGHT_PAREN_ _SEMICOLON_ +
284273 _init_declarator_list_ _SEMICOLON_ +
285274 _PRECISION_ _precision_qualifier_ _type_specifier_ _SEMICOLON_ +
286275 _type_qualifier_ _IDENTIFIER_ _LEFT_BRACE_ _struct_declaration_list_
@@ -297,9 +286,6 @@ _identifier_list_ : ::
297286 _COMMA_ _IDENTIFIER_ +
298287 _identifier_list_ _COMMA_ _IDENTIFIER_
299288
300- _function_prototype_ : ::
301- _function_declarator_ _RIGHT_PAREN_
302-
303289_function_declarator_ : ::
304290 _function_header_ +
305291 _function_header_with_parameters_
@@ -318,10 +304,7 @@ _parameter_declarator_ : ::
318304_parameter_declaration_ : ::
319305 _type_qualifier_ _parameter_declarator_ +
320306 _parameter_declarator_ +
321- _type_qualifier_ _parameter_type_specifier_ +
322- _parameter_type_specifier_
323-
324- _parameter_type_specifier_ : ::
307+ _type_qualifier_ _type_specifier_ +
325308 _type_specifier_
326309
327310_init_declarator_list_ : ::
@@ -349,9 +332,6 @@ _fully_specified_type_ : ::
349332 _type_specifier_ +
350333 _type_qualifier_ _type_specifier_
351334
352- _invariant_qualifier_ : ::
353- _INVARIANT_
354-
355335_interpolation_qualifier_ : ::
356336 _SMOOTH_ +
357337ifdef::GLSL[]
@@ -362,38 +342,32 @@ ifdef::ESSL[]
362342 _FLAT_
363343endif::ESSL[]
364344
365- _layout_qualifier_ : ::
366- _LAYOUT_ _LEFT_PAREN_ _layout_qualifier_id_list_ _RIGHT_PAREN_
367-
368345_layout_qualifier_id_list_ : ::
369346 _layout_qualifier_id_ +
370347 _layout_qualifier_id_list_ _COMMA_ _layout_qualifier_id_
371348
372349_layout_qualifier_id_ : ::
373350 _IDENTIFIER_ +
374351ifdef::GLSL[]
375- _IDENTIFIER_ _EQUAL_ _constant_expression_ +
352+ _IDENTIFIER_ _EQUAL_ __conditional_expression__ +
376353endif::GLSL[]
377354ifdef::ESSL[]
378355 _IDENTIFIER_ _EQUAL_ _INTCONSTANT_ +
379356 _IDENTIFIER_ _EQUAL_ _UINTCONSTANT_ +
380357endif::ESSL[]
381358 _SHARED_
382359
383- _precise_qualifier_ : ::
384- _PRECISE_
385-
386360_type_qualifier_ : ::
387361 _single_type_qualifier_ +
388362 _type_qualifier_ _single_type_qualifier_
389363
390364_single_type_qualifier_ : ::
391365 _storage_qualifier_ +
392- _layout_qualifier_ +
366+ _LAYOUT_ _LEFT_PAREN_ _layout_qualifier_id_list_ _RIGHT_PAREN_ +
393367 _precision_qualifier_ +
394368 _interpolation_qualifier_ +
395- _invariant_qualifier_ +
396- _precise_qualifier_
369+ _INVARIANT_ +
370+ _PRECISE_
397371
398372_storage_qualifier_ : ::
399373 _CONST_ +
@@ -574,8 +548,7 @@ _precision_qualifier_ : ::
574548 _LOW_PRECISION_
575549
576550_struct_specifier_ : ::
577- _STRUCT_ _IDENTIFIER_ _LEFT_BRACE_ _struct_declaration_list_
578- _RIGHT_BRACE_ +
551+ _STRUCT_ _IDENTIFIER_ _LEFT_BRACE_ _struct_declaration_list_ _RIGHT_BRACE_ +
579552 _STRUCT_ _LEFT_BRACE_ _struct_declaration_list_ _RIGHT_BRACE_
580553
581554_struct_declaration_list_ : ::
@@ -608,9 +581,6 @@ ifdef::ESSL[]
608581 _assignment_expression_
609582endif::ESSL[]
610583
611- _declaration_statement_ : ::
612- _declaration_
613-
614584_statement_ : ::
615585 _compound_statement_ +
616586 _simple_statement_
@@ -621,7 +591,7 @@ Grammar Note: labeled statements for SWITCH only; 'goto' is not supported.
621591====
622592
623593_simple_statement_ : ::
624- _declaration_statement_ +
594+ _declaration_ +
625595 _expression_statement_ +
626596 _selection_statement_ +
627597 _switch_statement_ +
@@ -682,7 +652,7 @@ _iteration_statement_ : ::
682652
683653_for_init_statement_ : ::
684654 _expression_statement_ +
685- _declaration_statement_
655+ _declaration_
686656
687657_conditionopt_ : ::
688658 /* _empty_ */ +
@@ -719,9 +689,6 @@ ifdef::ESSL[]
719689 _declaration_
720690endif::ESSL[]
721691
722- _function_definition_ : ::
723- _function_prototype_ _compound_statement_no_new_scope_
724-
725692--
726693
727694In general the above grammar describes a super set of the {slname}.
0 commit comments