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

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