Project

General

Profile

Revision 29ced7be src/parser_lustre.mly

View differences:

src/parser_lustre.mly
259 259
| automaton eq_list {let eql, assertl, annotl = $2 in ($1::eql), assertl, annotl}
260 260

  
261 261
automaton:
262
 AUTOMATON type_ident handler_list { failwith "not implemented" }
262
 AUTOMATON type_ident handler_list { (Automata.mkautomata (get_loc ()) $2 $3); failwith "not implemented" }
263 263

  
264 264
handler_list:
265 265
     { [] }
266 266
| handler handler_list { $1::$2 }
267 267

  
268 268
handler:
269
 STATE UIDENT ARROW unless_list locals LET eq_list TEL until_list { () }
269
 STATE UIDENT ARROW unless_list locals LET eq_list TEL until_list { Automata.mkhandler (get_loc ()) $2 $4 $9 $5 $7 }
270 270

  
271 271
unless_list:
272
    { Automata.init }
273
| unless unless_list { let (expr1, case1) = $1 in (fun case -> Automata.add_branch expr1 case1 ($2 case)) }
272
    { [] }
273
| unless unless_list { $1::$2 }
274 274

  
275 275
until_list:
276
    { Automata.init }
277
| until until_list { let (expr1, case1) = $1 in (fun case -> Automata.add_branch expr1 case1 ($2 case)) }
276
    { [] }
277
| until until_list { $1::$2 }
278 278

  
279 279
unless:
280
  UNLESS expr RESTART UIDENT { ($2, (get_loc (), true, $4))  }
281
| UNLESS expr RESUME UIDENT  { ($2, (get_loc (), false, $4)) }
280
  UNLESS expr RESTART UIDENT { (get_loc (), $2, true, $4)  }
281
| UNLESS expr RESUME UIDENT  { (get_loc (), $2, false, $4) }
282 282

  
283 283
until:
284
  UNTIL expr RESTART UIDENT { ($2, (get_loc (), true, $4))  }
285
| UNTIL expr RESUME UIDENT  { ($2, (get_loc (), false, $4)) }
284
  UNTIL expr RESTART UIDENT { (get_loc (), $2, true, $4)  }
285
| UNTIL expr RESUME UIDENT  { (get_loc (), $2, false, $4) }
286 286

  
287 287
assert_:
288 288
| ASSERT expr SCOL {mkassert ($2)}

Also available in: Unified diff