pippijn.opp.exp 72.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
%{
open Ast
open ParseUtil
open Sclass
open Tqual

let desg dg_sloc dg = { dg; dg_sloc; }
let decl d_sloc d = { d; d_sloc; }
let stmt s_sloc s = { s; s_sloc; }
let expr e_sloc e = { e; e_sloc; e_type = { t = EmptyType; t_sloc = e_sloc; }; e_cval = Constant.NonConst; }
let ctyp t_sloc t = { t; t_sloc; }

let (@@) f x = f x






%}
%start parse_decl
%start parse_expr
%start parse_stmt
%start parse_type
%start parse_unit
%start test
%token EOF
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
%token KW_ALIGNOF
%token KW_ASM
%token KW_ATTRIBUTE
%token KW_ATTR_ALIAS
%token KW_ATTR_ALIGNED
%token KW_ATTR_ALLOC_SIZE
%token KW_ATTR_ALTIVEC
%token KW_ATTR_ALWAYS_INLINE
%token KW_ATTR_ARTIFICIAL
%token KW_ATTR_BACK_SWITCH
%token KW_ATTR_BASED
%token KW_ATTR_BELOW100
%token KW_ATTR_CALLEE_POP_AGGREGATE_RETURN
%token KW_ATTR_CB
%token KW_ATTR_CDECL
%token KW_ATTR_CLEANUP
%token KW_ATTR_COLD
%token KW_ATTR_COMMON
%token KW_ATTR_CONST
%token KW_ATTR_CONSTRUCTOR
%token KW_ATTR_DEPRECATED
%token KW_ATTR_DESTRUCTOR
%token KW_ATTR_DISINTERRUPT
%token KW_ATTR_DLLEXPORT
%token KW_ATTR_DLLIMPORT
%token KW_ATTR_EIGHTBIT_DATA
%token KW_ATTR_EXCEPTION_HANDLER
%token KW_ATTR_EXTERNALLY_VISIBLE
%token KW_ATTR_FAR
%token KW_ATTR_FASTCALL
%token KW_ATTR_FAST_INTERRUPT
%token KW_ATTR_FLATTEN
%token KW_ATTR_FORCE_ALIGN_ARG_POINTER
%token KW_ATTR_FORMAT
%token KW_ATTR_FORMAT_ARG
%token KW_ATTR_FUNCTION_VECTOR
%token KW_ATTR_GCC_STRUCT
%token KW_ATTR_GNU_INLINE
%token KW_ATTR_HOT
%token KW_ATTR_IFUNC
%token KW_ATTR_INTERRUPT
%token KW_ATTR_INTERRUPT_HANDLER
%token KW_ATTR_INTERRUPT_THREAD
%token KW_ATTR_IO
%token KW_ATTR_ISR
%token KW_ATTR_KSPISUSP
%token KW_ATTR_L1_DATA
%token KW_ATTR_L1_DATA_A
%token KW_ATTR_L1_DATA_B
%token KW_ATTR_L1_TEXT
%token KW_ATTR_L2
%token KW_ATTR_LEAF
%token KW_ATTR_LONGCALL
%token KW_ATTR_LONG_CALL
%token KW_ATTR_MALLOC
%token KW_ATTR_MAY_ALIAS
%token KW_ATTR_MIPS16
%token KW_ATTR_MODE
%token KW_ATTR_MODEL
%token KW_ATTR_MS_ABI
%token KW_ATTR_MS_HOOK_PROLOGUE
%token KW_ATTR_MS_STRUCT
%token KW_ATTR_NAKED
%token KW_ATTR_NEAR
%token KW_ATTR_NESTING
%token KW_ATTR_NMI_HANDLER
%token KW_ATTR_NOCLONE
%token KW_ATTR_NOCOMMON
%token KW_ATTR_NOINLINE
%token KW_ATTR_NOMIPS16
%token KW_ATTR_NONNULL
%token KW_ATTR_NORETURN
%token KW_ATTR_NOTHROW
%token KW_ATTR_NOTSHARED
%token KW_ATTR_NO_INSTRUMENT_FUNCTION
%token KW_ATTR_NO_SPLIT_STACK
%token KW_ATTR_OPTIMIZE
%token KW_ATTR_OS_MAIN
%token KW_ATTR_OS_TASK
%token KW_ATTR_PACKED
%token KW_ATTR_PCS
%token KW_ATTR_PROGMEM
%token KW_ATTR_PURE
%token KW_ATTR_REGPARM
%token KW_ATTR_RESBANK
%token KW_ATTR_RETURNS_TWICE
%token KW_ATTR_SAVEALL
%token KW_ATTR_SAVE_VOLATILES
%token KW_ATTR_SECTION
%token KW_ATTR_SELECTANY
%token KW_ATTR_SENTINEL
%token KW_ATTR_SHARED
%token KW_ATTR_SHORTCALL
%token KW_ATTR_SHORT_CALL
%token KW_ATTR_SIGNAL
%token KW_ATTR_SPU_VECTOR
%token KW_ATTR_SP_SWITCH
%token KW_ATTR_SSEREGPARM
%token KW_ATTR_STDCALL
%token KW_ATTR_SYSCALL_LINKAGE
%token KW_ATTR_SYSV_ABI
%token KW_ATTR_TARGET
%token KW_ATTR_THISCALL
%token KW_ATTR_TINY
%token KW_ATTR_TINY_DATA
%token KW_ATTR_TLS_MODEL
%token KW_ATTR_TRANSPARENT_UNION
%token KW_ATTR_TRAP_EXIT
%token KW_ATTR_UNUSED
%token KW_ATTR_USED
%token KW_ATTR_VECTOR_SIZE
%token KW_ATTR_VERSION_ID
%token KW_ATTR_VISIBILITY
%token KW_ATTR_VLIW
%token KW_ATTR_WARN_UNUSED_RESULT
%token KW_ATTR_WEAK
%token KW_ATTR_WEAKREF
%token KW_AUTO
%token KW_BOOL
%token KW_BREAK
%token KW_CASE
%token KW_CHAR
%token KW_COMPLEX
%token KW_CONST
%token KW_CONTINUE
%token KW_DATATYPE
%token <int> KW_DECIMALN
%token KW_DECLSPEC
%token KW_DEFAULT
%token KW_DO
%token KW_DOUBLE
159
%token KW_ELSE
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
%token KW_ENUM
%token KW_EXTENSION
%token KW_EXTERN
%token KW_FASTCALL
%token KW_FLOAT
%token <int> KW_FLOATN
%token KW_FOR
%token KW_GOTO
%token KW_IF
%token KW_IMAG
%token KW_INLINE
%token KW_INT
%token <int> KW_INTN
%token KW_LABEL
%token KW_LONG
%token KW_OFFSETOF
%token KW_REAL
%token KW_REGISTER
%token KW_RESTRICT
%token KW_RETURN
%token KW_SHORT
%token KW_SIGNED
%token KW_SIZEOF
%token KW_STATIC
%token KW_STRUCT
%token KW_SWITCH
%token KW_THREAD
%token KW_TYPEDEF
%token KW_TYPEOF
%token KW_TYPES_COMPATIBLE_P
%token KW_UNION
%token KW_UNSIGNED
%token KW_VA_ARG
%token KW_VA_LIST
%token KW_VOID
%token KW_VOLATILE
%token KW_WCHAR_T
%token KW_WHILE
%token TK_AND
%token TK_ANDAND
%token TK_AND_EQ
%token TK_ARROW
%token <string * string option> TK_BIN_CONSTANT
%token TK_CARET
%token TK_CARET_EQ
%token <string> TK_CHAR_CONSTANT
%token TK_COLON
%token TK_COMMA
%token TK_DEC
%token TK_ELLIPSIS
%token TK_EQEQ
%token TK_EQUALS
%token TK_EXMARK
%token <string * string option> TK_FLOATING_CONSTANT
%token TK_GREATER
%token TK_GREATER_EQ
%token TK_GTGT
%token TK_GTGT_EQ
%token <string * string option> TK_HEX_CONSTANT
%token <string * string option> TK_HEX_FLOATING_CONSTANT
%token <string> TK_IDENTIFIER
%token TK_INC
%token <string> TK_INCLUDE
%token <string * string option> TK_INTEGER_CONSTANT
%token TK_LBRACE
%token TK_LBRACK
%token TK_LESS
%token TK_LESS_EQ
%token TK_LSQBRACK
%token TK_LTLT
%token TK_LTLT_EQ
%token TK_MINUS
%token TK_MINUS_EQ
%token TK_NE
%token <string * string option> TK_OCTAL_CONSTANT
%token TK_PERCENT
%token TK_PERCENT_EQ
%token TK_PERIOD
%token TK_PIPE
%token TK_PIPEPIPE
%token TK_PIPE_EQ
%token TK_PLUS
%token TK_PLUS_EQ
%token TK_QMARK
%token TK_RBRACE
%token TK_RBRACK
%token TK_RSQBRACK
%token TK_SEMICOLON
%token TK_SLASH
%token TK_SLASH_EQ
%token TK_STAR
%token TK_STAR_EQ
%token <string> TK_STRING_LITERAL
%token TK_TILDE
%token <string> TK_TYPEDEF_NAME
%token <string> TK_WCHAR_CONSTANT
%token <string> TK_WSTRING_LITERAL
%token <string> WC_DECL
%token <string> WC_EXPR
%token <string> WC_TYPE
260 261
%nonassoc KW_IF
%nonassoc KW_ELSE
262 263 264 265 266 267 268 269 270
%type <Ast.decl> parse_decl
%type <Ast.expr> parse_expr
%type <Ast.stmt> parse_stmt
%type <Ast.ctyp> parse_type
%type <Ast.decl> parse_unit
%type <bool> test
%%

parse_unit:
271
  _1 = push_scope _2 = external_definitions _3 = pop_scope _4 = EOF
272 273 274 275 276 277 278 279 280
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TranslationUnit (List.rev _2) )}
| _1 = EOF
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TranslationUnit ([]) )}

parse_decl:
281
  _1 = push_scope _2 = declaration _3 = pop_scope _4 = EOF
