3
0
Fork 0
forked from mirrors/nixpkgs

* refactored operators, kinds and storage modifiers to make them checkable at compiletime

svn path=/nixpkgs/trunk/; revision=4863
This commit is contained in:
Mart Kolthof 2006-02-20 10:43:19 +00:00
parent 12a23295d5
commit 03e93539b4

View file

@ -31,8 +31,8 @@ diff -urN cil.orig/Makefile.cil.in cil/Makefile.cil.in
./config.status $@ ./config.status $@
diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml
--- cil.orig/src/ext/atermprinter.ml 1970-01-01 01:00:00.000000000 +0100 --- cil.orig/src/ext/atermprinter.ml 1970-01-01 01:00:00.000000000 +0100
+++ cil/src/ext/atermprinter.ml 2006-01-16 10:36:29.000000000 +0100 +++ cil/src/ext/atermprinter.ml 2006-02-20 10:50:49.000000000 +0100
@@ -0,0 +1,489 @@ @@ -0,0 +1,488 @@
+open Cil +open Cil
+open Pretty +open Pretty
+open List +open List
@ -300,14 +300,13 @@ diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml
+ method dInit (out:out_channel) (i:int) (init1:init) : unit = fprint out i (self#pInit () init1) + method dInit (out:out_channel) (i:int) (init1:init) : unit = fprint out i (self#pInit () init1)
+ +
+ (*** auxiliary methods ***) + (*** auxiliary methods ***)
+ (* Mart: hmmmm *)
+ method private pp_storage (s:storage) : doc = + method private pp_storage (s:storage) : doc =
+ let tok = match s with + let tok = match s with
+ | NoStorage -> "NoStorage" + | NoStorage -> "NoStorage"
+ | Static -> "Static" + | Static -> "Static"
+ | Register -> "Register" + | Register -> "Register"
+ | Extern -> "Extern" + | Extern -> "Extern"
+ in pQuoted ("Storage" ^ tok) + in text ("Storage_" ^ tok)
+ +
+ method private pp_typeinfo (tinfo:typeinfo) : doc = if !E.verboseFlag then trace "pp_typeinfo" ; + method private pp_typeinfo (tinfo:typeinfo) : doc = if !E.verboseFlag then trace "pp_typeinfo" ;
+ text "Typeinfo" ++ (pParens @ pCommaSep) [ + text "Typeinfo" ++ (pParens @ pCommaSep) [
@ -389,14 +388,14 @@ diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml
+ | IULong -> "IULong" + | IULong -> "IULong"
+ | ILongLong -> "ILongLong" + | ILongLong -> "ILongLong"
+ | IULongLong -> "IULongLong" + | IULongLong -> "IULongLong"
+ in pQuoted ("Ikind" ^ tok) + in text ("Ikind_" ^ tok)
+ +
+ method private pp_fkind (fkin:fkind) : doc = + method private pp_fkind (fkin:fkind) : doc =
+ let tok = match fkin with + let tok = match fkin with
+ | FFloat -> "FFloat" + | FFloat -> "FFloat"
+ | FDouble -> "FDouble" + | FDouble -> "FDouble"
+ | FLongDouble -> "FLongDouble" + | FLongDouble -> "FLongDouble"
+ in pQuoted ("Fkind" ^ tok) + in text ("Fkind_" ^ tok)
+ +
+ method private pp_typsig (tsig:typsig) : doc = if !E.verboseFlag then trace "pp_typsig" ; + method private pp_typsig (tsig:typsig) : doc = if !E.verboseFlag then trace "pp_typsig" ;
+ match tsig with + match tsig with
@ -427,7 +426,7 @@ diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml
+ | Neg -> "Neg" + | Neg -> "Neg"
+ | BNot -> "BNot" + | BNot -> "BNot"
+ | LNot -> "LNot" + | LNot -> "LNot"
+ in pQuoted ("UnOp" ^ tok) + in text ("UnOp_" ^ tok)
+ +
+ method private pp_binop (bop:binop) : doc = + method private pp_binop (bop:binop) : doc =
+ let tok = match bop with + let tok = match bop with
@ -453,7 +452,7 @@ diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml
+ | BOr -> "BOr" + | BOr -> "BOr"
+ | LAnd -> "LAnd" + | LAnd -> "LAnd"
+ | LOr -> "LOr" + | LOr -> "LOr"
+ in pQuoted ("BinOp" ^ tok ) + in text ("BinOp_" ^ tok )
+ +
+ method private pp_constant (c:constant) : doc = if !E.verboseFlag then trace "pp_constant" ; + method private pp_constant (c:constant) : doc = if !E.verboseFlag then trace "pp_constant" ;
+ match c with + match c with