Correct some typos
This commit is contained in:
parent
1491e279f7
commit
c3a64a2bae
@ -258,7 +258,7 @@ let cp_init_aux_nodes fmt (node, h) =
|
|||||||
let cp_equations fmt (eqs, hloc, h) =
|
let cp_equations fmt (eqs, hloc, h) =
|
||||||
(** [main_block] is modified through some optimization passes, eg:
|
(** [main_block] is modified through some optimization passes, eg:
|
||||||
* - merge two CIf blocks using the same condition
|
* - merge two CIf blocks using the same condition
|
||||||
* - replace [if (! c) { b1 } else {b2 }] by [if(c) { b2 } else { b1 }]
|
* - replace [if (! c) { b1 } else { b2 }] by [if(c) { b2 } else { b1 }]
|
||||||
*
|
*
|
||||||
* These passes are defined in [ctranslation.ml]
|
* These passes are defined in [ctranslation.ml]
|
||||||
*)
|
*)
|
||||||
|
@ -3,7 +3,7 @@ open Intermediate_ast
|
|||||||
open Ast
|
open Ast
|
||||||
open Cast
|
open Cast
|
||||||
|
|
||||||
(** This file contains extrimely simple functions printing C code. *)
|
(** This file contains extremely simple functions printing C code. *)
|
||||||
|
|
||||||
let rec cp_includes fmt = function
|
let rec cp_includes fmt = function
|
||||||
| [] -> ()
|
| [] -> ()
|
||||||
@ -77,7 +77,7 @@ let rec cp_varlist fmt vl =
|
|||||||
|
|
||||||
let cp_prototype fmt (node, h): unit =
|
let cp_prototype fmt (node, h): unit =
|
||||||
match Hashtbl.find_opt h node.in_name with
|
match Hashtbl.find_opt h node.in_name with
|
||||||
| None -> failwith "This should not happend!"
|
| None -> failwith "This should not happened!"
|
||||||
| Some nst ->
|
| Some nst ->
|
||||||
begin
|
begin
|
||||||
Format.fprintf fmt "void fn_%s (%s *state, %a)"
|
Format.fprintf fmt "void fn_%s (%s *state, %a)"
|
||||||
@ -164,7 +164,7 @@ and cp_expression fmt (expr, hloc) =
|
|||||||
Format.fprintf fmt "%sstate->%s[%d] = %a;\n"
|
Format.fprintf fmt "%sstate->%s[%d] = %a;\n"
|
||||||
prefix arr idx cp_value (value, hloc)
|
prefix arr idx cp_value (value, hloc)
|
||||||
end
|
end
|
||||||
| CAssign (CVInput _, _) -> failwith "should not happend."
|
| CAssign (CVInput _, _) -> failwith "should not happened."
|
||||||
| CSeq (e, e') ->
|
| CSeq (e, e') ->
|
||||||
Format.fprintf fmt "%a%a"
|
Format.fprintf fmt "%a%a"
|
||||||
cp_expression (e, hloc)
|
cp_expression (e, hloc)
|
||||||
|
@ -67,7 +67,7 @@ let rec equation_to_expression (node_st, node_sts, (vl, expr)) =
|
|||||||
vl
|
vl
|
||||||
in
|
in
|
||||||
CApplication (node.n_name,i , al, vl, node_sts)
|
CApplication (node.n_name,i , al, vl, node_sts)
|
||||||
| IETuple _ -> failwith "[ctranslation.ml] linearisatiosn should have transformed you."
|
| IETuple _ -> failwith "[ctranslation.ml] linearization should have transformed you."
|
||||||
| IEWhen (expr, cond) ->
|
| IEWhen (expr, cond) ->
|
||||||
begin
|
begin
|
||||||
CIf (iexpression_to_cvalue cond,
|
CIf (iexpression_to_cvalue cond,
|
||||||
|
@ -70,7 +70,7 @@ let pp_expression =
|
|||||||
begin match c with
|
begin match c with
|
||||||
| CBool b -> Format.fprintf fmt "\t\t\t%s<%s : bool>\n" prefix (Bool.to_string b)
|
| CBool b -> Format.fprintf fmt "\t\t\t%s<%s : bool>\n" prefix (Bool.to_string b)
|
||||||
| CInt i -> Format.fprintf fmt "\t\t\t%s<%5d: int>\n" prefix i
|
| CInt i -> Format.fprintf fmt "\t\t\t%s<%5d: int>\n" prefix i
|
||||||
| CReal r -> Format.fprintf fmt "\t\t\t%s<%5f: float>\n" prefix r
|
| CReal r -> Format.fprintf fmt "\t\t\t%s<%5f: real>\n" prefix r
|
||||||
end
|
end
|
||||||
| EVar (_, IVar v) -> Format.fprintf fmt "\t\t\t%s<int var %s>\n" prefix v
|
| EVar (_, IVar v) -> Format.fprintf fmt "\t\t\t%s<int var %s>\n" prefix v
|
||||||
| EVar (_, BVar v) -> Format.fprintf fmt "\t\t\t%s<bool var %s>\n" prefix v
|
| EVar (_, BVar v) -> Format.fprintf fmt "\t\t\t%s<bool var %s>\n" prefix v
|
||||||
|
Loading…
x
Reference in New Issue
Block a user