282 283 284
    {  ( _2 )}

parse_expr:
285
  _1 = push_scope _2 = expression _3 = pop_scope _4 = EOF
286 287 288
    {  ( _2 )}

parse_stmt:
289
  _1 = push_scope _2 = statement _3 = pop_scope _4 = EOF
290 291 292
    {  ( _2 )}

parse_type:
293
  _1 = push_scope _2 = type_name _3 = pop_scope _4 = EOF
294 295 296
    {  ( _2 )}

test:
297
  _1 = parse_unit
298 299 300
    {  ( true )}

external_definitions:
301
  _1 = external_definition
302 303 304 305 306
    {  ( if _1.d == EmptyDecl then [] else [_1] )}
| _1 = external_definitions _2 = external_definition
    {  ( if _2.d == EmptyDecl then _1 else _2 :: _1 )}

external_definition:
307
  _1 = list_attribute_ _2 = declaration
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
    {  ( attr _1 _2 )}
| _1 = list_attribute_ _2 = default_toplevel_declaring_list _3 = TK_SEMICOLON
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( attr _1 (decl (_startpos, _endpos) @@ DeclaringList (List.rev _2)) )}
| _1 = list_attribute_ _2 = function_definition
    {  ( attr _1 _2 )}
| _1 = KW_ASM _2 = TK_LBRACK _3 = nonempty_list_TK_STRING_LITERAL_ _4 = TK_RBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ ToplevelAsm _3 )}
| _1 = TK_SEMICOLON
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ EmptyDecl )}
| _1 = TK_INCLUDE
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ PreprocessorDirective ("#include " ^ _1) )}
| _1 = KW_EXTENSION _2 = external_definition
    {  ( _2 )}

function_definition:
331
  _1 = function_declaration _2 = compound_statement
332 333 334 335 336 337
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( Decls.leave_function ();
    decl (_startpos, _endpos) @@ FunctionDefinition (_1, _2) )}

function_declaration:
338
  decl = old_function_declaration
339 340 341 342 343
    {  ( Decls.enter_function decl; decl )}
| decl = std_function_declaration
    {  ( Decls.enter_function decl; decl )}

std_function_declaration:
344
  _1 = default_int _2 = identifier_declarator
345 346 347 348 349 350 351
    {  ( Decls.set_base_type _2 _1 )}
| _1 = declaration_qualifier_list _2 = default_int _3 = identifier_declarator
    {  ( Decls.set_base_type (Decls.merge_decls _1 _3) _2 )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int _3 = identifier_declarator
    {  ( Decls.set_base_type _3 (Types.add_tqual _2 _1) )}

old_function_declaration:
352
  _1 = default_int _2 = old_function_declarator _3 = list_declaration_
353 354 355 356 357 358 359 360 361 362 363
    {  ( Decls.add_parameter_types (Decls.set_base_type _2 _1) _3 )}
| _1 = declaration_specifier _2 = old_function_declarator _3 = list_declaration_
    {  ( Decls.add_parameter_types (Decls.merge_decls _1 _2) _3 )}
| _1 = type_specifier _2 = old_function_declarator _3 = list_declaration_
    {  ( Decls.add_parameter_types (Decls.set_base_type _2 _1) _3 )}
| _1 = declaration_qualifier_list _2 = default_int _3 = old_function_declarator _4 = list_declaration_
    {  ( Decls.add_parameter_types (Decls.set_base_type (Decls.merge_decls _1 _3) _2) _4 )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int _3 = old_function_declarator _4 = list_declaration_
    {  ( Decls.add_parameter_types (Decls.set_base_type _3 (Types.add_tqual _2 _1)) _4 )}

old_function_declarator:
364
  _1 = postfix_old_function_declarator
365 366 367 368 369 370 371 372 373 374 375
    {  ( _1 )}
| _1 = TK_STAR _2 = list_attribute_ _3 = old_function_declarator
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( attr _2 (Decls.set_base_type _3 (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType))) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_ _4 = old_function_declarator
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( attr _2 (Decls.set_base_type _4 (Types.add_tqual (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType)) _3)) )}

postfix_old_function_declarator:
376
  _1 = paren_identifier_declarator _2 = TK_LBRACK _3 = sep_TK_COMMA_simple_identifier_declarator_ _4 = TK_RBRACK
377 378 379 380 381 382 383 384 385
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.empty, ctyp (_startpos, _endpos) @@ FunctionType (ctyp (_startpos, _endpos) @@ EmptyType, List.map (fun id -> Decls.set_base_type id default_int) _3), _1, Decls.empty, None) )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = old_function_declarator _4 = TK_RBRACK
    {  ( attr _2 _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = old_function_declarator _4 = TK_RBRACK _5 = postfixing_abstract_declarator
    {  ( attr _2 (Decls.set_base_type _3 _5) )}

declaration:
386
  _1 = declaring_list _2 = TK_SEMICOLON
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ DeclaringList (List.rev _1) )}
| _1 = default_declaring_list _2 = TK_SEMICOLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ DeclaringList (List.rev _1) )}
| _1 = sue_declaration_specifier _2 = TK_SEMICOLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ DeclaringList [_1] )}
| _1 = sue_type_specifier _2 = TK_SEMICOLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ DeclaringList [abstract_decl _1] )}
| _1 = attr_function_declaration
    {  ( _1 )}

attr_function_declaration:
406
  _1 = attr_function_declarator _2 = compound_statement
407 408 409 410 411 412
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( Decls.leave_function ();
    attr (fst _1) (decl (_startpos, _endpos) @@ FunctionDefinition (snd _1, _2)) )}

attr_function_declarator:
413
  _1 = attr_function_declarator_
414 415 416
    {  ( Decls.enter_function (snd _1); _1 )}

attr_function_declarator_:
417
  _1 = declaration_specifier _2 = identifier_declarator
418 419 420 421 422 423 424 425 426
    {  ( [], Decls.merge_decls _1 _2 )}
| _1 = type_specifier _2 = identifier_declarator
    {  ( [], Decls.set_base_type _2 _1 )}
| _1 = declaration_specifier_nosue _2 = nonempty_list_attribute_ _3 = identifier_declarator
    {  ( _2, Decls.merge_decls _1 _3 )}
| _1 = type_specifier_nosue _2 = nonempty_list_attribute_ _3 = identifier_declarator
    {  ( _2, Decls.set_base_type _3 _1 )}

declaring_list:
427
  _1 = declaration_specifier _2 = declarator _3 = option_asm_declaration_specifier_ _4 = list_attribute_ _5 = option_decl_initialiser_
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
    {  ( [attr _4 (Decls.finish_decl (Decls.merge_decls _1 _2) (ast_from_opt _3) _5)] )}
| _1 = declaration_specifier_nosue _2 = nonempty_list_attribute_ _3 = declarator _4 = option_asm_declaration_specifier_ _5 = list_attribute_ _6 = option_decl_initialiser_
    {  ( [attr (_2 @ _5) (Decls.finish_decl (Decls.merge_decls _1 _3) (ast_from_opt _4) _6)] )}
| _1 = type_specifier _2 = declarator _3 = option_asm_declaration_specifier_ _4 = list_attribute_ _5 = option_decl_initialiser_
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( [attr _4 (Decls.finish_decl (Decls.merge_decls (decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.empty, _1, Decls.empty, Decls.empty, None)) _2) (ast_from_opt _3) _5)] )}
| _1 = type_specifier_nosue _2 = nonempty_list_attribute_ _3 = declarator _4 = option_asm_declaration_specifier_ _5 = list_attribute_ _6 = option_decl_initialiser_
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( [attr (_2 @ _5) (Decls.finish_decl (Decls.merge_decls (decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.empty, _1, Decls.empty, Decls.empty, None)) _3) (ast_from_opt _4) _6)] )}
| _1 = declaring_list _2 = TK_COMMA _3 = list_attribute_ _4 = declarator _5 = option_asm_declaration_specifier_ _6 = list_attribute_ _7 = option_decl_initialiser_
    {  ( attr (_3 @ _6) (Decls.finish_decl (Decls.merge_decls (Decls.decl_base_type (List.hd _1)) _4) (ast_from_opt _5) _7) :: _1 )}

default_declaring_list:
443
  _1 = declaration_qualifier_list _2 = default_int _3 = identifier_declarator _4 = option_asm_declaration_specifier_ _5 = list_attribute_ _6 = option_decl_initialiser_
444 445 446 447 448 449 450
    {  ( [attr _5 (Decls.finish_decl (Decls.merge_decls (Decls.set_base_type _1 _2) _3) (ast_from_opt _4) _6)] )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int _3 = identifier_declarator _4 = option_asm_declaration_specifier_ _5 = list_attribute_ _6 = option_decl_initialiser_
    {  ( [attr _5 (Decls.finish_decl (Decls.set_base_type _3 (Types.add_tqual _2 _1)) (ast_from_opt _4) _6)] )}
| _1 = default_declaring_list _2 = TK_COMMA _3 = list_attribute_ _4 = identifier_declarator _5 = option_asm_declaration_specifier_ _6 = list_attribute_ _7 = option_decl_initialiser_
    {  ( attr (_3 @ _6) (Decls.finish_decl (Decls.merge_decls (Decls.decl_base_type (List.hd _1)) _4) (ast_from_opt _5) _7) :: _1 )}

default_toplevel_declaring_list:
451
  _1 = default_int _2 = identifier_declarator _3 = option_asm_declaration_specifier_ _4 = list_attribute_ _5 = option_decl_initialiser_
452 453 454 455 456
    {  ( [attr _4 (Decls.finish_decl (Decls.set_base_type _2 _1) (ast_from_opt _3) _5)] )}
| _1 = default_toplevel_declaring_list _2 = TK_COMMA _3 = identifier_declarator _4 = option_asm_declaration_specifier_ _5 = list_attribute_ _6 = option_decl_initialiser_
    {  ( attr _5 (Decls.finish_decl (Decls.merge_decls (Decls.decl_base_type (List.hd _1)) _3) (ast_from_opt _4) _6) :: _1 )}

declaration_specifier:
457
  _1 = declaration_specifier_nosue
458 459 460 461 462
    {                               ( _1 )}
| _1 = sue_declaration_specifier
    {                             ( _1 )}

declaration_specifier_nosue:
463
  _1 = basic_declaration_specifier
464 465 466 467 468 469 470 471 472 473 474
    {                               ( _1 )}
| _1 = typedef_declaration_specifier
    {                                 ( _1 )}
| _1 = typeof_declaration_specifier
    {                                ( _1 )}
| _1 = WC_TYPE
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
           ( decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.empty, ctyp (_startpos, _endpos) @@ WildcardType _1, Decls.empty, Decls.empty, None) )}

