Next: , Previous: Keywords, Up: Top



Appendix B Grammar

"Yacc" owes much to a most stimulating collection of users, who have goaded me beyond my inclination, and frequently beyond my ability in their endless search for "one more feature". Their irritating unwillingness to learn how to do things my way has usually led to my doing things their way; most of the time, they have been right.
– S. C. Johnson, "Yacc guide acknowledgements

This appendix describes the HAC language's grammar. The grammar is context-free and LR(1), so traditional yacc and bison (LALR(1)) parser generators will work with it.

   0  $accept : module $end
   1  module : embedded_module
   2  embedded_module : imports_optional top_root
   3  imports_optional : imports
   4                   |
   5  imports : imports import_item
   6          | import_item
   7  import_item : IMPORT
   8              | EMBEDFILE BEGINFILE embedded_module ENDFILE
   9  top_root : body
  10           |
  11  body : body body_item
  12       | body_item
  13  body_item : namespace_item
  14            | definition
  15            | prototype_declaration
  16  namespace_item : namespace_management
  17                 | instance_item_extended
  18                 | type_alias
  19  namespace_management : NAMESPACE ID '{' top_root '}'
  20                       | OPEN namespace_id RARROW ID ';'
  21                       | OPEN namespace_id ';'
  22  namespace_id : relative_id
  23  definition : defproc
  24             | defdatatype
  25             | defchan
  26             | defenum
  27  prototype_declaration : declare_proc_proto ';'
  28                        | declare_datatype_proto ';'
  29                        | declare_chan_proto ';'
  30                        | declare_enum ';'
  31  type_alias : optional_export optional_template_specification TYPEDEF physical_type_ref ID ';'
  32  template_specification : TEMPLATE template_formal_decl_list_in_angles
  33                         | TEMPLATE template_formal_decl_list_optional_in_angles template_formal_decl_nodefault_list_in_angles
  34  optional_template_specification : template_specification
  35                                  |
  36  optional_export : EXPORT
  37                  |
  38  def_or_proc : DEFINE
  39              | DEFPROC
  40  declare_proc_proto : optional_export optional_template_specification def_or_proc ID optional_port_formal_decl_list_in_parens
  41  defproc : declare_proc_proto '{' optional_definition_body '}'
  42  optional_port_formal_decl_list_in_parens : '(' port_formal_decl_list ')'
  43                                           | '(' ')'
  44  template_formal_decl_list_in_angles : '<' template_formal_decl_list '>'
  45  template_formal_decl_nodefault_list_in_angles : '<' template_formal_decl_nodefault_list '>'
  46  template_formal_decl_list_optional_in_angles : template_formal_decl_list_in_angles
  47                                               | '<' '>'
  48  template_formal_decl_list : template_formal_decl_list ';' template_formal_decl
  49                            | template_formal_decl
  50  template_formal_decl_nodefault_list : template_formal_decl_nodefault_list ';' template_formal_decl_nodefault
  51                                      | template_formal_decl_nodefault
  52  template_formal_decl : base_param_type template_formal_id_list
  53  template_formal_decl_nodefault : base_param_type template_formal_id_nodefault_list
  54  template_formal_id_list : template_formal_id_list ',' template_formal_id
  55                          | template_formal_id
  56  template_formal_id_nodefault_list : template_formal_id_nodefault_list ',' template_formal_id_nodefault
  57                                    | template_formal_id_nodefault
  58  template_formal_id_default : ID optional_dense_range_list '=' expr
  59  template_formal_id_nodefault : ID optional_dense_range_list
  60  template_formal_id : template_formal_id_default
  61                     | template_formal_id_nodefault
  62  port_formal_decl_list : port_formal_decl_list ';' port_formal_decl
  63                        | port_formal_decl
  64  port_formal_decl : port_physical_type_ref port_formal_id_list
  65  port_formal_id_list : port_formal_id_list ',' port_formal_id
  66                      | port_formal_id
  67  port_formal_id : ID optional_dense_range_list
  68  port_generic_type_ref : generic_type_ref optional_chan_dir
  69  generic_type_ref : generic_id strict_relaxed_template_arguments
  70  optional_chan_dir : chan_dir
  71                    |
  72  chan_dir : '?'
  73           | '!'
  74           | '?' '?'
  75           | '!' '!'
  76  port_physical_type_ref : port_generic_type_ref
  77                         | port_base_chan_type
  78                         | port_base_data_type_ref
  79  physical_type_ref : generic_type_ref
  80                    | base_chan_type
  81                    | base_data_type_ref
  82  port_base_data_type_ref : base_data_type_ref optional_chan_dir
  83  base_data_type_ref : base_data_type strict_relaxed_template_arguments
  84  data_type_ref : base_data_type_ref
  85                | generic_type_ref
  86  type_id : physical_type_ref
  87          | base_param_type
  88  base_param_type : PINT_TYPE
  89                  | PBOOL_TYPE
  90                  | PREAL_TYPE
  91                  | PSTRING_TYPE
  92  port_base_chan_type : chan_or_port data_type_ref_list_optional_in_parens
  93  base_chan_type : CHANNEL data_type_ref_list_optional_in_parens
  94  chan_or_port : CHANNEL optional_chan_dir
  95  data_type_ref_list_optional_in_parens : '(' data_type_ref_list_optional ')'
  96  data_type_ref_list_optional : data_type_ref_list
  97                              |
  98  data_type_ref_list : data_type_ref_list ',' data_type_ref
  99                     | data_type_ref
 100  base_data_type : INT_TYPE
 101                 | BOOL_TYPE
 102  declare_datatype_proto : optional_export optional_template_specification DEFTYPE ID DEFINEOP data_type_ref optional_port_formal_decl_list_in_parens
 103  defdatatype : declare_datatype_proto '{' optional_datatype_body set_body_optional get_body_optional '}'
 104  set_body_optional : set_body
 105                    |
 106  get_body_optional : get_body
 107                    |
 108  set_body : SET '{' chp_body_optional '}'
 109  get_body : GET '{' chp_body_optional '}'
 110  declare_enum : ENUM ID
 111  defenum : ENUM ID '{' enum_member_list '}'
 112  enum_member_list : enum_member_list ',' ID
 113                   | ID
 114  declare_chan_proto : optional_export optional_template_specification DEFCHAN ID DEFINEOP base_chan_type optional_port_formal_decl_list_in_parens
 115  defchan : declare_chan_proto '{' optional_datatype_body send_body_optional recv_body_optional '}'
 116  send_body_optional : send_body
 117                     |
 118  recv_body_optional : recv_body
 119                     |
 120  send_body : SEND '{' chp_body_optional '}'
 121  recv_body : RECV '{' chp_body_optional '}'
 122  definition_body : definition_body definition_body_item
 123                  | definition_body_item
 124  definition_body_item : instance_item_extended
 125                       | type_alias
 126  optional_definition_body : definition_body
 127                           |
 128  optional_datatype_body : datatype_body
 129                         |
 130  datatype_body : datatype_body datatype_body_item
 131                | datatype_body_item
 132  datatype_body_item : connection_body_item
 133                     | lang_spec
 134  connection_body_optional : connection_body
 135                           |
 136  connection_body : connection_body connection_body_item
 137                  | connection_body_item
 138  connection_body_item_base : connection_statement
 139                            | nonempty_alias_list ';'
 140                            | instance_direction_statement
 141                            | instance_type_completion_statement
 142                            | instance_type_completion_connection_statement
 143                            | instance_attribute_statement
 144  connection_body_item : connection_body_item_base
 145                       | loop_connections
 146                       | conditional_connections
 147  instance_management_list_optional : instance_management_list
 148                                    |
 149  instance_management_list : instance_management_list instance_item_extended
 150                           | instance_item_extended
 151  instance_item_extended : instance_item
 152                         | language_body
 153  instance_item : type_instance_declaration
 154                | connection_body_item_base
 155                | loop_instantiation
 156                | conditional_instantiation
 157  loop_instantiation : '(' ';' ID ':' range ':' instance_management_list ')'
 158  conditional_instantiation : '[' guarded_instance_management_list ']'
 159  loop_connections : '(' ';' ID ':' range ':' connection_body ')'
 160  conditional_connections : '[' guarded_connection_body ']'
 161  type_instance_declaration : type_id instance_id_list ';'
 162  instance_id_list : instance_id_list ',' instance_id_item
 163                   | instance_id_item
 164  instance_id_item : ID optional_template_arguments_in_angles sparse_range_list
 165                   | ID optional_template_arguments_in_angles
 166                   | ID optional_template_arguments_in_angles extended_connection_actuals_list
 167                   | ID optional_template_arguments_in_angles '=' alias_list
 168  connection_statement : member_index_expr extended_connection_actuals_list ';'
 169  extended_connection_actuals_list : optional_implicit_global_connections connection_actuals_list
 170                                   | implicit_global_connections
 171  optional_implicit_global_connections : implicit_global_connections
 172                                       |
 173  implicit_global_connections : '$' member_index_expr_list_in_parens
 174  generic_attribute : ID '=' expr_list
 175                    | ID
 176                    | string
 177  generic_attribute_list : generic_attribute_list ';' generic_attribute
 178                         | generic_attribute
 179  generic_attribute_list_in_brackets : '[' generic_attribute_list ']'
 180  instance_type_completion_statement : index_expr complex_expr_optional_list_in_angles ';'
 181                                     | generic_id complex_expr_optional_list_in_angles ';'
 182  instance_direction_statement : member_index_expr chan_dir ';'
 183  instance_attribute_statement : member_index_expr '@' generic_attribute_list_in_brackets ';'
 184  instance_type_completion_connection_statement : index_expr complex_expr_optional_list_in_angles extended_connection_actuals_list ';'
 185                                                | generic_id complex_expr_optional_list_in_angles extended_connection_actuals_list ';'
 186  nonempty_alias_list : nonempty_alias_list '=' complex_aggregate_reference
 187                      | complex_aggregate_reference '=' complex_aggregate_reference
 188  alias_list : alias_list '=' complex_aggregate_reference
 189             | complex_aggregate_reference
 190  connection_actuals_list : '(' complex_aggregate_reference_list ')'
 191  guarded_instance_management_list : guarded_instance_management_list_unmatched THICKBAR instance_management_else_clause
 192                                   | guarded_instance_management_list_unmatched
 193  guarded_instance_management_list_unmatched : guarded_instance_management_list_unmatched THICKBAR guarded_instance_management
 194                                             | guarded_instance_management
 195  guarded_instance_management : expr RARROW instance_management_list_optional
 196  instance_management_else_clause : ELSE RARROW instance_management_list_optional
 197  guarded_connection_body : guarded_connection_body_unmatched THICKBAR connection_body_else_clause
 198                          | guarded_connection_body_unmatched
 199  guarded_connection_body_unmatched : guarded_connection_body_unmatched THICKBAR guarded_connection_body_clause
 200                                    | guarded_connection_body_clause
 201  guarded_connection_body_clause : expr RARROW connection_body_optional
 202  connection_body_else_clause : ELSE RARROW connection_body_optional
 203  language_body : CHP_LANG '{' chp_body_optional '}'
 204                | HSE_LANG '{' hse_body_optional '}'
 205                | PRS_LANG member_index_expr_list_in_angles_optional '{' prs_body_optional '}'
 206                | lang_spec
 207  lang_spec : SPEC_LANG '{' spec_body_optional '}'
 208  chp_body : full_chp_body_item_list
 209  chp_body_optional : chp_body
 210                    |
 211  chp_body_or_skip : chp_body
 212                   | SKIP
 213  chp_sequence_group : '{' full_chp_body_item_list '}'
 214  full_chp_body_item_list : full_chp_body_item_list ';' full_chp_body_item
 215                          | full_chp_body_item
 216  full_chp_body_item : chp_concurrent_group
 217  chp_body_item : chp_statement_attributes chp_statement
 218                | chp_statement
 219  chp_statement_attributes : '$' '(' generic_attribute_list ')'
 220  chp_statement : chp_loop
 221                | chp_do_until
 222                | chp_selection
 223                | chp_wait
 224                | chp_binary_assignment
 225                | chp_bool_assignment
 226                | chp_send
 227                | chp_recv
 228                | chp_peek
 229                | chp_metaloop_selection
 230                | chp_metaloop_statement
 231                | function_call_expr
 232  chp_loop : BEGINLOOP chp_body ']'
 233  chp_do_until : BEGINLOOP chp_unmatched_det_guarded_command_list ']'
 234  chp_wait : '[' chp_guard_expr ']'
 235  chp_selection : '[' chp_matched_det_guarded_command_list ']'
 236                | '[' chp_nondet_guarded_command_list ']'
 237  chp_metaloop_selection : '[' ':' ID ':' range ':' chp_guarded_command ']'
 238                         | '[' THICKBAR ID ':' range ':' chp_guarded_command ']'
 239  chp_metaloop_statement : '{' ',' ID ':' range ':' chp_body '}'
 240                         | '{' ';' ID ':' range ':' chp_body '}'
 241  chp_nondet_guarded_command_list : chp_nondet_guarded_command_list ':' chp_guarded_command
 242                                  | chp_guarded_command ':' chp_guarded_command
 243  chp_matched_det_guarded_command_list : chp_unmatched_det_guarded_command_list THICKBAR chp_else_clause
 244                                       | chp_unmatched_det_guarded_command_list
 245  chp_unmatched_det_guarded_command_list : chp_unmatched_det_guarded_command_list THICKBAR chp_guarded_command
 246                                         | chp_guarded_command
 247  chp_guarded_command : chp_guard_expr RARROW chp_body_or_skip
 248  chp_guard_expr : chp_logical_or_expr
 249  chp_unary_bool_expr : chp_simple_bool_expr
 250                      | chp_not_expr
 251                      | '(' chp_logical_or_expr ')'
 252                      | chp_probe_expr
 253                      | function_call_expr
 254  chp_probe_expr : '#' member_index_expr
 255  chp_simple_bool_expr : member_index_expr
 256                       | BOOL_TRUE
 257                       | BOOL_FALSE
 258  chp_unary_expr : '-' chp_unary_expr
 259                 | chp_unary_bool_expr
 260                 | loop_expr
 261                 | INT
 262                 | FLOAT
 263  chp_mult_expr : chp_unary_expr
 264                | chp_mult_expr muldiv_op chp_unary_expr
 265  chp_add_expr : chp_mult_expr
 266               | chp_add_expr_only
 267  chp_add_expr_only : chp_add_expr '+' chp_mult_expr
 268                    | chp_add_expr '-' chp_mult_expr
 269  chp_paren_add_expr : '(' chp_add_expr_only ')'
 270                     | chp_mult_expr
 271  chp_shift_expr : chp_paren_add_expr
 272                 | chp_shift_expr EXTRACT chp_add_expr
 273                 | chp_shift_expr INSERT chp_add_expr
 274  chp_relational_expr : chp_shift_expr relational_op chp_shift_expr
 275                      | chp_paren_add_expr
 276  chp_bitwise_and_expr : chp_relational_expr
 277                       | chp_bitwise_and_expr '&' chp_relational_expr
 278  chp_bitwise_xor_expr : chp_bitwise_and_expr
 279                       | chp_bitwise_xor_expr '^' chp_bitwise_and_expr
 280  chp_bitwise_or_expr : chp_bitwise_xor_expr
 281                      | chp_bitwise_or_expr '|' chp_bitwise_xor_expr
 282  chp_logical_and_expr : chp_bitwise_or_expr
 283                       | chp_logical_and_expr LOGICAL_AND chp_bitwise_or_expr
 284  chp_logical_or_expr : chp_logical_and_expr
 285                      | chp_logical_or_expr LOGICAL_OR chp_logical_and_expr
 286  chp_not_expr : '~' chp_unary_bool_expr
 287  chp_else_clause : ELSE RARROW chp_body_or_skip
 288  chp_binary_assignment : member_index_expr ASSIGN expr
 289  chp_bool_assignment : member_index_expr '+'
 290                      | member_index_expr '-'
 291  chp_concurrent_item : chp_body_item
 292                      | chp_sequence_group
 293  chp_concurrent_group : chp_concurrent_group ',' chp_concurrent_item
 294                       | chp_concurrent_item
 295  chp_send : member_index_expr '!' connection_actuals_list
 296           | member_index_expr '!'
 297  chp_recv : member_index_expr '?' member_index_expr_list_in_parens_optional
 298  chp_peek : member_index_expr '#' member_index_expr_list_in_parens
 299  hse_body_optional : hse_body
 300                    |
 301  hse_body : full_hse_body_item_list
 302  full_hse_body_item_list : full_hse_body_item_list ';' full_hse_body_item
 303                          | full_hse_body_item
 304  full_hse_body_item : hse_body_item
 305  hse_body_item : hse_loop
 306                | hse_do_until
 307                | hse_wait
 308                | hse_selection
 309                | hse_assignment
 310                | SKIP
 311  hse_loop : BEGINLOOP hse_body ']'
 312  hse_do_until : BEGINLOOP hse_matched_det_guarded_command_list ']'
 313  hse_wait : '[' expr ']'
 314  hse_selection : '[' hse_matched_det_guarded_command_list ']'
 315                | '[' hse_nondet_guarded_command_list ']'
 316  hse_guarded_command : expr RARROW hse_body
 317  hse_else_clause : ELSE RARROW hse_body
 318  hse_nondet_guarded_command_list : hse_nondet_guarded_command_list ':' hse_guarded_command
 319                                  | hse_guarded_command ':' hse_guarded_command
 320  hse_matched_det_guarded_command_list : hse_unmatched_det_guarded_command_list THICKBAR hse_else_clause
 321                                       | hse_unmatched_det_guarded_command_list
 322  hse_unmatched_det_guarded_command_list : hse_unmatched_det_guarded_command_list THICKBAR hse_guarded_command
 323                                         | hse_guarded_command
 324  hse_assignment : unary_assignment
 325  prs_body_optional : prs_body
 326                    |
 327  prs_body : prs_body prs_body_item
 328           | prs_body_item
 329  prs_body_item : single_prs
 330                | prs_loop
 331                | prs_conditional
 332                | prs_macro
 333                | TREE_LANG optional_template_arguments_in_angles '{' prs_body_optional '}'
 334                | SUBCKT_LANG optional_template_arguments_in_angles '{' prs_body_optional '}'
 335  prs_macro : prs_literal mandatory_member_index_expr_list_in_parens
 336            | generic_attribute_list_in_brackets prs_literal mandatory_member_index_expr_list_in_parens
 337  prs_loop : '(' ':' ID ':' range ':' prs_body ')'
 338  prs_conditional : '[' prs_guarded_list ']'
 339  prs_guarded_list : prs_guarded_list_unmatched THICKBAR prs_else_clause
 340                   | prs_guarded_list_unmatched
 341  prs_guarded_list_unmatched : prs_guarded_list_unmatched THICKBAR prs_guarded_body
 342                             | prs_guarded_body
 343  prs_guarded_body : expr RARROW prs_body_optional
 344  prs_else_clause : ELSE RARROW prs_body_optional
 345  single_prs : generic_attribute_list_in_brackets prs_expr prs_arrow prs_literal_base dir
 346             | prs_expr prs_arrow prs_literal_base dir
 347  prs_arrow : RARROW
 348            | IMPLIES
 349            | HASH_ARROW
 350  dir : '+'
 351      | '-'
 352  prs_expr : prs_or
 353  prs_paren_expr : '(' prs_expr ')'
 354  prs_literal_base : relative_member_index_expr
 355                   | '@' ID optional_dense_range_list
 356  prs_literal : prs_literal_base prs_literal_params_in_angles_optional
 357  prs_literal_params_in_angles_optional : '<' prs_literal_params_optional ';' generic_attribute_list '>'
 358                                        | '<' prs_literal_params '>'
 359                                        |
 360  prs_literal_params_optional : prs_literal_params
 361                              |
 362  prs_literal_params : prs_literal_params ',' prs_literal_param
 363                     | prs_literal_param
 364  prs_literal_param : expr
 365  prs_unary_expr : prs_literal
 366                 | prs_paren_expr
 367                 | prs_and_loop
 368                 | prs_or_loop
 369  prs_not : '~' prs_unary_expr
 370          | prs_unary_expr
 371  prs_and : prs_and '&' prs_operator_attribute_optional prs_not
 372          | prs_not
 373  prs_or : prs_or '|' prs_and
 374         | prs_and
 375  prs_operator_attribute : '{' dir prs_expr '}'
 376  prs_operator_attribute_optional : prs_operator_attribute
 377                                  |
 378  prs_and_loop : '(' '&' ':' ID ':' range ':' prs_expr ')'
 379  prs_or_loop : '(' '|' ':' ID ':' range ':' prs_expr ')'
 380  spec_body_optional : spec_body
 381                     |
 382  spec_body : spec_body spec_item
 383            | spec_item
 384  spec_item : spec_directive
 385            | spec_invariant
 386  spec_invariant : '$' '(' prs_expr ')'
 387                 | '$' '(' prs_expr ',' string ')'
 388  spec_directive : ID expr_list_in_angles_optional grouped_reference_list_in_parens
 389  grouped_reference_list_in_parens : '(' grouped_reference_list_optional ')'
 390  grouped_reference_list_optional : grouped_reference_list
 391                                  |
 392  grouped_reference_list : grouped_reference_list ',' grouped_reference
 393                         | grouped_reference
 394  grouped_reference : '{' mandatory_member_index_expr_list '}'
 395                    | member_index_expr
 396  paren_expr : '(' expr ')'
 397  literal : INT
 398          | FLOAT
 399          | string
 400          | BOOL_TRUE
 401          | BOOL_FALSE
 402  string : string STRING
 403         | STRING
 404  id_expr : generic_id
 405  generic_id : relative_id
 406             | absolute_id
 407  absolute_id : SCOPE relative_id
 408  relative_id : qualified_id
 409              | ID
 410  qualified_id : qualified_id SCOPE ID
 411               | ID SCOPE ID
 412  mandatory_member_index_expr_list_in_parens : '(' mandatory_member_index_expr_list ')'
 413  mandatory_member_index_expr_list : mandatory_member_index_expr_list ',' member_index_expr
 414                                   | member_index_expr
 415  member_index_expr_list : member_index_expr_list ',' optional_member_index_expr
 416                         | optional_member_index_expr
 417  member_index_expr_pair : optional_member_index_expr ',' optional_member_index_expr
 418                         | optional_member_index_expr
 419  optional_member_index_expr : member_index_expr
 420                             |
 421  member_index_expr : id_expr
 422                    | index_expr
 423                    | member_expr
 424  relative_member_index_expr : ID
 425                             | local_index_expr
 426                             | local_member_expr
 427  local_index_expr : local_member_expr sparse_range_list
 428                   | ID sparse_range_list
 432  index_expr : member_expr sparse_range_list
 433             | id_expr sparse_range_list
 437  simple_expr : member_index_expr
 438              | literal
 439  unary_expr : simple_expr
 440             | function_call_expr
 441             | paren_expr
 442             | loop_expr
 443             | '-' unary_expr
 444             | '!' unary_expr
 445             | '~' unary_expr
 446  function_call_expr : member_index_expr optional_implicit_global_connections connection_actuals_list
 447  multiplicative_expr : unary_expr
 448                      | multiplicative_expr muldiv_op unary_expr
 449  muldiv_op : '*'
 450            | '/'
 451            | '%'
 452  additive_expr : multiplicative_expr
 453                | additive_expr '+' multiplicative_expr
 454                | additive_expr '-' multiplicative_expr
 455  shift_expr : additive_expr
 456             | shift_expr EXTRACT additive_expr
 457             | shift_expr INSERT additive_expr
 458  relational_equality_expr : shift_expr
 459                           | '(' relational_equality_expr '<' shift_expr ')'
 460                           | '(' relational_equality_expr '>' shift_expr ')'
 461                           | relational_equality_expr LE shift_expr
 462                           | relational_equality_expr GE shift_expr
 463                           | relational_equality_expr EQUAL shift_expr
 464                           | relational_equality_expr NOTEQUAL shift_expr
 465                           | '(' relational_equality_expr '=' shift_expr ')'
 466  relational_op : '<'
 467                | '>'
 468                | LE
 469                | GE
 470                | EQUAL
 471                | NOTEQUAL
 472  and_expr : relational_equality_expr
 473           | and_expr '&' relational_equality_expr
 474  exclusive_or_expr : and_expr
 475                    | exclusive_or_expr '^' and_expr
 476  inclusive_or_expr : exclusive_or_expr
 477                    | inclusive_or_expr '|' exclusive_or_expr
 478  logical_and_expr : inclusive_or_expr
 479                   | logical_and_expr LOGICAL_AND inclusive_or_expr
 480  logical_or_expr : logical_and_expr
 481                  | logical_or_expr LOGICAL_OR logical_and_expr
 482  unary_assignment : member_index_expr PLUSPLUS
 483                   | member_index_expr MINUSMINUS
 484  loop_expr : '(' loop_assoc_op ':' ID ':' range ':' expr ')'
 485  loop_assoc_op : '+'
 486                | '*'
 487                | '&'
 488                | '|'
 489                | '^'
 490                | LOGICAL_AND
 491                | LOGICAL_OR
 492  expr : logical_or_expr
 493  strict_relaxed_template_arguments : complex_expr_optional_list_in_angles optional_template_arguments_in_angles
 494                                    |
 495  optional_template_arguments_in_angles : complex_expr_optional_list_in_angles
 496                                        |
 497  expr_list_in_angles_optional : expr_list_in_angles
 498                               |
 499  expr_list_in_angles : '<' expr_list '>'
 500  complex_expr_optional_list_in_angles : '<' complex_expr_optional_list '>'
 501  complex_expr_optional_list : complex_expr_optional_list ',' optional_complex_expr
 502                             | optional_complex_expr
 503  optional_complex_expr : array_concatenation
 504                        |
 505  member_index_expr_list_in_parens_optional : member_index_expr_list_in_parens
 506                                            |
 507  member_index_expr_list_in_parens : '(' member_index_expr_list ')'
 508  member_index_expr_list_in_angles_optional : member_index_expr_list_in_angles
 509                                            |
 510  member_index_expr_list_in_angles : '<' member_index_expr_pair '>'
 511                                   | '<' member_index_expr_pair '|' member_index_expr_pair '>'
 512  expr_list : expr_list ',' expr
 513            | expr
 514  range : expr RANGE expr
 515        | expr
 516  optional_dense_range_list : dense_range_list
 517                            |
 518  dense_range_list : dense_range_list bracketed_dense_range
 519                   | bracketed_dense_range
 520  sparse_range_list : sparse_range_list bracketed_sparse_range
 521                    | bracketed_sparse_range
 522  bracketed_dense_range : '[' expr ']'
 523  bracketed_sparse_range : '[' range ']'
 524  complex_aggregate_reference : array_concatenation
 525  array_concatenation : array_concatenation '#' complex_expr_term
 526                      | complex_expr_term
 527  complex_expr_term : array_construction
 528                    | expr
 529  array_construction : '{' mandatory_complex_aggregate_reference_list '}'
 530  optional_complex_aggregate_reference : complex_aggregate_reference
 531                                       |
 532  mandatory_complex_aggregate_reference_list : mandatory_complex_aggregate_reference_list ',' complex_aggregate_reference
 533                                             | complex_aggregate_reference
 534  complex_aggregate_reference_list : complex_aggregate_reference_list ',' optional_complex_aggregate_reference
 535                                   | optional_complex_aggregate_reference