Project

General

Profile

Revision 6a1a01d2 src/parser_lustre.mly

View differences:

src/parser_lustre.mly
20 20

  
21 21
let mktyp x = mktyp (get_loc ()) x
22 22
let mkclock x = mkclock (get_loc ()) x
23
let mkvar_decl x = mkvar_decl (get_loc ()) x
23
let mkvar_decl x = mkvar_decl (get_loc ()) ~orig:true x
24 24
let mkexpr x = mkexpr (get_loc ()) x
25 25
let mkeexpr x = mkeexpr (get_loc ()) x 
26 26
let mkeq x = mkeq (get_loc ()) x
......
266 266
| handler handler_list { $1::$2 }
267 267

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

  
271 271
unless_list:
272 272
    { [] }
......
381 381
/* Applications */
382 382
| node_ident LPAR expr RPAR
383 383
    {mkexpr (Expr_appl ($1, $3, None))}
384
| node_ident LPAR expr RPAR EVERY vdecl_ident
385
    {mkexpr (Expr_appl ($1, $3, Some ($6, tag_true)))}
386
| node_ident LPAR expr RPAR EVERY tag_ident LPAR vdecl_ident RPAR
387
    {mkexpr (Expr_appl ($1, $3, Some ($8, $6))) }
384
| node_ident LPAR expr RPAR EVERY expr
385
    {mkexpr (Expr_appl ($1, $3, Some $6))}
388 386
| node_ident LPAR tuple_expr RPAR
389 387
    {mkexpr (Expr_appl ($1, mkexpr (Expr_tuple (List.rev $3)), None))}
390
| node_ident LPAR tuple_expr RPAR EVERY vdecl_ident
391
    {mkexpr (Expr_appl ($1, mkexpr (Expr_tuple (List.rev $3)), Some ($6, tag_true))) }
392
| node_ident LPAR tuple_expr RPAR EVERY tag_ident LPAR vdecl_ident RPAR
393
    {mkexpr (Expr_appl ($1, mkexpr (Expr_tuple (List.rev $3)), Some ($8, $6))) }
388
| node_ident LPAR tuple_expr RPAR EVERY expr
389
    {mkexpr (Expr_appl ($1, mkexpr (Expr_tuple (List.rev $3)), Some $6)) }
394 390

  
395 391
/* Boolean expr */
396 392
| expr AND expr 
......
527 523

  
528 524
vdecl:
529 525
/* Useless no ?*/    ident_list
530
    {List.map mkvar_decl 
531
        (List.map (fun id -> (id, mktyp Tydec_any, mkclock Ckdec_any, false)) $1)}
526
    { List.map (fun id -> mkvar_decl (id, mktyp Tydec_any, mkclock Ckdec_any, false)) $1 }
532 527

  
533 528
| ident_list COL typeconst clock 
534
    {List.map mkvar_decl (List.map (fun id -> (id, mktyp $3, $4, false)) $1)}
529
    { List.map (fun id -> mkvar_decl (id, mktyp $3, $4, false)) $1 }
535 530
| CONST ident_list COL typeconst /* static parameters don't have clocks */
536
    {List.map mkvar_decl (List.map (fun id -> (id, mktyp $4, mkclock Ckdec_any, true)) $2)}
531
    { List.map (fun id -> mkvar_decl (id, mktyp $4, mkclock Ckdec_any, true)) $2 }
537 532

  
538 533
cdecl_list:
539 534
  cdecl SCOL { (fun itf -> [$1 itf]) }

Also available in: Unified diff