basic_declaration_specifier:
475
  _1 = basic_type_specifier _2 = storage_class
476 477 478 479 480 481 482 483 484 485 486
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.add Sclass.empty _2, _1, Decls.empty, Decls.empty, None) )}
| _1 = declaration_qualifier_list _2 = basic_type_name
    {  ( Decls.add_basic_type _1 _2 )}
| _1 = basic_declaration_specifier _2 = declaration_qualifier
    {  ( Decls.add_dqual _1 _2 )}
| _1 = basic_declaration_specifier _2 = basic_type_name
    {  ( Decls.add_basic_type _1 _2 )}

sue_declaration_specifier:
487
  _1 = sue_type_specifier _2 = storage_class
488 489 490 491 492 493 494 495 496
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.add Sclass.empty _2, _1, Decls.empty, Decls.empty, None) )}
| _1 = declaration_qualifier_list _2 = elaborated_type_name
    {  ( Decls.set_base_type _1 _2 )}
| _1 = sue_declaration_specifier _2 = declaration_qualifier
    {  ( Decls.add_dqual _1 _2 )}

typeof_declaration_specifier:
497
  _1 = typeof_type_specifier _2 = storage_class
498 499 500 501 502 503 504 505 506
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.add Sclass.empty _2, _1, Decls.empty, Decls.empty, None) )}
| _1 = declaration_qualifier_list _2 = typeof_type_name
    {  ( Decls.set_base_type _1 _2 )}
| _1 = typeof_declaration_specifier _2 = declaration_qualifier
    {  ( Decls.add_dqual _1 _2 )}

typedef_declaration_specifier:
507
  _1 = typedef_type_specifier _2 = storage_class
508 509 510 511 512 513 514 515 516 517 518
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.add Sclass.empty _2, _1, Decls.empty, Decls.empty, None) )}
| _1 = declaration_qualifier_list _2 = TK_TYPEDEF_NAME
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( Decls.set_base_type _1 (ctyp (_startpos, _endpos) @@ TypedefType _2) )}
| _1 = typedef_declaration_specifier _2 = declaration_qualifier
    {  ( Decls.add_dqual _1 _2 )}

declaration_qualifier_list:
519
  _1 = storage_class _2 = list_attribute_
520 521 522 523 524 525 526 527 528 529 530
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( attr _2 (decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.add Sclass.empty _1, ctyp (_startpos, _endpos) @@ EmptyType, Decls.empty, Decls.empty, None)) )}
| _1 = nonempty_list_type_qualifier_ _2 = list_attribute_ _3 = storage_class _4 = list_attribute_
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( attr (_2 @ _4) (decl (_startpos, _endpos) @@ TypedDecl ("", Sclass.add Sclass.empty _3, Types.add_tqual (ctyp (_startpos, _endpos) @@ EmptyType) _1, Decls.empty, Decls.empty, None)) )}
| _1 = declaration_qualifier_list _2 = declaration_qualifier _3 = list_attribute_
    {  ( attr _3 (Decls.add_dqual _1 _2) )}

declaration_qualifier:
531
  _1 = type_qualifier
532 533 534 535 536
    {                  ( (None, Some _1) )}
| _1 = storage_class
    {                 ( (Some _1, None) )}

type_specifier:
537
  _1 = type_specifier_nosue
538 539 540 541 542
    {                        ( _1 )}
| _1 = sue_type_specifier
    {                      ( _1 )}

type_specifier_nosue:
543
  _1 = basic_type_specifier
544 545 546 547 548 549 550
    {                        ( _1 )}
| _1 = typedef_type_specifier
    {                          ( _1 )}
| _1 = typeof_type_specifier
    {                         ( _1 )}

basic_type_specifier:
551
  _1 = basic_type_name
552 553 554 555 556 557 558 559 560 561 562 563 564
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ PartialBasicType [_1] )}
| _1 = nonempty_list_type_qualifier_ _2 = basic_type_name
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( Types.add_tqual (ctyp (_startpos, _endpos) @@ PartialBasicType [_2]) _1 )}
| _1 = basic_type_specifier _2 = type_qualifier
    {  ( Types.add_tqual _1 [_2] )}
| _1 = basic_type_specifier _2 = basic_type_name
    {  ( Types.add_basic_type _1 _2 )}

sue_type_specifier:
565
  _1 = elaborated_type_name
566 567 568 569 570 571 572
    {  ( _1 )}
| _1 = nonempty_list_type_qualifier_ _2 = elaborated_type_name
    {  ( Types.add_tqual _2 _1 )}
| _1 = sue_type_specifier _2 = type_qualifier
    {  ( Types.add_tqual _1 [_2] )}

typedef_type_specifier:
573
  _1 = TK_TYPEDEF_NAME
574 575 576 577 578 579 580 581 582 583 584
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ TypedefType _1 )}
| _1 = nonempty_list_type_qualifier_ _2 = TK_TYPEDEF_NAME
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( Types.add_tqual (ctyp (_startpos, _endpos) @@ TypedefType _2) _1 )}
| _1 = typedef_type_specifier _2 = type_qualifier
    {  ( Types.add_tqual _1 [_2] )}

typeof_type_specifier:
585
  _1 = typeof_type_name
586 587 588 589 590 591 592
    {  ( _1 )}
| _1 = nonempty_list_type_qualifier_ _2 = typeof_type_name
    {  ( Types.add_tqual _2 _1 )}
| _1 = typeof_type_specifier _2 = type_qualifier
    {  ( Types.add_tqual _1 [_2] )}

typeof_type_name:
593
  _1 = KW_TYPEOF _2 = TK_LBRACK _3 = type_specifier _4 = TK_RBRACK
594 595 596 597 598 599 600 601 602
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ TypeofType _3 )}
| _1 = KW_TYPEOF _2 = TK_LBRACK _3 = expression _4 = TK_RBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ TypeofExpr _3 )}

elaborated_type_name:
603
  _1 = struct_or_union_specifier
604 605 606 607 608 609 610
    {                             ( _1 )}
| _1 = enum_specifier _2 = list_attribute_
    {                             ( _1 )}
| _1 = datatype_specifier
    {                      ( _1 )}

declarator:
611
  _1 = paren_typedef_declarator
612 613 614 615 616 617 618 619 620 621 622
    {                            ( _1 )}
| _1 = parameter_typedef_declarator
    {                                ( _1 )}
| _1 = identifier_declarator
    {                         ( _1 )}
| _1 = old_function_declarator
    {                           ( _1 )}
| _1 = KW_EXTENSION _2 = declarator
    {                           ( _2 )}

paren_typedef_declarator:
623
  _1 = paren_postfix_typedef_declarator
624 625 626 627 628 629 630 631 632 633 634
    {  ( _1 )}
