1 (* Copyright (C) 2009,2017 Matthew Fluet.
2 * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 * Copyright (C) 1997-2000 NEC Research Institute.
6 * MLton is released under a BSD-style license.
7 * See the file MLton-LICENSE for details.
10 signature AST_ATOMS_STRUCTS =
12 structure AdmitsEquality: ADMITS_EQUALITY
13 structure CharSize: CHAR_SIZE
14 structure IntSize: INT_SIZE
15 structure RealSize: REAL_SIZE
16 structure Record: RECORD
17 structure SortedRecord: RECORD
18 structure Symbol: SYMBOL
19 structure TyconKind: TYCON_KIND
20 structure WordSize: WORD_SIZE
21 sharing Record.Field = SortedRecord.Field
22 sharing Symbol = Record.Field.Symbol
27 include AST_ATOMS_STRUCTS
29 structure Const: AST_CONST
34 val isEquality: t -> bool
40 include PRIM_TYCONS sharing type tycon = t
56 (* conversions to and from variables and constructors *)
57 val fromVar: Var.t -> t
58 val fromCon: Con.t -> t
62 (* check special ids *)
63 val checkRedefineSpecial:
65 ctxt: unit -> Layout.t,
66 keyword: string} -> unit
67 val checkSpecifySpecial:
69 ctxt: unit -> Layout.t,
70 keyword: string} -> unit
81 structure Sigid: AST_ID
82 structure Fctid: AST_ID
84 structure Basid: AST_ID
90 end sharing Longtycon.Id = Tycon
92 structure Longcon: LONGID sharing Longcon.Id = Con
93 structure Longvar: LONGID sharing Longvar.Id = Var
98 val toLongcon: t -> Longcon.t
99 end sharing Longvid.Id = Vid
100 structure Longstrid: LONGID sharing Longstrid.Id = Strid
102 sharing Strid = Longtycon.Strid = Longvar.Strid = Longcon.Strid
103 = Longvid.Strid = Longstrid.Strid
105 sharing Symbol = Basid.Symbol = Con.Symbol = Fctid.Symbol
106 = Longcon.Symbol = Longstrid.Symbol = Longtycon.Symbol
107 = Longvar.Symbol = Longvid.Symbol = Sigid.Symbol
108 = Strid.Symbol = Tycon.Symbol = Tyvar.Symbol = Vid.Symbol
115 Con of Longtycon.t * t vector
117 | Record of (Region.t * t) Record.t
120 include WRAPPED sharing type node' = node
123 val arrow: t * t -> t
124 val checkSyntax: t -> unit
125 val con: Tycon.t * t vector -> t
126 val layout: t -> Layout.t
127 val layoutApp: Layout.t * 'a vector * ('a -> Layout.t) -> Layout.t
128 val layoutOption: t option -> Layout.t
129 val record: (Region.t * t) Record.t -> t
130 val tuple: t vector -> t
132 val var: Tyvar.t -> t
137 datatype node = T of {def: Type.t,
139 tyvars: Tyvar.t vector} vector
140 include WRAPPED sharing type node' = node
143 val checkSyntaxDef: t -> unit
144 val checkSyntaxSpec: t -> unit
146 val isEmpty: t -> bool
147 val layout: t -> Layout.t
153 T of {datatypes: {cons: (Con.t * Type.t option) vector,
155 tyvars: Tyvar.t vector} vector,
156 withtypes: TypBind.t}
157 include WRAPPED sharing type node' = node
160 val checkSyntaxDef: t -> unit
161 val checkSyntaxSpec: t -> unit
162 val layout: string * t -> Layout.t
164 structure DatatypeRhs:
169 | Repl of {lhs: Tycon.t, rhs: Longtycon.t}
170 include WRAPPED sharing type node' = node
173 val checkSyntaxDef: t -> unit
174 val checkSyntaxSpec: t -> unit
175 val layout: t -> Layout.t
181 Fct of {lhs: Fctid.t, rhs: Fctid.t} vector
182 | Sig of {lhs: Sigid.t, rhs: Sigid.t} vector
183 | Str of {lhs: Strid.t, rhs: Strid.t} vector
184 include WRAPPED sharing type node' = node
187 val checkSyntax: t -> unit
188 val layout: t -> Layout.t
191 val bind: Layout.t * Layout.t -> Layout.t
192 val layoutAnds: string * 'a vector * (Layout.t * 'a -> Layout.t)
198 string * string * 'a vector * ('a -> bindStyle * Layout.t * Layout.t)
200 val layoutAndsSusp: string * 'a vector * (bool * Layout.t * 'a -> Layout.t)
201 -> (unit -> Layout.t) vector
202 val reportDuplicates:
203 'a vector * {ctxt: unit -> Layout.t,
204 equals: 'a * 'a -> bool,
205 layout: 'a -> Layout.t,
207 region: 'a -> Region.t} -> unit
208 val reportDuplicateFields:
209 (Record.Field.t * (Region.t * 'a)) vector * {ctxt: unit -> Layout.t} -> unit
210 val reportDuplicateTyvars:
211 Tyvar.t vector * {ctxt: unit -> Layout.t} -> unit