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 1025 - (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 : leunga 1025 | INT32lit of Int32.int
66 : leunga 744 | INTINFlit of IntInf.int
67 :     | STRINGlit of string
68 :     | CHARlit of char
69 :     | BOOLlit of bool
70 : leunga 775 | REALlit of string
71 : leunga 744
72 :     and exp = LITexp of literal
73 :     | IDexp of ident
74 :     | CONSexp of ident * exp option
75 :     | LISTexp of exp list * exp option
76 :     | TUPLEexp of exp list
77 :     | RECORDexp of (id * exp) list
78 :     | APPexp of exp * exp
79 :     | IFexp of exp * exp * exp
80 :     | LETexp of decl list * exp list
81 :     | SEQexp of exp list
82 :     | RAISEexp of exp
83 :     | HANDLEexp of exp * clause list
84 :     | CASEexp of exp * clause list
85 :     | TYPEDexp of exp * ty
86 :     | LAMBDAexp of clause list
87 :     | MARKexp of loc * exp
88 :    
89 : leunga 775 (* MDL extensions *)
90 : leunga 744 | BITSLICEexp of exp * range list
91 :     | LOCexp of id * exp * id option
92 :     | ASMexp of assembly
93 :     | TYPEexp of ty
94 :     | RTLexp of rtl
95 : leunga 775 | CONTexp of exp * id
96 : leunga 744
97 :     and ety = I8 | I16 | I32 | I64 | FSINGLE | FDOUBLE
98 :    
99 :     and assemblycase = LOWERCASE | UPPERCASE | VERBATIM
100 :    
101 :     and structexp = IDsexp of ident
102 : leunga 775 | APPsexp of structexp * structexp
103 : leunga 744 | DECLsexp of decl list
104 :     | CONSTRAINEDsexp of structexp * sigexp
105 :    
106 :     and ty = IDty of ident
107 :     | TYVARty of tyvar
108 :     | INTVARty of int
109 :     | VARty of tvkind * int * int ref * ty option ref
110 :     | APPty of ident * ty list
111 :     | FUNty of ty * ty
112 :     | TUPLEty of ty list
113 :     | RECORDty of (id * ty) list
114 :     | POLYty of ty list * ty
115 :     | LAMBDAty of ty list * ty
116 :    
117 :     | CELLty of id
118 :    
119 :     and tvkind = INTkind | TYPEkind
120 :    
121 :     and pat = IDpat of id
122 : leunga 775 | CONSpat of ident * pat option
123 : leunga 744 | WILDpat
124 :     | ASpat of id * pat
125 :     | LITpat of literal
126 :     | LISTpat of pat list * pat option
127 :     | TUPLEpat of pat list
128 :     | RECORDpat of (id * pat) list * bool
129 : leunga 974 | TYPEDpat of pat * ty
130 : leunga 775 | NOTpat of pat
131 : leunga 744 | ORpat of pat list
132 : leunga 775 | ANDpat of pat list
133 :     | WHEREpat of pat * exp
134 :     | NESTEDpat of pat * exp * pat
135 : leunga 744
136 :     and ident = IDENT of id list * id
137 :    
138 :     and clause = CLAUSE of pat list * guard * exp
139 :    
140 :     and funbind = FUNbind of id * clause list
141 :    
142 :     and storagedecl =
143 :     CELLdecl of {id:id, nickname:id,
144 :     from:int ref,to:int ref,
145 :     alias:id option,
146 :     count:int option,bits:int,print:exp,
147 :     aggregable:bool,
148 :     defaults:(int*exp) list}
149 :    
150 :     and locbind = LOCbind of id * pat option * exp
151 :    
152 :     and endianess = LITTLE | BIG
153 :    
154 :     and archKind = VLIW | SUPERSCALAR
155 :    
156 :     and formatbind = FORMATbind of id * field list * exp option
157 :    
158 :     and field = FIELD of {id:id,width:width,sign:signedness,
159 :     cnv:cnv, value:Word32.word option}
160 :    
161 :     and width = WIDTH of int | RANGE of int * int
162 :    
163 :     and cnv = NOcnv
164 :     | CELLcnv of id
165 :     | FUNcnv of id
166 :    
167 :     and datatypebind = DATATYPEbind of
168 :     {id:id,tyvars:tyvar list,mc : opcodeencoding,asm : bool,
169 :     field:id option,cbs:consbind list}
170 :     | DATATYPEEQbind of {id:id, tyvars:tyvar list, ty:ty}
171 :    
172 : leunga 775 and exceptionbind = EXCEPTIONbind of id * ty option
173 :     | EXCEPTIONEQbind of id * ident
174 :    
175 : leunga 744 and consbind =
176 :     CONSbind of {id : id,ty:ty option,mc : mc option,
177 :     asm : assembly option,
178 :     rtl : exp option,
179 :     nop : flag,
180 :     nullified : flag,
181 :     delayslot : exp option,
182 :     delaycand : exp option,
183 :     sdi : exp option,
184 :     latency : exp option,
185 :     pipeline : exp option,
186 :     loc : loc
187 :     }
188 :    
189 :     and flag = FLAGon | FLAGoff | FLAGid of id * bool * exp
190 :    
191 :     and delayslot = DELAY_ERROR
192 :     | DELAY_NONE
193 :     | DELAY_ALWAYS
194 :     | DELAY_TAKEN
195 :     | DELAY_NONTAKEN
196 :     | DELAY_IF of branching * delayslot * delayslot
197 :    
198 :     and branching = BRANCHforwards
199 :     | BRANCHbackwards
200 :    
201 :     and mc = WORDmc of Word32.word
202 :     | EXPmc of exp
203 :    
204 :     and assembly = STRINGasm of string
205 :     | ASMasm of asm list
206 :    
207 :     and asm = TEXTasm of string
208 :     | EXPasm of exp
209 :    
210 :     and typebind = TYPEbind of id * tyvar list * ty
211 :    
212 :     and valbind = VALbind of pat * exp
213 :    
214 :     and signedness = SIGNED | UNSIGNED
215 :    
216 :     and tyvar = VARtv of id
217 :     | INTtv of id
218 :    
219 :     and rtlterm = LITrtl of id
220 :     | IDrtl of id
221 :     | COMPOSITErtl of id
222 :    
223 :     and cpubind = CPUbind of {name:id, aliases:string list, maxIssues:int,
224 :     resources: (int * id) list}
225 :     and pipelinebind = PIPELINEbind of id * (pat * pipelineexp) list
226 :    
227 :     and latencybind = LATENCYbind of id * (pat * exp) list
228 :    
229 :     and pipelineexp = PIPELINE of cycle list
230 :    
231 :     and cycle = ORcycle of cycle * cycle
232 :     | REPEATcycle of cycle * int
233 :     | IDcycle of id
234 :    
235 : leunga 999
236 : leunga 744 withtype range = int * int
237 :     and id = string
238 :     and guard = exp option
239 :     and opcodeencoding = int list option
240 :     and cellset = bool
241 :     and rtl = rtlterm list
242 : leunga 999 and sigconstraint = {abstract: bool, sigexp:sigexp}
243 : leunga 744
244 :     end

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