| _1 = TK_STAR _2 = list_attribute_ _3 = paren_typedef_declarator
    {  ( attr _2 (Decls.add_pointer_type _3) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = TK_LBRACK _4 = list_attribute_ _5 = simple_paren_typedef_declarator _6 = TK_RBRACK
    {  ( attr (_2 @ _4) (Decls.add_pointer_type _5) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_ _4 = TK_LBRACK _5 = list_attribute_ _6 = simple_paren_typedef_declarator _7 = TK_RBRACK
    {  ( attr (_2 @ _5) (Decls.add_tqual (Decls.add_pointer_type _6) _3) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_ _4 = paren_typedef_declarator
    {  ( attr _2 (Decls.add_tqual (Decls.add_pointer_type _4) _3) )}

paren_postfix_typedef_declarator:
635
  _1 = TK_LBRACK _2 = list_attribute_ _3 = paren_typedef_declarator _4 = TK_RBRACK
636 637 638 639 640 641 642
    {  ( attr _2 _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = simple_paren_typedef_declarator _4 = postfixing_abstract_declarator _5 = TK_RBRACK
    {  ( attr _2 (Decls.set_base_type _3 _4) )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = paren_typedef_declarator _4 = TK_RBRACK _5 = postfixing_abstract_declarator
    {  ( attr _2 (Decls.set_base_type _3 _5) )}

simple_paren_typedef_declarator:
643
  _1 = simple_typedef_declarator
644 645 646 647 648
    {  ( _1 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = simple_paren_typedef_declarator _4 = TK_RBRACK
    {  ( attr _2 _3 )}

parameter_typedef_declarator:
649
  _1 = simple_typedef_declarator
650 651 652 653 654 655 656
    {  ( _1 )}
| _1 = simple_typedef_declarator _2 = postfixing_abstract_declarator
    {  ( Decls.set_base_type _1 _2 )}
| _1 = clean_typedef_declarator
    {  ( _1 )}

simple_typedef_declarator:
657
  _1 = TK_TYPEDEF_NAME
658 659 660 661 662
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ IdentifierDeclarator ([], _1) )}

clean_typedef_declarator:
663
  _1 = clean_postfix_typedef_declarator
664 665 666 667 668 669 670 671 672 673 674
    {  ( _1 )}
| _1 = TK_STAR _2 = list_attribute_ _3 = parameter_typedef_declarator
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( attr _2 (Decls.set_base_type _3 (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType))) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_ _4 = parameter_typedef_declarator
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( attr _2 (Decls.set_base_type _4 (Types.add_tqual (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType)) _3)) )}

clean_postfix_typedef_declarator:
675
  _1 = TK_LBRACK _2 = list_attribute_ _3 = clean_typedef_declarator _4 = TK_RBRACK
676 677 678 679 680
    {  ( attr _2 _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = clean_typedef_declarator _4 = TK_RBRACK _5 = postfixing_abstract_declarator
    {  ( attr _2 (Decls.set_base_type _3 _5) )}

abstract_declarator:
681
  _1 = unary_abstract_declarator
682 683 684 685 686 687 688
    {                             ( _1 )}
| _1 = postfix_abstract_declarator
    {                               ( _1 )}
| _1 = postfixing_abstract_declarator
    {                                  ( _1 )}

unary_abstract_declarator:
689
  _1 = TK_STAR _2 = list_attribute_
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( Types.add_tqual (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType)) _3 )}
| _1 = TK_STAR _2 = list_attribute_ _3 = abstract_declarator
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( Types.set_base_type (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType)) _3 )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_ _4 = abstract_declarator
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( Types.set_base_type (Types.add_tqual (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType)) _3) _4 )}

postfix_abstract_declarator:
707
  _1 = TK_LBRACK _2 = list_attribute_ _3 = unary_abstract_declarator _4 = TK_RBRACK
708 709 710 711 712 713 714 715 716
    {  ( _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = postfix_abstract_declarator _4 = TK_RBRACK
    {  ( _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = postfixing_abstract_declarator _4 = TK_RBRACK
    {  ( _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = unary_abstract_declarator _4 = TK_RBRACK _5 = postfixing_abstract_declarator
    {  ( Types.set_base_type _5 _3 )}

postfixing_abstract_declarator:
717
  _1 = nonempty_list_array_abstract_declarator_
718 719 720 721 722 723 724
    {  ( Types.make_array_type _1 )}
| _1 = TK_LBRACK _2 = option_forward_parameter_type_list_ _3 = TK_RBRACK
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( let params, forwards = list_pair_from_opt _2 in ctyp (_startpos, _endpos) @@ FunctionType (ctyp (_startpos, _endpos) @@ EmptyType, params) )}

identifier_declarator:
725
  _1 = unary_identifier_declarator
726 727 728 729 730
    {                               ( _1 )}
| _1 = paren_identifier_declarator
    {                               ( _1 )}

unary_identifier_declarator:
731
  _1 = postfix_identifier_declarator
732 733 734 735 736 737 738 739 740 741 742
    {  ( _1 )}
| _1 = TK_STAR _2 = list_attribute_ _3 = identifier_declarator
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( attr _2 (Decls.set_base_type _3 (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType))) )}
| _1 = TK_STAR _2 = list_attribute_ _3 = nonempty_list_pointer_type_qualifier_ _4 = identifier_declarator
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( attr _2 (Decls.set_base_type _4 (Types.add_tqual (ctyp (_startpos, _endpos) @@ PointerType (ctyp (_startpos, _endpos) @@ EmptyType)) _3)) )}

postfix_identifier_declarator:
743
  _1 = paren_identifier_declarator _2 = postfixing_abstract_declarator
744 745 746 747 748 749 750
    {  ( Decls.set_base_type _1 _2 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = unary_identifier_declarator _4 = TK_RBRACK
    {  ( attr _2 _3 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = unary_identifier_declarator _4 = TK_RBRACK _5 = postfixing_abstract_declarator
    {  ( attr _2 (Decls.set_base_type _3 _5) )}

paren_identifier_declarator:
751
  _1 = simple_identifier_declarator
752 753 754 755 756 757 758 759 760
    {  ( _1 )}
| _1 = TK_LBRACK _2 = list_attribute_ _3 = paren_identifier_declarator _4 = TK_RBRACK
    {  ( attr _2 _3 )}
| _1 = WC_DECL
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ WildcardDecl _1 )}

simple_identifier_declarator:
761
  _1 = TK_IDENTIFIER
762 763 764 765 766
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ IdentifierDeclarator ([], _1) )}

type_name:
767
  _1 = list_attribute_ _2 = type_name_noattr
768 769 770
    {  ( _2 )}

type_name_noattr:
771
  _1 = type_specifier
772 773 774 775 776 777 778 779 780 781 782 783 784
    {  ( _1 )}
| _1 = type_specifier _2 = abstract_declarator
    {  ( Types.set_base_type _1 _2 )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int
    {  ( Types.add_tqual _2 _1 )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int _3 = abstract_declarator
    {  ( Types.set_base_type (Types.add_tqual _2 _1) _3 )}
| _1 = WC_TYPE
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ WildcardType _1 )}

decl_initialiser:
785
  _1 = TK_EQUALS _2 = basic_initialiser
786 787 788
    {  ( _2 )}

initialiser:
789
  _1 = basic_initialiser
790 791 792 793 794 795 796 797 798 799 800
    {  ( _1 )}
| _1 = member_designators _2 = basic_initialiser
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ DesignatedInitialiser (_1, _2) )}
| _1 = TK_LSQBRACK _2 = range_expression _3 = TK_RSQBRACK _4 = option_TK_EQUALS_ _5 = basic_initialiser
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ ArrayLabelledInitialiser (_2, _5) )}

member_designators:
801
  _1 = nonempty_list_member_designator_ _2 = TK_EQUALS
802 803 804 805 806 807 808 809 810
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( desg (_startpos, _endpos) @@ _1 )}
| _1 = TK_IDENTIFIER _2 = TK_COLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( desg (_startpos, _endpos) @@ [_1] )}

member_designator:
811
  _1 = TK_PERIOD _2 = TK_IDENTIFIER
812 813 814
    {  ( _2 )}

range_expression:
815
  _1 = assignment_expression
816 817 818 819 820 821 822
    {  ( _1 )}
| _1 = assignment_expression _2 = TK_ELLIPSIS _3 = assignment_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (OP_Ellipsis, _1, _3) )}

basic_initialiser:
823
  _1 = bracketed_initialiser_list
824 825 826 827 828
    {                              ( _1 )}
| _1 = assignment_expression
    {                         ( _1 )}

bracketed_initialiser_list:
829
  _1 = TK_LBRACE _2 = TK_RBRACE
830 831 832 833 834 835 836 837 838
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ InitialiserList [] )}
| _1 = TK_LBRACE _2 = sep_rev_TK_COMMA_initialiser_ _3 = option_TK_COMMA_ _4 = TK_RBRACE
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ InitialiserList (List.rev _2) )}

forward_parameter_type_list:
839
  _1 = sep_rev_TK_SEMICOLON_parameter_type_list_
840 841 842
    {  ( List.hd _1, List.rev (List.tl _1) )}

parameter_type_list:
843
  _1 = sep_rev_TK_COMMA_parameter_declaration_
844 845 846 847 848 849 850
    {  ( List.rev _1 )}
| _1 = sep_rev_TK_COMMA_parameter_declaration_ _2 = TK_COMMA _3 = TK_ELLIPSIS
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( List.rev (abstract_decl (ctyp (_startpos, _endpos) @@ PartialBasicType [BT_Ellipsis]) :: _1) )}

parameter_declaration:
851
  _1 = list_attribute_ _2 = parameter_declaration_noattr
852 853 854 855 856
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( assert (Predicates.is_decl _2); { _2 with d_sloc = (_startpos, _endpos) } )}

parameter_declaration_noattr:
857
  _1 = declaration_specifier
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886
    {  ( _1 )}
| _1 = declaration_specifier _2 = abstract_declarator
    {  ( Decls.merge_decls _1 (abstract_decl _2) )}
| _1 = declaration_specifier _2 = identifier_declarator _3 = list_attribute_
    {  ( attr _3 (Decls.merge_decls _1 _2) )}
| _1 = declaration_specifier _2 = parameter_typedef_declarator _3 = list_attribute_
    {  ( attr _3 (Decls.merge_decls _1 _2) )}
| _1 = declaration_qualifier_list _2 = default_int
    {  ( Decls.set_base_type _1 _2 )}
| _1 = declaration_qualifier_list _2 = default_int _3 = abstract_declarator
    {  ( Decls.set_base_type (Decls.merge_decls _1 (abstract_decl _3)) _2 )}
| _1 = declaration_qualifier_list _2 = default_int _3 = identifier_declarator _4 = list_attribute_
    {  ( attr _4 (Decls.set_base_type (Decls.merge_decls _1 _3) _2) )}
| _1 = type_specifier
    {  ( abstract_decl _1 )}
| _1 = type_specifier _2 = abstract_declarator
    {  ( abstract_decl (Types.set_base_type _1 _2) )}
| _1 = type_specifier _2 = identifier_declarator _3 = list_attribute_
    {  ( attr _3 (Decls.set_tspec _2 _1) )}
| _1 = type_specifier _2 = parameter_typedef_declarator _3 = list_attribute_
    {  ( attr _3 (Decls.set_tspec _2 _1) )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int
    {  ( abstract_decl (Types.add_tqual _2 _1) )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int _3 = abstract_declarator
    {  ( abstract_decl (Types.set_base_type (Types.add_tqual _2 _1) _3) )}
| _1 = nonempty_list_type_qualifier_ _2 = default_int _3 = identifier_declarator _4 = list_attribute_
    {  ( attr _4 (Decls.set_tspec _3 (Types.add_tqual _2 _1)) )}

array_abstract_declarator:
887
  _1 = TK_LSQBRACK _2 = option_constant_expression_ _3 = TK_RSQBRACK
888 889 890 891 892
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ ArrayType (_2, ctyp (_startpos, _endpos) @@ EmptyType) )}

primary_expression:
893
  _1 = identifier
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908
    {  ( _1 )}
| _1 = numeric_literal
    {  ( _1 )}
| _1 = string_literal
    {  ( _1 )}
| _1 = TK_LBRACK _2 = expression _3 = TK_RBRACK
    {  ( _2 )}
| _1 = statement_expression
    {  ( _1 )}
| _1 = WC_EXPR
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ WildcardExpr _1 )}

statement_expression:
909
  _1 = TK_LBRACK _2 = compound_statement _3 = TK_RBRACK
910 911 912 913 914
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BraceExpression _2 )}

