Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/Tools/FakeSMLAst/ast.sig
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/Tools/FakeSMLAst/ast.sig

Parent Directory Parent Directory | Revision Log Revision Log


Revision 999 - (view) (download) (as text)

1 : leunga 744 (*
2 :     * Asbtract syntax for the MDGen language.
3 :     * It contains a large subset of SML (including SML/NJ extensions)
4 :     *)
5 :    
6 :     signature MDL_AST =
7 :     sig
8 : george 935 type loc = SourceMapping.location
9 : leunga 744
10 :     datatype decl =
11 :     DATATYPEdecl of datatypebind list * typebind list
12 : leunga 775 | EXCEPTIONdecl of exceptionbind list
13 : leunga 744 | FUNdecl of funbind list
14 :     | RTLdecl of pat * exp * loc
15 :     | RTLSIGdecl of id list * ty
16 :     | VALdecl of valbind list
17 :     | VALSIGdecl of id list * ty
18 :     | TYPESIGdecl of id * tyvar list
19 :     | LOCALdecl of decl list * decl list
20 :     | SEQdecl of decl list
21 : leunga 999 | STRUCTUREdecl of id * decl list * sigconstraint option * structexp
22 :     | FUNCTORdecl of id * decl list * sigconstraint option * structexp
23 : leunga 744 | STRUCTURESIGdecl of id * sigexp
24 :     | SIGNATUREdecl of id * sigexp
25 :     | SHARINGdecl of share list
26 :     | OPENdecl of ident list
27 : leunga 999 | FUNCTORARGdecl of id * sigconstraint
28 : leunga 775 | INCLUDESIGdecl of sigexp
29 : leunga 744 | INFIXdecl of int * id list
30 :     | INFIXRdecl of int * id list
31 :     | NONFIXdecl of id list
32 :     | MARKdecl of loc * decl
33 :    
34 :     (* MD extensions *)
35 :     | ARCHdecl of id * decl list (* architecture spec *)
36 :     | $ of string list (* verbatim code *)
37 :     | BITSORDERINGdecl of range (* declare bits ordering *)
38 :     | FORMATdecl of int option * formatbind list
39 :     (* declare instruction formats *)
40 :     | ARCHKINDdecl of archKind (* superscalar/vliw *)
41 :     | ENDIANESSdecl of endianess (* little/big endian *)
42 :     | STORAGEdecl of storagedecl list (* cell declarations *)
43 :     | LOCATIONSdecl of locbind list (* location declarations *)
44 :     | NAMEdecl of string (* name of architecture *)
45 :     | VERSIONdecl of string (* version number *)
46 :     | ASSEMBLYCASEdecl of assemblycase (* lower/uppercase *)
47 :     | INSTRUCTIONdecl of consbind list (* instruction definition *)
48 :     | DEBUGdecl of id (* turn on debugging *)
49 :     | RESOURCEdecl of id list (* resource declaration *)
50 :     | CPUdecl of cpubind list (* cpu declaration *)
51 :     | PIPELINEdecl of pipelinebind list (* pipeline declaration *)
52 :     | LATENCYdecl of latencybind list (* latency declaration *)
53 :    
54 :     and sigexp = IDsig of ident
55 :     | WHEREsig of sigexp * ident * structexp
56 :     | WHERETYPEsig of sigexp * ident * ty
57 :     | DECLsig of decl list
58 :    
59 :     and share = TYPEshare of ident list
60 :     | STRUCTshare of ident list
61 :    
62 :     and literal = WORDlit of word
63 :     | WORD32lit of Word32.word
64 :     | INTlit of int
65 :     | INTINFlit of IntInf.int
66 :     | STRINGlit of string
67 :     | CHARlit of char
68 :     | BOOLlit of bool
69 : leunga 775 | REALlit of string
70 : leunga 744
71 :     and exp = LITexp of literal
72 :     | IDexp of ident
73 :     | CONSexp of ident * exp option
74 :     | LISTexp of exp list * exp option
75 :     | TUPLEexp of exp list
76 :     | RECORDexp of (id * exp) list
77 :     | APPexp of exp * exp
78 :     | IFexp of exp * exp * exp
79 :     | LETexp of decl list * exp list
80 :     | SEQexp of exp list
81 :     | RAISEexp of exp
82 :     | HANDLEexp of exp * clause list
83 :     | CASEexp of exp * clause list
84 :     | TYPEDexp of exp * ty
85 :     | LAMBDAexp of clause list
86 :     | MARKexp of loc * exp
87 :    
88 : leunga 775 (* MDL extensions *)
89 : leunga 744 | BITSLICEexp of exp * range list
90 :     | LOCexp of id * exp * id option
91 :     | ASMexp of assembly
92 :     | TYPEexp of ty
93 :     | RTLexp of rtl
94 : leunga 775 | CONTexp of exp * id
95 : leunga 744
96 :     and ety = I8 | I16 | I32 | I64 | FSINGLE | FDOUBLE
97 :    
98 :     and assemblycase = LOWERCASE | UPPERCASE | VERBATIM
99 :    
100 :     and structexp = IDsexp of ident
101 : leunga 775 | APPsexp of structexp * structexp
102 : leunga 744 | DECLsexp of decl list
103 :     | CONSTRAINEDsexp of structexp * sigexp
104 :    
105 :     and ty = IDty of ident
106 :     | TYVARty of tyvar
107 :     | INTVARty of int
108 :     | VARty of tvkind * int * int ref * ty option ref
109 :     | APPty of ident * ty list
110 :     | FUNty of ty * ty
111 :     | TUPLEty of ty list
112 :     | RECORDty of (id * ty) list
113 :     | POLYty of ty list * ty
114 :     | LAMBDAty of ty list * ty
115 :    
116 :     | CELLty of id
117 :    
118 :     and tvkind = INTkind | TYPEkind
119 :    
120 :     and pat = IDpat of id
121 : leunga 775 | CONSpat of ident * pat option
122 : leunga 744 | WILDpat
123 :     | ASpat of id * pat
124 :     | LITpat of literal
125 :     | LISTpat of pat list * pat option
126 :     | TUPLEpat of pat list
127 :     | RECORDpat of (id * pat) list * bool
128 : leunga 974 | TYPEDpat of pat * ty
129 : leunga 775 | NOTpat of pat
130 : leunga 744 | ORpat of pat list
131 : leunga 775 | ANDpat of pat list
132 :     | WHEREpat of pat * exp
133 :     | NESTEDpat of pat * exp * pat
134 : leunga 744
135 :     and ident = IDENT of id list * id
136 :    
137 :     and clause = CLAUSE of pat list * guard * exp
138 :    
139 :     and funbind = FUNbind of id * clause list
140 :    
141 :     and storagedecl =
142 :     CELLdecl of {id:id, nickname:id,
143 :     from:int ref,to:int ref,
144 :     alias:id option,
145 :     count:int option,bits:int,print:exp,
146 :     aggregable:bool,
147 :     defaults:(int*exp) list}
148 :    
149 :     and locbind = LOCbind of id * pat option * exp
150 :    
151 :     and endianess = LITTLE | BIG
152 :    
153 :     and archKind = VLIW | SUPERSCALAR
154 :    
155 :     and formatbind = FORMATbind of id * field list * exp option
156 :    
157 :     and field = FIELD of {id:id,width:width,sign:signedness,
158 :     cnv:cnv, value:Word32.word option}
159 :    
160 :     and width = WIDTH of int | RANGE of int * int
161 :    
162 :     and cnv = NOcnv
163 :     | CELLcnv of id
164 :     | FUNcnv of id
165 :    
166 :     and datatypebind = DATATYPEbind of
167 :     {id:id,tyvars:tyvar list,mc : opcodeencoding,asm : bool,
168 :     field:id option,cbs:consbind list}
169 :     | DATATYPEEQbind of {id:id, tyvars:tyvar list, ty:ty}
170 :    
171 : leunga 775 and exceptionbind = EXCEPTIONbind of id * ty option
172 :     | EXCEPTIONEQbind of id * ident
173 :    
174 : leunga 744 and consbind =
175 :     CONSbind of {id : id,ty:ty option,mc : mc option,
176 :     asm : assembly option,
177 :     rtl : exp option,
178 :     nop : flag,
179 :     nullified : flag,
180 :     delayslot : exp option,
181 :     delaycand : exp option,
182 :     sdi : exp option,
183 :     latency : exp option,
184 :     pipeline : exp option,
185 :     loc : loc
186 :     }
187 :    
188 :     and flag = FLAGon | FLAGoff | FLAGid of id * bool * exp
189 :    
190 :     and delayslot = DELAY_ERROR
191 :     | DELAY_NONE
192 :     | DELAY_ALWAYS
193 :     | DELAY_TAKEN
194 :     | DELAY_NONTAKEN
195 :     | DELAY_IF of branching * delayslot * delayslot
196 :    
197 :     and branching = BRANCHforwards
198 :     | BRANCHbackwards
199 :    
200 :     and mc = WORDmc of Word32.word
201 :     | EXPmc of exp
202 :    
203 :     and assembly = STRINGasm of string
204 :     | ASMasm of asm list
205 :    
206 :     and asm = TEXTasm of string
207 :     | EXPasm of exp
208 :    
209 :     and typebind = TYPEbind of id * tyvar list * ty
210 :    
211 :     and valbind = VALbind of pat * exp
212 :    
213 :     and signedness = SIGNED | UNSIGNED
214 :    
215 :     and tyvar = VARtv of id
216 :     | INTtv of id
217 :    
218 :     and rtlterm = LITrtl of id
219 :     | IDrtl of id
220 :     | COMPOSITErtl of id
221 :    
222 :     and cpubind = CPUbind of {name:id, aliases:string list, maxIssues:int,
223 :     resources: (int * id) list}
224 :     and pipelinebind = PIPELINEbind of id * (pat * pipelineexp) list
225 :    
226 :     and latencybind = LATENCYbind of id * (pat * exp) list
227 :    
228 :     and pipelineexp = PIPELINE of cycle list
229 :    
230 :     and cycle = ORcycle of cycle * cycle
231 :     | REPEATcycle of cycle * int
232 :     | IDcycle of id
233 :    
234 : leunga 999
235 : leunga 744 withtype range = int * int
236 :     and id = string
237 :     and guard = exp option
238 :     and opcodeencoding = int list option
239 :     and cellset = bool
240 :     and rtl = rtlterm list
241 : leunga 999 and sigconstraint = {abstract: bool, sigexp:sigexp}
242 : leunga 744
243 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0