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 935 - (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 :     | STRUCTUREdecl of id * decl list * sigexp option * structexp
22 : leunga 775 | FUNCTORdecl of id * decl list * sigexp 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 :     | FUNCTORARGdecl of id * sigexp
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 775 | NOTpat of pat
129 : leunga 744 | ORpat of pat list
130 : leunga 775 | ANDpat of pat list
131 :     | WHEREpat of pat * exp
132 :     | NESTEDpat of pat * exp * pat
133 : leunga 744
134 :     and ident = IDENT of id list * id
135 :    
136 :     and clause = CLAUSE of pat list * guard * exp
137 :    
138 :     and funbind = FUNbind of id * clause list
139 :    
140 :     and storagedecl =
141 :     CELLdecl of {id:id, nickname:id,
142 :     from:int ref,to:int ref,
143 :     alias:id option,
144 :     count:int option,bits:int,print:exp,
145 :     aggregable:bool,
146 :     defaults:(int*exp) list}
147 :    
148 :     and locbind = LOCbind of id * pat option * exp
149 :    
150 :     and endianess = LITTLE | BIG
151 :    
152 :     and archKind = VLIW | SUPERSCALAR
153 :    
154 :     and formatbind = FORMATbind of id * field list * exp option
155 :    
156 :     and field = FIELD of {id:id,width:width,sign:signedness,
157 :     cnv:cnv, value:Word32.word option}
158 :    
159 :     and width = WIDTH of int | RANGE of int * int
160 :    
161 :     and cnv = NOcnv
162 :     | CELLcnv of id
163 :     | FUNcnv of id
164 :    
165 :     and datatypebind = DATATYPEbind of
166 :     {id:id,tyvars:tyvar list,mc : opcodeencoding,asm : bool,
167 :     field:id option,cbs:consbind list}
168 :     | DATATYPEEQbind of {id:id, tyvars:tyvar list, ty:ty}
169 :    
170 : leunga 775 and exceptionbind = EXCEPTIONbind of id * ty option
171 :     | EXCEPTIONEQbind of id * ident
172 :    
173 : leunga 744 and consbind =
174 :     CONSbind of {id : id,ty:ty option,mc : mc option,
175 :     asm : assembly option,
176 :     rtl : exp option,
177 :     nop : flag,
178 :     nullified : flag,
179 :     delayslot : exp option,
180 :     delaycand : exp option,
181 :     sdi : exp option,
182 :     latency : exp option,
183 :     pipeline : exp option,
184 :     loc : loc
185 :     }
186 :    
187 :     and flag = FLAGon | FLAGoff | FLAGid of id * bool * exp
188 :    
189 :     and delayslot = DELAY_ERROR
190 :     | DELAY_NONE
191 :     | DELAY_ALWAYS
192 :     | DELAY_TAKEN
193 :     | DELAY_NONTAKEN
194 :     | DELAY_IF of branching * delayslot * delayslot
195 :    
196 :     and branching = BRANCHforwards
197 :     | BRANCHbackwards
198 :    
199 :     and mc = WORDmc of Word32.word
200 :     | EXPmc of exp
201 :    
202 :     and assembly = STRINGasm of string
203 :     | ASMasm of asm list
204 :    
205 :     and asm = TEXTasm of string
206 :     | EXPasm of exp
207 :    
208 :     and typebind = TYPEbind of id * tyvar list * ty
209 :    
210 :     and valbind = VALbind of pat * exp
211 :    
212 :     and signedness = SIGNED | UNSIGNED
213 :    
214 :     and tyvar = VARtv of id
215 :     | INTtv of id
216 :    
217 :     and rtlterm = LITrtl of id
218 :     | IDrtl of id
219 :     | COMPOSITErtl of id
220 :    
221 :     and cpubind = CPUbind of {name:id, aliases:string list, maxIssues:int,
222 :     resources: (int * id) list}
223 :     and pipelinebind = PIPELINEbind of id * (pat * pipelineexp) list
224 :    
225 :     and latencybind = LATENCYbind of id * (pat * exp) list
226 :    
227 :     and pipelineexp = PIPELINE of cycle list
228 :    
229 :     and cycle = ORcycle of cycle * cycle
230 :     | REPEATcycle of cycle * int
231 :     | IDcycle of id
232 :    
233 :     withtype range = int * int
234 :     and id = string
235 :     and guard = exp option
236 :     and opcodeencoding = int list option
237 :     and cellset = bool
238 :     and rtl = rtlterm list
239 :    
240 :     end

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