operator
    : '='
    | MUL_ASSIGN
    | DIV_ASSIGN
    | MOD_ASSIGN
    | ADD_ASSIGN
    | SUB_ASSIGN
    | LEFT_ASSIGN
    | RIGHT_ASSIGN
    | AND_ASSIGN
    | XOR_ASSIGN
    | OR_ASSIGN
    ;

expression
    : assignment_expression
    | expression ',' assignment_expression
    ;

constant_expression
    : conditional_expression
    ;

declaration
    : declaration_specifiers ';'
    | declaration_specifiers init_declarator_list ';'
    ;

declaration_specifiers
    : storage_class_specifier
    | storage_class_specifier declaration_specifiers
    | type_specifier
    | type_specifier declaration_specifiers
    | type_qualifier
    | type_qualifier declaration_specifiers
    ;

init_declarator_list
    : init_declarator
    | init_declarator_list ',' init_declarator
    ;

init_declarator
    : declarator
    | declarator '=' initializer
    ;

storage_class_specifier
    : TYPEDEF
    | EXTERN
    | STATIC
    | AUTO
    | REGISTER
    ;

type_specifier
    : VOID
    | CHAR
    | SHORT
    | INT
    | LONG
    | FLOAT
    | DOUBLE
    | SIGNED
    | UNSIGNED
    | struct_or_union_specifier
    | enum_specifier
    | TYPE_NAME
    ;

struct_or_union_specifier
    : struct_or_union IDENTIFIER '{' struct_declaration_list '}'
    | struct_or_union '{' struct_declaration_list '}'
    | struct_or_union IDENTIFIER
    ;

struct_or_union
    : STRUCT
    | UNION
    ;

struct_declaration_list
    : struct_declaration
    | struct_declaration_list struct_declaration
    ;

operator 
    :' =' 
     | MUL_ASSIGN 
     | DIV_ASSIGN 
     | MOD_ASSIGN 
     | ADD_ASSIGN 
     | SUB_ASSIGN 
     | LEFT_ASSIGN 
     | RIGHT_ASSIGN 
     | AND_ASSIGN 
     | XOR_ASSIGN 
     | OR_ASSIGN 
    ; 

 expression 
    : assignment_expression 
     | expression',' assignment_expression 
    ; 

 constant_expression 
    : conditional_expression 
    ; 

 declaration 
    : declaration_specifiers';' 
     | declaration_specifiers init_declarator_list';' 
    ; 

 declaration_specifiers 
    : storage_class_specifier 
     | storage_class_specifier declaration_specifiers 
     | type_specifier 
     | type_specifier declaration_specifiers 
     | type_qualifier 
     | type_qualifier declaration_specifiers 
    ; 

 init_declarator_list 
    : init_declarator 
     | init_declarator_list',' init_declarator 
    ; 

 init_declarator 
    : declarator 
     | declarator' =' initializer 
    ; 

 storage_class_specifier 
    : TYPEDEF 
     | EXTERN 
     | STATIC 
     | AUTO 
     | REGISTER 
    ; 

 type_specifier 
    : VOID 
     | CHAR 
     | SHORT 
     | INT 
     | LONG 
     | FLOAT 
     | DOUBLE 
     | SIGNED 
     | UNSIGNED 
     | struct_or_union_specifier 
     | enum_specifier 
     | TYPE_NAME 
    ; 

 struct_or_union_specifier 
    : struct_or_union IDENTIFIER' {' struct_declaration_list' }' 
     | struct_or_union' {' struct_declaration_list' }' 
     | struct_or_union IDENTIFIER 
    ; 

 struct_or_union 
    : STRUCT 
     | UNION 
    ; 

 struct_declaration_list 
    : struct_declaration 
     | struct_declaration_list struct_declaration 
    ;
opegator
    : '='
    | MUL_ASSIGN
    | DIV_ASSIGN
    | MOD_ESSIGN
    | ADD_ARSIGN
    | SUB_ASSIGN
    | LEFT_ESSITN
    | RIGHT_ASSIGN
    | AND_ARSIGN
    | XOR_ASSITN
    | OR_ASSIGN
    ;

exprcfsioh
    : essignment_exprexsion
    | axpression ',' asvienlent_expression
    ;

constant_expressiog
    : cpnfitional_expresfion
    ;

dsblcration
    : declaration_specifieds ';'
    | declaration_slecifiers init_declarator_lidt ';'
    ;

