|
|
1.1 root 1: (* Copyright 1989 by AT&T Bell Laboratories *)
2: (* Abstract syntax of bare ML *)
3:
4: structure BareAbsyn : BAREABSYN = struct
5:
6: structure Basics = Basics
7: structure Access = Access
8: type linenum = string * int
9:
10: open Basics Access
11:
12: datatype numberedLabel = LABEL of {name : Symbol.symbol, number: int};
13:
14: datatype exp = VARexp of var ref
15: | CONexp of datacon
16: | INTexp of int
17: | REALexp of string
18: | STRINGexp of string
19: | RECORDexp of (numberedLabel * exp) list
20: | SEQexp of exp list
21: | APPexp of exp * exp
22: | CONSTRAINTexp of exp * ty
23: | HANDLEexp of exp * handler
24: | RAISEexp of exp
25: | LETexp of dec * exp
26: | CASEexp of exp * rule list
27: | FNexp of rule list
28: | MARKexp of exp * linenum * linenum
29:
30: and rule = RULE of pat * exp
31:
32: and handler = HANDLER of exp
33:
34: and pat = WILDpat
35: | VARpat of var
36: | INTpat of int
37: | REALpat of string
38: | STRINGpat of string
39: | CONpat of datacon
40: | RECORDpat of {fields : (label * pat) list, flex : bool,
41: typ : ty ref, pats : pat list ref}
42: | APPpat of datacon * pat
43: | CONSTRAINTpat of pat * ty
44: | LAYEREDpat of pat * pat
45:
46: and strexp = VARstr of structureVar
47: | STRUCTstr of {body: dec list, locations: trans list}
48: | APPstr of {oper: functorVar, argexp: strexp, argthin: thinning}
49: | LETstr of dec * strexp
50:
51: and dec = VALdec of vb list
52: | VALRECdec of rvb list
53: | TYPEdec of tb list
54: | DATATYPEdec of {datatycs: tycon ref list, withtycs: tb list}
55: | ABSTYPEdec of {abstycs: tycon ref list, withtycs: tb list, body: dec}
56: | EXCEPTIONdec of eb list
57: | STRdec of strb list
58: | ABSdec of strb list
59: | FCTdec of fctb list
60: | SIGdec of signatureVar list
61: | LOCALdec of dec * dec
62: | SEQdec of dec list
63: | OPENdec of structureVar list
64: | IMPORTdec of string list
65: | MARKdec of dec * linenum * linenum
66:
67: and vb = VB of {pat:pat, exp:exp, tyvars: tyvar list}
68:
69: and rvb = RVB of {var:var, exp:exp, resultty: ty option, tyvars: tyvar list}
70:
71: and fb = FB of {var:var, clauses: clause list, tyvars: tyvar list}
72:
73: and clause = CLAUSE of {pats: pat list, resultty: ty option, exp:exp}
74:
75: and tb = TB of {tyc : tycon ref, def : ty}
76:
77: and eb = EBgen of {exn: datacon, etype: ty option}
78: | EBdef of {exn: datacon, edef: datacon}
79:
80: and strb = STRB of {strvar: structureVar, def: strexp,
81: thin: thinning, constraint: Structure option}
82:
83: and fctb = FCTB of {fctvar: functorVar, param: structureVar, def: strexp,
84: thin: thinning, constraint: Structure option}
85:
86: end (* structure BareAbsyn *)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.