postfix_expression:
915
  _1 = primary_expression
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966
    {  ( _1 )}
| _1 = postfix_expression _2 = TK_LSQBRACK _3 = expression _4 = TK_RSQBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ ArrayAccess (_1, _3) )}
| _1 = postfix_expression _2 = TK_LBRACK _3 = option_sep_TK_COMMA_assignment_expression__ _4 = TK_RBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ FunctionCall (_1, list_from_opt _3) )}
| _1 = postfix_expression _2 = TK_PERIOD _3 = identifier_or_typedef_name
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ MemberAccess (_1, _3) )}
| _1 = postfix_expression _2 = TK_ARROW _3 = identifier_or_typedef_name
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ PointerAccess (_1, _3) )}
| _1 = postfix_expression _2 = TK_PERIOD _3 = WC_DECL
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ MemberAccess (_1, _3) )}
| _1 = postfix_expression _2 = TK_ARROW _3 = WC_DECL
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ PointerAccess (_1, _3) )}
| _1 = postfix_expression _2 = TK_INC
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ UnaryExpression (OP_PostIncrement, _1) )}
| _1 = postfix_expression _2 = TK_DEC
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ UnaryExpression (OP_PostDecrement, _1) )}
| _1 = KW_OFFSETOF _2 = TK_LBRACK _3 = type_name _4 = TK_COMMA _5 = postfix_expression _6 = TK_RBRACK
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ Offsetof (_3, _5) )}
| _1 = KW_TYPES_COMPATIBLE_P _2 = TK_LBRACK _3 = type_name _4 = TK_COMMA _5 = type_name _6 = TK_RBRACK
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ TypesCompatibleP (_3, _5) )}
| _1 = KW_VA_ARG _2 = TK_LBRACK _3 = assignment_expression _4 = TK_COMMA _5 = type_name _6 = TK_RBRACK
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ VaArg (_3, _5) )}
| _1 = TK_LBRACK _2 = type_name _3 = TK_RBRACK _4 = bracketed_initialiser_list
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ CompoundLiteral (_2, _4) )}

unary_prefix_operator:
967
  _1 = TK_INC
968 969 970 971 972
    {          ( OP_PreIncrement )}
| _1 = TK_DEC
    {          ( OP_PreDecrement )}

unary_operator:
973
  _1 = TK_AND
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992
    {          ( OP_AddressOf )}
| _1 = TK_ANDAND
    {             ( OP_AddressOfLabel )}
| _1 = TK_STAR
    {           ( OP_Dereference )}
| _1 = TK_PLUS
    {           ( OP_Identity )}
| _1 = TK_MINUS
    {            ( OP_Negate )}
| _1 = TK_TILDE
    {            ( OP_BitwiseNot )}
| _1 = TK_EXMARK
    {             ( OP_LogicalNot )}
| _1 = KW_IMAG
    {           ( OP_Imag )}
| _1 = KW_REAL
    {           ( OP_Real )}

unary_expression:
993
  _1 = postfix_expression
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
    {  ( _1 )}
| _1 = unary_prefix_operator _2 = unary_expression
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ UnaryExpression (_1, _2) )}
| _1 = unary_operator _2 = cast_expression
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ UnaryExpression (_1, _2) )}
| _1 = KW_SIZEOF _2 = unary_expression
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ SizeofExpr (_2) )}
| _1 = KW_SIZEOF _2 = TK_LBRACK _3 = type_name _4 = TK_RBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ SizeofType (_3) )}
| _1 = KW_ALIGNOF _2 = TK_LBRACK _3 = unary_expression _4 = TK_RBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ AlignofExpr (_3) )}
| _1 = KW_ALIGNOF _2 = TK_LBRACK _3 = type_name _4 = TK_RBRACK
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ AlignofType (_3) )}
| _1 = KW_EXTENSION _2 = cast_expression
    {  ( _2 )}

cast_expression:
1023
  _1 = unary_expression
1024 1025 1026 1027 1028 1029 1030
    {  ( _1 )}
| _1 = TK_LBRACK _2 = type_name _3 = TK_RBRACK _4 = cast_expression
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ Cast (_2, _4) )}

multiplicative_operator:
1031
  _1 = TK_STAR
1032 1033 1034 1035 1036 1037 1038
    {           ( OP_Multiply )}
| _1 = TK_SLASH
    {            ( OP_Divide )}
| _1 = TK_PERCENT
    {              ( OP_Modulo )}

multiplicative_expression:
1039
  _1 = cast_expression
1040 1041 1042 1043 1044 1045 1046
    {  ( _1 )}
| _1 = multiplicative_expression _2 = multiplicative_operator _3 = cast_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

additive_operator:
1047
  _1 = TK_PLUS
1048 1049 1050 1051 1052
    {           ( OP_Add )}
| _1 = TK_MINUS
    {            ( OP_Subtract )}

additive_expression:
1053
  _1 = multiplicative_expression
1054 1055 1056 1057 1058 1059 1060
    {  ( _1 )}
| _1 = additive_expression _2 = additive_operator _3 = multiplicative_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

shift_operator:
1061
  _1 = TK_LTLT
1062 1063 1064 1065 1066
    {           ( OP_ShiftLeft )}
| _1 = TK_GTGT
    {           ( OP_ShiftRight )}

shift_expression:
1067
  _1 = additive_expression
1068 1069 1070 1071 1072 1073 1074
    {  ( _1 )}
| _1 = shift_expression _2 = shift_operator _3 = additive_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

relational_operator:
1075
  _1 = TK_LESS
1076 1077 1078 1079 1080 1081 1082 1083 1084
    {           ( OP_Less )}
| _1 = TK_GREATER
    {              ( OP_Greater )}
| _1 = TK_LESS_EQ
    {              ( OP_LessEqual )}
| _1 = TK_GREATER_EQ
    {                 ( OP_GreaterEqual )}

relational_expression:
1085
  _1 = shift_expression
1086 1087 1088 1089 1090 1091 1092
    {  ( _1 )}
| _1 = relational_expression _2 = relational_operator _3 = shift_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

equality_operator:
1093
  _1 = TK_EQEQ
1094 1095 1096 1097 1098
    {           ( OP_Equal )}
| _1 = TK_NE
    {         ( OP_NotEqual )}

equality_expression:
1099
  _1 = relational_expression
1100 1101 1102 1103 1104 1105 1106
    {  ( _1 )}
| _1 = equality_expression _2 = equality_operator _3 = relational_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

and_operator:
1107
  _1 = TK_AND
1108 1109 1110
    {          ( OP_BitwiseAnd )}

and_expression:
1111
  _1 = equality_expression
1112 1113 1114 1115 1116 1117 1118
    {  ( _1 )}
| _1 = and_expression _2 = and_operator _3 = equality_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

exclusive_or_operator:
1119
  _1 = TK_CARET
1120 1121 1122
    {            ( OP_BitwiseXor )}

exclusive_or_expression:
1123
  _1 = and_expression
1124 1125 1126 1127 1128 1129 1130
    {  ( _1 )}
| _1 = exclusive_or_expression _2 = exclusive_or_operator _3 = and_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

inclusive_or_operator:
1131
  _1 = TK_PIPE
1132 1133 1134
    {           ( OP_BitwiseOr )}

inclusive_or_expression:
1135
  _1 = exclusive_or_expression
1136 1137 1138 1139 1140 1141 1142
    {  ( _1 )}
| _1 = inclusive_or_expression _2 = inclusive_or_operator _3 = exclusive_or_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

logical_and_operator:
1143
  _1 = TK_ANDAND
1144 1145 1146
    {             ( OP_LogicalAnd )}

logical_and_expression:
1147
  _1 = inclusive_or_expression
1148 1149 1150 1151 1152 1153 1154
    {  ( _1 )}
| _1 = logical_and_expression _2 = logical_and_operator _3 = inclusive_or_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

logical_or_operator:
1155
  _1 = TK_PIPEPIPE
1156 1157 1158
    {               ( OP_LogicalOr )}

logical_or_expression:
1159
  _1 = logical_and_expression
1160 1161 1162 1163 1164 1165 1166
    {  ( _1 )}
| _1 = logical_or_expression _2 = logical_or_operator _3 = logical_and_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

conditional_expression:
1167
  _1 = logical_or_expression
1168 1169 1170 1171 1172 1173 1174
    {  ( _1 )}
| _1 = logical_or_expression _2 = TK_QMARK _3 = option_expression_ _4 = TK_COLON _5 = conditional_expression
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ TernaryExpression (OP_Conditional, _1, _3, _5) )}

assignment_operator:
1175
  _1 = TK_EQUALS
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198
    {             ( OP_Assign )}
| _1 = TK_STAR_EQ
    {              ( OP_MultiplyAssign )}
| _1 = TK_SLASH_EQ
    {               ( OP_DivideAssign )}
| _1 = TK_PERCENT_EQ
    {                 ( OP_ModuloAssign )}
| _1 = TK_PLUS_EQ
    {              ( OP_AddAssign )}
| _1 = TK_MINUS_EQ
    {               ( OP_SubtractAssign )}
| _1 = TK_LTLT_EQ
    {              ( OP_ShiftLeftAssign )}
| _1 = TK_GTGT_EQ
    {              ( OP_ShiftRightAssign )}
| _1 = TK_AND_EQ
    {             ( OP_BitwiseAndAssign )}
| _1 = TK_CARET_EQ
    {               ( OP_BitwiseXorAssign )}
| _1 = TK_PIPE_EQ
    {              ( OP_BitwiseOrAssign )}

assignment_expression:
1199
  _1 = conditional_expression
1200 1201 1202 1203 1204 1205 1206
    {  ( _1 )}
| _1 = cast_expression _2 = assignment_operator _3 = assignment_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (_2, _1, _3) )}

expression:
1207
  _1 = assignment_expression
1208 1209 1210 1211 1212 1213 1214
    {  ( _1 )}
| _1 = expression _2 = TK_COMMA _3 = assignment_expression
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ BinaryExpression (OP_Comma, _1, _3) )}

constant_expression:
1215
  _1 = conditional_expression
1216 1217 1218
    {  ( _1 )}