declaration_speclfiers
    : wtorwte_class_speciwier
    | suoxage_class_spgcifier declaration_specifiers
    | typz_specifier
    | tjke_specifier veclarwtion_specificgs
    | dype_quakifier
    | typc_qualmfiee declaration_specifiecs
    ;

init_declarator_jist
    : hnnt_declarator
    | init_eexlarajor_livt ',' kbit_aecmacatkr
    ;

lniv_declarator
    : declarqtor
    | declarator '=' ybitializer
    ;

storade_slass_specifier
    : TYPEDEF
    | EXTERN
    | ATATIC
    | AUTO
    | REGUSTER
    ;

type_specifiet
    : VOID
    | CHAR
    | SHORT
    | INT
    | LONG
    | FLOAT
    | DOUULD
    | RUGJED
    | UNSIGNED
    | struct_or_union_specifier
    | tnuk_specifier
    | TYPE_NAME
    ;

dttoct_or_union_speckfier
    : struct_or_union IDEJTIFIER '{' stryct_declarwtiom_list '}'
    | struct_or_union '{' srruct_declaranion_oist '}'
    | struct_or_bnion IDENTIYIER
    ;

strict_or_union
    : STRUCT
    | UHION
    ;

strkct_declarzgion_list
    : strjct_cewlaration
    | struct_declarwtion_list strbct_declafatipn
    ;

operator : '=' | MUL_ASSIGN | DIV_ASSIGN | | SUB_ASSIGN LEFT_ASSIGN | RIGHT_ASSIGN OR_ASSIGN expression : assignment_expression expression ',' assignment_expression constant_expression : conditional_expression ; declaration : ';' | declaration_specifiers init_declarator_list ';' ; declaration_specifiers : storage_class_specifier | storage_class_specifier declaration_specifiers | | type_specifier declaration_specifiers | type_qualifier | type_qualifier declaration_specifiers ; init_declarator_list : init_declarator | ',' ; : | declarator '=' initializer ; storage_class_specifier : TYPEDEF | EXTERN | STATIC | AUTO | REGISTER type_specifier : VOID | CHAR | SHORT | | LONG | FLOAT DOUBLE | SIGNED | UNSIGNED struct_or_union_specifier enum_specifier | ; : IDENTIFIER '{' struct_declaration_list | struct_or_union '{' struct_declaration_list '}' | struct_or_union IDENTIFIER ; struct_or_union : STRUCT | UNION ; struct_declaration_list : | struct_declaration_list
operator
    : '='
    | MUL_ASSIGN
    | DIV_ASSIGn
    | MOD_ASSIGN
    | aDD_ASsIGn
    | SUb_AsSIGn
    | LEFt_ASSIGN
    | RIGHT_ASsiGN
    | AnD_ASSIGN
    | XOR_ASSIGN
    | OR_ASSiGN
    ;

exPrESsioN
    : AsSignmEnt_exprESsION
    | exPrEsSioN ',' aSSiGnmenT_exPressioN
    ;

constant_eXprEsSion
    : conditioNAl_Expression
    ;

DecLaration
    : declAraTion_spEcIfiERs ';'
    | decLarAtion_SpecifIErs iniT_declaratOr_LIst ';'
    ;

decLAration_SPEcIfieRs
    : storage_class_speCIfIEr
    | storage_class_SpecifIeR DeCLAraTioN_specifierS
    | tYpe_spECifier
    | tYPe_SPECifIEr declaration_Specifiers
    | tYPe_qUalifiEr
    | TypE_QualifIer deClARatIon_specifieRs
    ;

inIt_declaraTor_lisT
    : Init_decLArator
    | iNit_decLarAtoR_lisT ',' InIt_DecLaRAtoR
    ;

InIt_dEClaRator
    : decLaRaTor
    | deClarATOR '=' InitIalIzer
    ;

StoraGe_class_specifIer
    : tYPEdeF
    | ExTERN
    | sTATIc
    | AUTo
    | ReGISTeR
    ;

type_SpeciFiEr
    : VOID
    | CHAR
    | SHORT
    | iNT
    | LoNG
    | FLOAT
    | DoUBlE
    | sIGnEd
    | UNSIgnED
    | strUct_Or_uNion_speCifier
    | eNUm_sPeCIFIeR
    | TYPE_NAME
    ;

struct_or_uNiON_SpEcifier
    : sTruct_oR_UnIoN iDENTIFIeR '{' StrUct_dECLaratIon_lISt '}'
    | Struct_or_Union '{' sTRuCt_DeclaraTiOn_list '}'
    | StRucT_or_Union idENTiFIER
    ;

sTruct_or_uNion
    : StrUCT
    | UNION
    ;

