heptagon/compiler/global/types.ml

28 lines
1.1 KiB
OCaml
Raw Normal View History

(**************************************************************************)
(* *)
(* Heptagon *)
(* *)
(* Author : Marc Pouzet *)
(* Organization : Demons, LRI, University of Paris-Sud, Orsay *)
(* *)
(**************************************************************************)
open Static
open Names
type ty =
2010-06-30 17:20:56 +02:00
| Tprod of ty list | Tid of longname | Tarray of ty * static_exp
2010-06-16 17:03:45 +02:00
let invalid_type = Tprod []
2010-07-06 11:12:14 +02:00
let const_array_of ty n = Tarray (ty, Sconst n)
open Pp_tools
open Format
let rec print_type ff = function
| Tprod ty_list ->
fprintf ff "@[<hov2>%a@]" (print_list_r print_type "(" " *" ")") ty_list
| Tid id -> print_longname ff id
| Tarray (ty, n) ->
2010-06-30 17:20:56 +02:00
fprintf ff "@[<hov2>%a^%a@]" print_type ty print_static_exp n