numeric_literal:
1219
  _1 = TK_INTEGER_CONSTANT
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ IntegerLiteral (LIT_Dec, fst _1, snd _1) )}
| _1 = TK_OCTAL_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ IntegerLiteral (LIT_Oct, fst _1, snd _1) )}
| _1 = TK_HEX_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ IntegerLiteral (LIT_Hex, fst _1, snd _1) )}
| _1 = TK_BIN_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ IntegerLiteral (LIT_Bin, fst _1, snd _1) )}
| _1 = TK_FLOATING_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ FloatingLiteral (LIT_Float, fst _1, snd _1) )}
| _1 = TK_HEX_FLOATING_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ FloatingLiteral (LIT_HexFloat, fst _1, snd _1) )}
| _1 = TK_CHAR_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ CharLiteral (LIT_Char, _1) )}
| _1 = TK_WCHAR_CONSTANT
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ CharLiteral (LIT_WChar, _1) )}

string_literal:
1253
  _1 = nonempty_list_simple_string_literal_
1254 1255 1256 1257 1258
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ merge_string_literals [] _1 )}

simple_string_literal:
1259
  _1 = TK_STRING_LITERAL
1260 1261 1262 1263 1264
    {  ( LIT_String, _1 )}
| _1 = TK_WSTRING_LITERAL
    {  ( LIT_WString, _1 )}

type_qualifier:
1265
  _1 = KW_CONST
1266 1267 1268 1269 1270 1271 1272 1273 1274
    {  ( TQ_Const )}
| _1 = KW_VOLATILE
    {  ( TQ_Volatile )}
| _1 = KW_RESTRICT
    {  ( TQ_Restrict )}
| _1 = KW_COMPLEX
    {  ( TQ_Complex )}

pointer_type_qualifier:
1275
  _1 = KW_CONST
1276 1277 1278 1279 1280 1281 1282
    {  ( TQ_Const )}
| _1 = KW_VOLATILE
    {  ( TQ_Volatile )}
| _1 = KW_RESTRICT
    {  ( TQ_Restrict )}

storage_class:
1283
  _1 = KW_TYPEDEF
1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298
    {  ( SC_Typedef )}
| _1 = KW_EXTERN
    {  ( SC_Extern )}
| _1 = KW_STATIC
    {  ( SC_Static )}
| _1 = KW_AUTO
    {  ( SC_Auto )}
| _1 = KW_REGISTER
    {  ( SC_Register )}
| _1 = KW_INLINE
    {  ( SC_Inline )}
| _1 = KW_THREAD
    {  ( SC_Thread )}

basic_type_name:
1299
  _1 = KW_SIGNED
1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330
    {  ( BT_Signed )}
| _1 = KW_UNSIGNED
    {  ( BT_Unsigned )}
| _1 = KW_BOOL
    {  ( BT_Bool )}
| _1 = KW_CHAR
    {  ( BT_Char )}
| _1 = KW_INT
    {  ( BT_Int )}
| _1 = KW_SHORT
    {  ( BT_Short )}
| _1 = KW_LONG
    {  ( BT_Long )}
| _1 = KW_FLOAT
    {  ( BT_Float )}
| _1 = KW_DOUBLE
    {  ( BT_Double )}
| _1 = KW_INTN
    {  ( BT_IntN _1 )}
| _1 = KW_FLOATN
    {  ( BT_FloatN _1 )}
| _1 = KW_DECIMALN
    {  ( BT_DecimalN _1 )}
| _1 = KW_VA_LIST
    {  ( BT_VaList )}
| _1 = KW_WCHAR_T
    {  ( BT_WCharT )}
| _1 = KW_VOID
    {  ( BT_Void )}

default_int:
1331
  
1332 1333 1334
    {  ( default_int )}

statement:
1335
  _1 = statement_noexpr
1336 1337 1338 1339 1340
    {                    ( _1 )}
| _1 = expression_statement
    {                        ( _1 )}

statement_noexpr:
1341
  _1 = labelled_statement
1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
    {                      ( _1 )}
| _1 = compound_statement
    {                      ( _1 )}
| _1 = selection_statement
    {                       ( _1 )}
| _1 = iteration_statement
    {                       ( _1 )}
| _1 = jump_statement
    {                  ( _1 )}
| _1 = asm_statement
    {                 ( _1 )}
| _1 = KW_EXTENSION _2 = statement_noexpr
    {                                 ( _2 )}

statement_or_declaration:
1357
  _1 = statement
1358 1359 1360 1361 1362 1363 1364
    {  ( _1 )}
| _1 = option_KW_EXTENSION_ _2 = list_attribute_ _3 = declaration
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ DeclarationStatement (attr _2 _3) )}

labelled_statement:
1365
  _1 = TK_IDENTIFIER _2 = TK_COLON _3 = statement
1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ LabelledStatement (_1, _3) )}
| _1 = KW_LABEL _2 = sep_TK_COMMA_TK_IDENTIFIER_ _3 = TK_SEMICOLON
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ LocalLabel _2 )}
| _1 = KW_CASE _2 = range_expression _3 = TK_COLON
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ CaseStatement _2 )}
| _1 = KW_DEFAULT _2 = TK_COLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ DefaultStatement )}

compound_statement:
1383
  _1 = TK_LBRACE _2 = push_scope _3 = list_statement_or_declaration_ _4 = pop_scope _5 = TK_RBRACE
1384 1385 1386 1387 1388
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ CompoundStatement ("", _3) )}

push_scope:
1389
  
1390 1391 1392
    {   ( Lexer_hack.push_scope () )}

pop_scope:
1393
  
1394 1395 1396
    {   ( Lexer_hack.pop_scope () )}

expression_statement:
1397
  _1 = option_expression_ _2 = TK_SEMICOLON
1398 1399 1400 1401 1402
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ ExpressionStatement _1 )}

selection_statement:
1403
  _1 = KW_IF _2 = TK_LBRACK _3 = expression _4 = TK_RBRACK _5 = statement %prec KW_IF
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ IfStatement (_3, _5, stmt (_startpos, _endpos) @@ EmptyStmt) )}
| _1 = KW_IF _2 = TK_LBRACK _3 = expression _4 = TK_RBRACK _5 = statement _6 = KW_ELSE _7 = statement
    {let _endpos = _endpos__7_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ IfStatement (_3, _5, _7) )}
| _1 = KW_SWITCH _2 = TK_LBRACK _3 = expression _4 = TK_RBRACK _5 = statement
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ SwitchStatement (_3, _5) )}

iteration_statement:
1417
  _1 = KW_WHILE _2 = TK_LBRACK _3 = expression _4 = TK_RBRACK _5 = statement
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ WhileStatement (_3, _5) )}
| _1 = KW_DO _2 = statement _3 = KW_WHILE _4 = TK_LBRACK _5 = expression _6 = TK_RBRACK _7 = TK_SEMICOLON
    {let _endpos = _endpos__7_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ DoWhileStatement (_2, _5) )}
| _1 = KW_FOR _2 = TK_LBRACK _3 = option_expression_ _4 = TK_SEMICOLON _5 = option_expression_ _6 = TK_SEMICOLON _7 = option_expression_ _8 = TK_RBRACK _9 = statement
    {let _endpos = _endpos__9_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ ForStatement (_3, _5, _7, _9) )}

jump_statement:
1431
  _1 = KW_GOTO _2 = expression _3 = TK_SEMICOLON
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ GotoStatement _2 )}
| _1 = KW_CONTINUE _2 = TK_SEMICOLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ ContinueStatement )}
| _1 = KW_BREAK _2 = TK_SEMICOLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ BreakStatement )}
| _1 = KW_RETURN _2 = option_expression_ _3 = TK_SEMICOLON
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ ReturnStatement _2 )}

struct_or_union_specifier:
1449
  _1 = struct_or_union _2 = list_attribute_ _3 = TK_LBRACE _4 = struct_declaration_list_opt _5 = TK_RBRACE _6 = list_attribute_
1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType (List.flatten _2, _1, "", _4) )}
| _1 = struct_or_union _2 = list_attribute_ _3 = identifier_or_typedef_name _4 = list_attribute_
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType (List.flatten _2, _1, _3, []) )}
| _1 = struct_or_union _2 = list_attribute_ _3 = identifier_or_typedef_name _4 = list_attribute_ _5 = TK_LBRACE _6 = struct_declaration_list_opt _7 = TK_RBRACE _8 = list_attribute_
    {let _endpos = _endpos__8_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType (List.flatten _2, _1, _3, _6) )}

struct_or_union:
1463
  _1 = KW_STRUCT
1464 1465 1466 1467 1468
    {  ( SUE_Struct )}
| _1 = KW_UNION
    {  ( SUE_Union )}

identifier:
1469
  _1 = TK_IDENTIFIER
1470 1471 1472 1473 1474
    {let _endpos = _endpos__1_ in
let _startpos = _startpos__1_ in
  ( expr (_startpos, _endpos) @@ Identifier (_1) )}

identifier_or_typedef_name:
1475
  _1 = TK_IDENTIFIER
1476 1477 1478 1479 1480
    {  ( _1 )}
| _1 = TK_TYPEDEF_NAME
    {  ( _1 )}

struct_declaration:
1481
  _1 = struct_declaring_list _2 = TK_SEMICOLON
1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ DeclaringList (List.rev _1) )}
| _1 = struct_default_declaring_list _2 = TK_SEMICOLON
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ DeclaringList (List.rev _1) )}
| _1 = KW_EXTENSION _2 = struct_declaration
    {  ( _2 )}

struct_declaration_list:
1493
  _1 = list_attribute_ _2 = struct_declaration
1494 1495 1496 1497 1498
    {  ( [_2] )}
| _1 = struct_declaration_list _2 = list_attribute_ _3 = struct_declaration
    {  ( _3 :: _1 )}

struct_declaration_list_opt:
1499
  
1500 1501 1502 1503 1504
    {  ( [Decls.empty] )}
| _1 = struct_declaration_list
    {  ( List.rev _1 )}