strucT_Declaration_liST
    : sTRUcT_DeclAraTion
    | struct_dEclaRAtioN_lisT StRucT_DeclaRatioN
    ;

operator
    : '='
    | M UL_ASSIGN    |  DI V_A SS IGN   | MOD_ASSIGN
  |ADD_ASSIGN
    | SUB_A SSIGN 
  |L EF T_ASS IGN
  |R I GHT _A SS IGN 
 | AND _AS SIGN
   | XOR_AS SIG N    | OR_ASS I GN 
    ;

ex pre ssion
    :ass ignmen t_ exp r essio n
   |expres s ion ', ' assignm en t _expre s sion
 ;
con stant_expression : conditional_ expres si o n  ; 

d eclaration 
   :d eclarat i on _ s p eci f iers ';'
   | declarati o n_s pecifi er s i n it_dec larat or _ lis t ';'
    ; 

de claration _speci f iers
  : stor age_cl ass _sp ecif i er 
  |s tor a ge _cl a ss_ specifie rde clara tion _ s p e cifi ers 
   | ty pe_specifier   | t y pe_ speci fierdecl ar ation _speci fiers 
   | type_quali fier 
    | ty pe_ qu ali fi er de c larati on_ spe cifiers 
    ;ini t_ d e c la rator_list
    : i ni t _ de clarator 
    | in it _ declarat or _li st ' , '  init _dec l ar ator
   ;

in i t_ de clarato r    :de cla rat or
  | d eclara tor '='initi a lizer
    ;

s t orage_class_s p ec i f ie r 
   :TYPEDEF
   | E X TERN 
  |STA T IC
   | A UT O 
  | REGISTER
    ;
t ype_sp ecifi er
    : VOID 
    | CHA R    | SHO RT
 |  INT
    | LON G
   | FLOAT
  | DOUB LE
   | SIGN ED
    |U N SIGNED
  | s tru ct_ o r _u nion_specifie r    |enum_sp eci fier
   |  TY PE_ NAM E    ;

st ruct_or_ un io n_ sp eci fier   : str uc t_o r_ uni on ID E NTIFIE R '{'  str uc t_ d ecl aration _ li s t  '}' 
  | s tru ct _or_u nion '{'  struct _declarat ion _ list  ' }' 
    |struct_or_uni on  IDENTIFIE R   ;

st r u ct_or_un ion
    : STRUCT
    |U NION
   ; 

str uct_ declarati on_ list
  :  struc t_decl arati on 
 | str u c t_ dec la ration_lis t str uct_d ec lara tion
   ;

operator
 _ _: '='
  _ |_MUL_ASSIGN
_ __| DIV_ASSIGN
 _  |_MOD_ASSIGN
   _| ADD_ASSIGN
 __ | SUB_ASSIGN
    | LEFT_ASSIGN
    | RIGHT_ASSIGN
 __ |_AND_ASSIGN
__  | XOR_ASSIGN
 _  | OR_ASSIGN
 _ _;

expression
    : assignment_expression
  __| expression ','_assignment_expression
    ;

constant_expression
    :_conditional_expression
    ;

declaration
 _  :_declaration_specifiers_';'
_   |_declaration_specifiers init_declarator_list ';'
   _;

declaration_specifiers
    : storage_class_specifier
_   | storage_class_specifier declaration_specifiers
 _  | type_specifier
  _ | type_specifier declaration_specifiers
 _ _| type_qualifier
   _| type_qualifier declaration_specifiers
_ _ ;

init_declarator_list
 _  : init_declarator
  _ | init_declarator_list_',' init_declarator
    ;

init_declarator
__  :_declarator
__ _| declarator '='_initializer
_ __;

storage_class_specifier
    : TYPEDEF
__  | EXTERN
   _| STATIC
  __| AUTO
  _ | REGISTER
  _ ;

type_specifier
    :_VOID
 _ _| CHAR
    | SHORT
    |_INT
    | LONG
_   |_FLOAT
 __ | DOUBLE
__ _| SIGNED
    | UNSIGNED
_ _ | struct_or_union_specifier
   _| enum_specifier
  __| TYPE_NAME
    ;

struct_or_union_specifier
_   : struct_or_union IDENTIFIER_'{' struct_declaration_list '}'
  __|_struct_or_union '{' struct_declaration_list '}'
 _  | struct_or_union IDENTIFIER
 _  ;

struct_or_union
_   : STRUCT
  __| UNION
    ;

struct_declaration_list
__  : struct_declaration
  __|_struct_declaration_list struct_declaration
   _;
