Project

General

Profile

Revision 6560bb94 src/parser_lustre.mly

View differences:

src/parser_lustre.mly
225 225
      Hashtbl.add type_table (Tydec_const $2) (Corelang.get_repr_type $4)
226 226
    with Not_found-> raise (Corelang.Unbound_type ($4, Location.symbol_rloc())) }
227 227
| TYPE IDENT EQ ENUM LCUR tag_list RCUR { Hashtbl.add type_table (Tydec_const $2) (Tydec_enum ($6 (Tydec_const $2))) }
228
| TYPE IDENT EQ STRUCT LCUR field_list RCUR { Hashtbl.add type_table (Tydec_const $2) Tydec_any }
228
| TYPE IDENT EQ STRUCT LCUR field_list RCUR { Hashtbl.add type_table (Tydec_const $2) (Tydec_struct ($6 (Tydec_const $2))) }
229 229

  
230 230
array_typ_decl:
231 231
                            { fun typ -> typ }
......
243 243
tag_list:
244 244
  IDENT
245 245
  { (fun t -> if Hashtbl.mem tag_table $1
246
             then raise (Corelang.Already_bound_label ($1, t, Location.symbol_rloc ()))
247
             else (Hashtbl.add tag_table $1 t; $1 :: [])) }
246
              then raise (Corelang.Already_bound_label ($1, t, Location.symbol_rloc ()))
247
              else (Hashtbl.add tag_table $1 t; $1 :: [])) }
248 248
| tag_list COMMA IDENT
249 249
  { (fun t -> if Hashtbl.mem tag_table $3
250
             then raise (Corelang.Already_bound_label ($3, t, Location.symbol_rloc ()))
251
             else (Hashtbl.add tag_table $3 t; $3 :: ($1 t))) }
250
              then raise (Corelang.Already_bound_label ($3, t, Location.symbol_rloc ()))
251
              else (Hashtbl.add tag_table $3 t; $3 :: ($1 t))) }
252 252

  
253 253
field_list:
254
   { [] }
255
| IDENT COL typeconst SCOL field_list { ($1, $3) :: $5 }
254
  { (fun t -> []) }
255
| field_list IDENT COL typeconst SCOL
256
  { (fun t -> if Hashtbl.mem field_table $2
257
              then raise (Corelang.Already_bound_label ($2, t, Location.symbol_rloc ()))
258
              else (Hashtbl.add field_table $2 t; ($2, $4) :: ($1 t))) }
256 259

  
257 260
eq_list:
258 261
  { [], [], [] }

Also available in: Unified diff