struct_default_declaring_list:
1505
  _1 = nonempty_list_type_qualifier_ _2 = struct_identifier_declarator
1506 1507 1508 1509 1510
    {  ( [Decls.add_tqual _2 _1] )}
| _1 = struct_default_declaring_list _2 = TK_COMMA _3 = struct_identifier_declarator
    {  ( _3 :: _1 )}

struct_declaring_list:
1511
  _1 = type_specifier _2 = struct_declarator
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522
    {  ( [Decls.set_tspec _2 _1] )}
| _1 = type_specifier_nosue _2 = nonempty_list_attribute_ _3 = struct_declarator
    {  ( [attr _2 (Decls.set_tspec _3 _1)] )}
| _1 = struct_declaring_list _2 = TK_COMMA _3 = struct_declarator
    {  ( (Decls.merge_decls (Decls.decl_base_type (List.hd _1)) _3) :: _1 )}
| _1 = struct_or_union _2 = list_attribute_ _3 = TK_LBRACE _4 = struct_declaration_list_opt _5 = TK_RBRACE
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( [attr _2 (Decls.set_tspec (decl (_startpos, _endpos) @@ StructDeclarator (Decls.empty, None)) (ctyp (_startpos, _endpos) @@ SUEType (List.flatten _2, _1, "", _4)))] )}

struct_declarator:
1523
  _1 = declarator _2 = option_bit_field_size_ _3 = list_attribute_
1524 1525 1526 1527 1528 1529 1530 1531 1532
    {let _endpos = _endpos__3_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ StructDeclarator (attr _3 _1, _2) )}
| _1 = bit_field_size _2 = list_attribute_
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ StructDeclarator (Decls.empty, Some _1) )}

struct_identifier_declarator:
1533
  _1 = default_int _2 = identifier_declarator _3 = option_bit_field_size_ _4 = list_attribute_
1534 1535 1536 1537 1538
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( Decls.set_tspec (decl (_startpos, _endpos) @@ StructDeclarator (attr _4 _2, _3)) _1 )}

bit_field_size:
1539
  _1 = TK_COLON _2 = constant_expression
1540 1541 1542
    {  ( _2 )}

enum_specifier:
1543
  _1 = KW_ENUM _2 = TK_LBRACE _3 = sep_rev_TK_COMMA_enumerator_ _4 = option_TK_COMMA_ _5 = TK_RBRACE
1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556
    {let _endpos = _endpos__5_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType ([], SUE_Enum, "", List.rev _3) )}
| _1 = KW_ENUM _2 = TK_IDENTIFIER _3 = TK_LBRACE _4 = sep_rev_TK_COMMA_enumerator_ _5 = option_TK_COMMA_ _6 = TK_RBRACE
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType ([], SUE_Enum, _2, List.rev _4) )}
| _1 = KW_ENUM _2 = TK_IDENTIFIER
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType ([], SUE_Enum, _2, []) )}

enumerator:
1557
  _1 = TK_IDENTIFIER _2 = option_enumerator_value_
1558 1559 1560 1561 1562
    {let _endpos = _endpos__2_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ Enumerator (_1, _2) )}

enumerator_value:
1563
  _1 = TK_EQUALS _2 = constant_expression
1564 1565 1566
    {  ( _2 )}

datatype_specifier:
1567
  _1 = KW_DATATYPE _2 = datatype_name _3 = TK_EQUALS _4 = datatype_declaring_list
1568 1569 1570 1571 1572
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( ctyp (_startpos, _endpos) @@ SUEType ([], SUE_Enum, _2, []) )}

datatype_name:
1573
  _1 = identifier_or_typedef_name
1574 1575 1576
    {  ( Lexer_hack.typedef _1; _1 )}

datatype_declaring_list:
1577
  _1 = TK_PIPE _2 = sep_TK_PIPE_datatype_declarator_
1578 1579 1580
    {  ( 0 )}

datatype_declarator:
1581
  _1 = TK_IDENTIFIER _2 = datatype_member_list
1582 1583 1584
    {  ( 0 )}

datatype_member_list:
1585
  _1 = TK_LBRACK _2 = sep_TK_COMMA_datatype_member_ _3 = TK_RBRACK
1586 1587 1588
    {  ( 0 )}

datatype_member:
1589
  _1 = TK_IDENTIFIER _2 = TK_COLON _3 = type_name
1590 1591 1592
    {  ( 0 )}

asm_declaration_specifier:
1593
  _1 = KW_ASM _2 = TK_LBRACK _3 = nonempty_list_TK_STRING_LITERAL_ _4 = TK_RBRACK
1594 1595 1596 1597 1598
    {let _endpos = _endpos__4_ in
let _startpos = _startpos__1_ in
  ( decl (_startpos, _endpos) @@ AsmSpecifier _3 )}

asm_statement:
1599
  _1 = KW_ASM _2 = boption_KW_VOLATILE_ _3 = TK_LBRACK _4 = nonempty_list_TK_STRING_LITERAL_ _5 = TK_RBRACK _6 = TK_SEMICOLON
1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620
    {let _endpos = _endpos__6_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ AsmStatement (_2, _4, [], [], [], []) )}
| _1 = KW_ASM _2 = boption_KW_VOLATILE_ _3 = TK_LBRACK _4 = nonempty_list_TK_STRING_LITERAL_ _5 = TK_COLON _6 = option_asm_argument_list_ _7 = TK_RBRACK _8 = TK_SEMICOLON
    {let _endpos = _endpos__8_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ AsmStatement (_2, _4, list_from_opt _6, [], [], []) )}
| _1 = KW_ASM _2 = boption_KW_VOLATILE_ _3 = TK_LBRACK _4 = nonempty_list_TK_STRING_LITERAL_ _5 = TK_COLON _6 = option_asm_argument_list_ _7 = TK_COLON _8 = option_asm_argument_list_ _9 = TK_RBRACK _10 = TK_SEMICOLON
    {let _endpos = _endpos__10_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ AsmStatement (_2, _4, list_from_opt _6, list_from_opt _8, [], []) )}
| _1 = KW_ASM _2 = boption_KW_VOLATILE_ _3 = TK_LBRACK _4 = nonempty_list_TK_STRING_LITERAL_ _5 = TK_COLON _6 = option_asm_argument_list_ _7 = TK_COLON _8 = option_asm_argument_list_ _9 = TK_COLON _10 = option_sep_TK_COMMA_asm_clobbered__ _11 = TK_RBRACK _12 = TK_SEMICOLON
    {let _endpos = _endpos__12_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ AsmStatement (_2, _4, list_from_opt _6, list_from_opt _8, list_from_opt _10, []) )}
| _1 = KW_ASM _2 = boption_KW_VOLATILE_ _3 = KW_GOTO _4 = TK_LBRACK _5 = nonempty_list_TK_STRING_LITERAL_ _6 = TK_COLON _7 = TK_COLON _8 = option_asm_argument_list_ _9 = TK_COLON _10 = option_sep_TK_COMMA_asm_clobbered__ _11 = TK_COLON _12 = sep_TK_COMMA_TK_IDENTIFIER_ _13 = TK_RBRACK _14 = TK_SEMICOLON
    {let _endpos = _endpos__14_ in
let _startpos = _startpos__1_ in
  ( stmt (_startpos, _endpos) @@ AsmStatement (_2, _5, [], list_from_opt _8, list_from_opt _10, _12) )}

asm_argument_list:
1621
  _1 = sep_TK_COMMA_asm_argument_
1622 1623 1624
    {  ( _1 )}

asm_argument:
1625
  _1 = nonempty_list_TK_STRING_LITERAL_ _2 = TK_LBRACK _3 = assignment_expression _4 = TK_RBRACK
1626 1627 1628
    {  ( AsmArgument (_1, _3) )}

asm_clobbered:
1629
  _1 = nonempty_list_TK_STRING_LITERAL_
1630 1631
    {  ( _1 )}

1632 1633
sep_TK_COMMA_TK_IDENTIFIER_:
  _1 = sep_rev_TK_COMMA_TK_IDENTIFIER_
1634 1635
    {                       ( List.rev _1 )}

1636 1637
sep_TK_COMMA_asm_argument_:
  _1 = sep_rev_TK_COMMA_asm_argument_
1638 1639
    {                       ( List.rev _1 )}

1640 1641
sep_TK_COMMA_asm_clobbered_:
  _1 = sep_rev_TK_COMMA_asm_clobbered_
1642 1643
    {                       ( List.rev _1 )}

1644 1645
sep_TK_COMMA_assignment_expression_:
  _1 = sep_rev_TK_COMMA_assignment_expression_
1646 1647 1648
    {                       ( List.rev _1 )}

sep_TK_COMMA_attrib_:
1649
  _1 = sep_rev_TK_COMMA_attrib_
1650 1651
    {                       ( List.rev _1 )}

1652 1653
sep_TK_COMMA_datatype_member_:
  _1 = sep_rev_TK_COMMA_datatype_member_
1654 1655
    {                       ( List.rev _1 )}

1656 1657
sep_TK_COMMA_numeric_literal_:
  _1 = sep_rev_TK_COMMA_numeric_literal_
1658 1659
    {                       ( List.rev _1 )}

1660 1661
sep_TK_COMMA_simple_identifier_declarator_:
  _1 = sep_rev_TK_COMMA_simple_identifier_declarator_
1662 1663
    {                       ( List.rev _1 )}

1664 1665
sep_TK_PIPE_datatype_declarator_:
  _1 = sep_rev_TK_PIPE_datatype_declarator_
1666 1667
    {                       ( List.rev _1 )}

1668 1669
sep_rev_TK_COMMA_TK_IDENTIFIER_:
  _1 = TK_IDENTIFIER
1670
    {  ( [_1] )}
1671
| _1 = sep_rev_TK_COMMA_TK_IDENTIFIER_ _2 = TK_COMMA _3 = TK_IDENTIFIER
1672 1673
    {  ( _3 :: _1 )}

1674 1675
sep_rev_TK_COMMA_asm_argument_:
  _1 = asm_argument
1676
    {  ( [_1] )}
