Revision f3d244c1
Added by Xavier Thirioux about 8 years ago
src/backends/C/c_backend_common.ml | ||
---|---|---|
491 | 491 |
end |
492 | 492 |
|
493 | 493 |
let pp_const_initialize pp_var fmt const = |
494 |
let m = Machine_code.empty_machine in |
|
495 | 494 |
let var = mk_val (LocalVar (Corelang.var_decl_of_const const)) const.const_type in |
496 | 495 |
let rec aux indices value fmt typ = |
497 | 496 |
if Types.is_array_type typ |
... | ... | |
508 | 507 |
let indices = List.rev indices in |
509 | 508 |
let pp_var_suffix fmt var = |
510 | 509 |
fprintf fmt "%a%a" (pp_c_val "" pp_var) var pp_array_suffix indices in |
511 |
let pp_value fmt value = pp_c_val "" pp_var fmt value in |
|
512 | 510 |
begin |
513 | 511 |
Mpfr.pp_inject_init pp_var_suffix fmt var; |
514 | 512 |
fprintf fmt "@,"; |
src/backends/Horn/horn_backend_printers.ml | ||
---|---|---|
193 | 193 |
(* Print the instruction and update the set of reset instances *) |
194 | 194 |
let rec pp_machine_instr machines reset_instances (m: machine_t) fmt instr : ident list = |
195 | 195 |
match instr with |
196 |
| MComment _ -> reset_instances |
|
196 | 197 |
| MNoReset i -> (* we assign middle_mem with mem_m. And declare i as reset *) |
197 | 198 |
pp_no_reset machines m fmt i; |
198 | 199 |
i::reset_instances |
src/lexer_lustre.mll | ||
---|---|---|
73 | 73 |
try |
74 | 74 |
let ann = LexerLustreSpec.annot s in |
75 | 75 |
ANNOT ann |
76 |
with LexerLustreSpec.Error loc -> raise (Parse.Error (Location.shift (Location.curr lexbuf) loc, Annot_error s)) |
|
76 |
with LexerLustreSpec.Error loc -> raise (Parse.Error (Location.shift (Location.curr lexbuf) loc, Parse.Annot_error s))
|
|
77 | 77 |
|
78 | 78 |
let make_spec lexbuf s = |
79 | 79 |
try |
80 | 80 |
let ns = LexerLustreSpec.spec s in |
81 | 81 |
NODESPEC ns |
82 |
with LexerLustreSpec.Error loc -> raise (Parse.Error (Location.shift (Location.curr lexbuf) loc, Node_spec_error s)) |
|
82 |
with LexerLustreSpec.Error loc -> raise (Parse.Error (Location.shift (Location.curr lexbuf) loc, Parse.Node_spec_error s))
|
|
83 | 83 |
|
84 | 84 |
} |
85 | 85 |
|
... | ... | |
157 | 157 |
| "^" {POWER} |
158 | 158 |
| '"' {QUOTE} |
159 | 159 |
| eof { EOF } |
160 |
| _ { raise (Parse.Error (Location.curr lexbuf, Undefined_token (Lexing.lexeme lexbuf))) } |
|
160 |
| _ { raise (Parse.Error (Location.curr lexbuf, Parse.Undefined_token (Lexing.lexeme lexbuf))) }
|
|
161 | 161 |
|
162 | 162 |
and comment n = parse |
163 | 163 |
| eof |
164 |
{ raise (Parse.Error (Location.curr lexbuf, Unfinished_comment)) } |
|
164 |
{ raise (Parse.Error (Location.curr lexbuf, Parse.Unfinished_comment)) }
|
|
165 | 165 |
| "(*" |
166 | 166 |
{ comment (n+1) lexbuf } |
167 | 167 |
| "*)" |
... | ... | |
177 | 177 |
| _ as c { Buffer.add_char buf c; annot_singleline lexbuf } |
178 | 178 |
|
179 | 179 |
and annot_multiline n = parse |
180 |
| eof { raise (Parse.Error (Location.curr lexbuf, Unfinished_annot)) } |
|
180 |
| eof { raise (Parse.Error (Location.curr lexbuf, Parse.Unfinished_annot)) }
|
|
181 | 181 |
| "*)" as s { |
182 | 182 |
if n > 0 then |
183 | 183 |
(Buffer.add_string buf s; annot_multiline (n-1) lexbuf) |
... | ... | |
193 | 193 |
| _ as c { Buffer.add_char buf c; spec_singleline lexbuf } |
194 | 194 |
|
195 | 195 |
and spec_multiline n = parse |
196 |
| eof { raise (Parse.Error (Location.curr lexbuf, Unfinished_node_spec)) } |
|
196 |
| eof { raise (Parse.Error (Location.curr lexbuf, Parse.Unfinished_node_spec)) }
|
|
197 | 197 |
| "*)" as s { if n > 0 then |
198 | 198 |
(Buffer.add_string buf s; spec_multiline (n-1) lexbuf) |
199 | 199 |
else |
src/parser_lustre.mly | ||
---|---|---|
623 | 623 |
|
624 | 624 |
ident_list: |
625 | 625 |
vdecl_ident {[$1]} |
626 |
| vdecl_ident COMMA ident_list {$1::$3}
|
|
626 |
| ident_list COMMA vdecl_ident {$3::$1}
|
|
627 | 627 |
|
628 | 628 |
SCOL_opt: |
629 | 629 |
SCOL {} | {} |
Also available in: Unified diff
...