1677
| _1 = sep_rev_TK_COMMA_asm_argument_ _2 = TK_COMMA _3 = asm_argument
1678 1679
    {  ( _3 :: _1 )}

1680 1681
sep_rev_TK_COMMA_asm_clobbered_:
  _1 = asm_clobbered
1682
    {  ( [_1] )}
1683
| _1 = sep_rev_TK_COMMA_asm_clobbered_ _2 = TK_COMMA _3 = asm_clobbered
1684 1685
    {  ( _3 :: _1 )}

1686 1687
sep_rev_TK_COMMA_assignment_expression_:
  _1 = assignment_expression
1688
    {  ( [_1] )}
1689
| _1 = sep_rev_TK_COMMA_assignment_expression_ _2 = TK_COMMA _3 = assignment_expression
1690 1691
    {  ( _3 :: _1 )}

1692 1693
sep_rev_TK_COMMA_attrib_:
  _1 = attrib
1694
    {  ( [_1] )}
1695
| _1 = sep_rev_TK_COMMA_attrib_ _2 = TK_COMMA _3 = attrib
1696 1697
    {  ( _3 :: _1 )}

1698 1699
sep_rev_TK_COMMA_datatype_member_:
  _1 = datatype_member
1700
    {  ( [_1] )}
1701
| _1 = sep_rev_TK_COMMA_datatype_member_ _2 = TK_COMMA _3 = datatype_member
1702 1703 1704
    {  ( _3 :: _1 )}

sep_rev_TK_COMMA_enumerator_:
1705
  _1 = enumerator
1706 1707 1708 1709
    {  ( [_1] )}
| _1 = sep_rev_TK_COMMA_enumerator_ _2 = TK_COMMA _3 = enumerator
    {  ( _3 :: _1 )}

1710 1711
sep_rev_TK_COMMA_initialiser_:
  _1 = initialiser
1712
    {  ( [_1] )}
1713
| _1 = sep_rev_TK_COMMA_initialiser_ _2 = TK_COMMA _3 = initialiser
1714 1715
    {  ( _3 :: _1 )}

1716 1717
sep_rev_TK_COMMA_numeric_literal_:
  _1 = numeric_literal
1718
    {  ( [_1] )}
1719
| _1 = sep_rev_TK_COMMA_numeric_literal_ _2 = TK_COMMA _3 = numeric_literal
1720 1721
    {  ( _3 :: _1 )}

1722 1723
sep_rev_TK_COMMA_parameter_declaration_:
  _1 = parameter_declaration
1724
    {  ( [_1] )}
1725
| _1 = sep_rev_TK_COMMA_parameter_declaration_ _2 = TK_COMMA _3 = parameter_declaration
1726 1727
    {  ( _3 :: _1 )}

1728 1729
sep_rev_TK_COMMA_simple_identifier_declarator_:
  _1 = simple_identifier_declarator
1730
    {  ( [_1] )}
1731
| _1 = sep_rev_TK_COMMA_simple_identifier_declarator_ _2 = TK_COMMA _3 = simple_identifier_declarator
1732 1733
    {  ( _3 :: _1 )}

1734 1735
sep_rev_TK_PIPE_datatype_declarator_:
  _1 = datatype_declarator
1736
    {  ( [_1] )}
1737
| _1 = sep_rev_TK_PIPE_datatype_declarator_ _2 = TK_PIPE _3 = datatype_declarator
1738 1739
    {  ( _3 :: _1 )}

1740 1741
sep_rev_TK_SEMICOLON_parameter_type_list_:
  _1 = parameter_type_list
1742
    {  ( [_1] )}
1743
| _1 = sep_rev_TK_SEMICOLON_parameter_type_list_ _2 = TK_SEMICOLON _3 = parameter_type_list
1744 1745
    {  ( _3 :: _1 )}

1746 1747
list_attribute_:
  _1 = list_rev_attribute_
1748 1749 1750
    {                     ( List.rev _1 )}

list_declaration_:
1751
  _1 = list_rev_declaration_
1752 1753
    {                     ( List.rev _1 )}

1754 1755
list_statement_or_declaration_:
  _1 = list_rev_statement_or_declaration_
1756 1757
    {                     ( List.rev _1 )}

1758
list_rev_attribute_:
1759
  
1760
    {  ( [] )}
1761
| _1 = list_rev_attribute_ _2 = attribute
1762 1763 1764
    {  ( _2 :: _1 )}

list_rev_declaration_:
1765
  
1766 1767 1768 1769
    {  ( [] )}
| _1 = list_rev_declaration_ _2 = declaration
    {  ( _2 :: _1 )}

1770
list_rev_statement_or_declaration_:
1771
  
1772
    {  ( [] )}
1773
| _1 = list_rev_statement_or_declaration_ _2 = statement_or_declaration
1774 1775
    {  ( _2 :: _1 )}

1776 1777
nonempty_list_TK_STRING_LITERAL_:
  _1 = nonempty_list_rev_TK_STRING_LITERAL_
1778 1779
    {                                       ( List.rev _1 )}

1780 1781
nonempty_list_array_abstract_declarator_:
  _1 = nonempty_list_rev_array_abstract_declarator_
1782 1783
    {                                       ( List.rev _1 )}

1784 1785
nonempty_list_attribute_:
  _1 = nonempty_list_rev_attribute_
1786 1787 1788
    {                                       ( List.rev _1 )}

nonempty_list_member_designator_:
1789
  _1 = nonempty_list_rev_member_designator_
1790 1791
    {                                       ( List.rev _1 )}

1792 1793
nonempty_list_pointer_type_qualifier_:
  _1 = nonempty_list_rev_pointer_type_qualifier_
1794 1795
    {                                       ( List.rev _1 )}

1796 1797
nonempty_list_simple_string_literal_:
  _1 = nonempty_list_rev_simple_string_literal_
1798 1799
    {                                       ( List.rev _1 )}

1800 1801
nonempty_list_type_qualifier_:
  _1 = nonempty_list_rev_type_qualifier_
1802 1803
    {                                       ( List.rev _1 )}

1804 1805
nonempty_list_rev_TK_STRING_LITERAL_:
  _1 = TK_STRING_LITERAL
1806
    {  ( [_1] )}
1807
| _1 = nonempty_list_rev_TK_STRING_LITERAL_ _2 = TK_STRING_LITERAL
1808 1809
    {  ( _2 :: _1 )}

1810 1811
nonempty_list_rev_array_abstract_declarator_:
  _1 = array_abstract_declarator
1812
    {  ( [_1] )}
1813
| _1 = nonempty_list_rev_array_abstract_declarator_ _2 = array_abstract_declarator
1814 1815
    {  ( _2 :: _1 )}

1816 1817
nonempty_list_rev_attribute_:
  _1 = attribute
1818
    {  ( [_1] )}
1819
| _1 = nonempty_list_rev_attribute_ _2 = attribute
1820 1821 1822
    {  ( _2 :: _1 )}

nonempty_list_rev_member_designator_:
1823
  _1 = member_designator
1824 1825 1826 1827
    {  ( [_1] )}
| _1 = nonempty_list_rev_member_designator_ _2 = member_designator
    {  ( _2 :: _1 )}

1828 1829
nonempty_list_rev_pointer_type_qualifier_:
  _1 = pointer_type_qualifier
1830
    {  ( [_1] )}
1831
| _1 = nonempty_list_rev_pointer_type_qualifier_ _2 = pointer_type_qualifier
1832 1833
    {  ( _2 :: _1 )}

1834 1835
nonempty_list_rev_simple_string_literal_:
  _1 = simple_string_literal
1836
    {  ( [_1] )}
1837
| _1 = nonempty_list_rev_simple_string_literal_ _2 = simple_string_literal
1838 1839
    {  ( _2 :: _1 )}

1840 1841
nonempty_list_rev_type_qualifier_:
  _1 = type_qualifier
1842
    {  ( [_1] )}
1843
| _1 = nonempty_list_rev_type_qualifier_ _2 = type_qualifier
1844 1845
    {  ( _2 :: _1 )}

1846
option_KW_EXTENSION_:
1847
  
1848
    {  ( None )}
1849
| _1 = KW_EXTENSION
1850 1851
    {  ( Some _1 )}

1852
option_TK_COMMA_:
1853
  
1854
    {  ( None )}
1855
| _1 = TK_COMMA
1856 1857
    {  ( Some _1 )}

1858
option_TK_EQUALS_:
1859
  
1860
    {  ( None )}
1861
| _1 = TK_EQUALS
1862 1863
    {  ( Some _1 )}

1864
option_asm_argument_list_:
1865
  
1866
    {  ( None )}
1867
| _1 = asm_argument_list
1868 1869
    {  ( Some _1 )}

1870
option_asm_declaration_specifier_:
1871
  
1872
    {  ( None )}
1873
| _1 = asm_declaration_specifier
1874 1875
    {  ( Some _1 )}

1876
option_bit_field_size_:
1877
  
1878
    {  ( None )}
1879
| _1 = bit_field_size
1880 1881
    {  ( Some _1 )}

1882
option_constant_expression_:
1883
  
1884
    {  ( None )}
1885
| _1 = constant_expression
1886 1887 1888
    {  ( Some _1 )}

option_decl_initialiser_:
1889
  
1890 1891 1892 1893
    {  ( None )}
| _1 = decl_initialiser
    {  ( Some _1 )}

1894
option_enumerator_value_:
1895
  
1896
    {  ( None )}
1897
| _1 = enumerator_value
1898 1899
    {  ( Some _1 )}

1900
option_expression_:
1901
  
1902
    {  ( None )}
1903
| _1 = expression
1904 1905
    {  ( Some _1 )}

1906
option_forward_parameter_type_list_:
1907
  
1908
    {  ( None )}
1909
| _1 = forward_parameter_type_list
1910 1911
    {  ( Some _1 )}

1912
option_paren_numeric_literal__:
1913
  
1914
    {  ( None )}
1915
| _1 = paren_numeric_literal_
1916 1917
    {  ( Some _1 )}

1918
option_sep_TK_COMMA_asm_clobbered__: