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

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/TopLevel/main/compile.sig
ViewVC logotype

Diff of /sml/trunk/src/compiler/TopLevel/main/compile.sig

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 878, Wed Jul 18 17:43:27 2001 UTC revision 879, Thu Jul 19 18:59:38 2001 UTC
# Line 1  Line 1 
1  (* COPYRIGHT (c) 1996 Bell Laboratories *)  (* COPYRIGHT (c) 1996 Bell Laboratories *)
2  (* compile.sig *)  (* compile.sig *)
3    
4  signature COMPILE0 =  (*
5  sig   * Trimmed to contain only compile-related stuff but no linking or execution.
6     *   -- 07/18/2001 (blume)
7     *)
8    
9    signature COMPILE0 = sig
10    
 exception Compile of string            (* raised during compilation only *)  
 exception SilentException              (* raised by CM *)  
 exception TopLevelException of exn     (* raised during executation only *)  
 exception TopLevelCallcc               (* raised during executation only *)  
 val architecture: string               (* machine architecture *)  
   
 (** important intermediate formats used during the compilations *)  
 type source     = CompBasic.source     (* the input file *)  
 type ast        = CompBasic.ast        (* concrete syntax *)  
 type absyn      = CompBasic.absyn      (* abstract syntax *)  
 type flint      = CompBasic.flint      (* intermediate code *)  
 type csegments  = CompBasic.csegments  (* binary code segments *)  
 type executable = CompBasic.executable (* machine executables *)  
 type object     = CompBasic.object         (* runtime object *)  
   
 (** environments and contexts used during the compilation *)  
 type statenv    = StaticEnv.staticEnv  (* static env   : symbol -> binding *)  
 type dynenv     = DynamicEnv.dynenv    (* dynamic env  : pid -> object *)  
 type symenv     = SymbolicEnv.symenv   (* symbolic env : pid -> flint *)  
   
 type compInfo   = CompBasic.compInfo   (* general compilation utilities *)  
 val mkCompInfo  : source * (absyn -> absyn) -> compInfo  
 val anyErrors   : compInfo -> bool  
   
 type lvar       = Access.lvar          (* local id *)  
 type pid        = PersStamps.persstamp (* persistant id *)  
 type import     = pid * CompBasic.importTree  (* import specification *)  
11  type pickle                            (* pickled format *)  type pickle                            (* pickled format *)
12  type hash                              (* environment hash id *)  type hash                              (* environment hash id *)
13    
14  (** take the input source and turn it into the concrete syntax *)      val mkCompInfo :
15  val parseOne    : source -> unit -> ast option (* incremental version *)          { source: Source.inputSource, transform: Absyn.dec -> Absyn.dec }
16  val parse       : source -> ast          -> CompInfo.compInfo
17    
18  (** take ast, do semantic checks, then output the new env, absyn and pickles *)      (** take ast, do semantic checks,
19  (*       ** then output the new env, absyn and pickles *)
20   * "statenv" must be the combination of all import environments.      val elaborate : { ast: Ast.dec,
21   * Each individual import environment must have been treated by                        statenv: StaticEnv.staticEnv,
22   * GenLinkPath.start prior to being put into "statenv".                        compInfo: CompInfo.compInfo }
23   * "getMap" fetches the linkpath map to be used for pickling.                      -> { absyn: Absyn.dec,
24   * "getEnv" fetches back environments during unpickling.  (We should not                           newstatenv: StaticEnv.staticEnv,
25   * use "statenv" here because the linkpath generator will cause it to                           exportLvars: Access.lvar list,
26   * be a partial copy of the original environments.)                           exportPid: PersStamps.persstamp option,
27   *)                           staticPid: hash,
28  val elaborate   : {ast: ast,                           pickle: pickle }
                    statenv: statenv,  
                    compInfo: compInfo}  
                    -> {absyn: absyn, newstatenv: statenv,  
                        exportLvars: lvar list, exportPid: pid option,  
                        staticPid: hash, pickle: pickle }  
29    
30  (** elaborate as above, then keep on to compile into the binary code *)  (** elaborate as above, then keep on to compile into the binary code *)
31  val compile     : {source: source, ast: ast,      val compile : { source: Source.inputSource,
32                     statenv: statenv,                      ast: Ast.dec,
33                     symenv: symenv, compInfo: compInfo,                      statenv: StaticEnv.staticEnv,
34                        symenv: SymbolicEnv.symenv,
35                        compInfo: CompInfo.compInfo,
36                     checkErr: string -> unit,                     checkErr: string -> unit,
37                     splitting: int option}                     splitting: int option}
38                     -> {csegments: csegments, newstatenv: statenv,                    -> { csegments: CodeObj.csegments,
39                         absyn: absyn (* for pretty printing only *),                         newstatenv: StaticEnv.staticEnv,
40                         exportPid: pid option, exportLvars: lvar list,                         absyn: Absyn.dec (* for pretty printing only *),
41                         staticPid: hash, pickle: pickle,                         exportPid: PersStamps.persstamp option,
42                         inlineExp: flint option, imports: import list }                         exportLvars: Access.lvar list,
43                           staticPid: hash,
44  (** build the new symbolic environment *)                         pickle: pickle,
45  val mksymenv    : pid option * flint option -> symenv                         inlineExp: FLINT.prog option,
46                           imports: ImportTree.import list }
 (** turn the byte-vector-like code segments into an executable closure *)  
 val mkexec      : csegments -> executable  
   
 (** just like f x, except that it catches top-level callcc's *)  
 val isolate     : ('a -> 'b) -> 'a -> 'b  
   
 (** perform the execution of the excutable, output the new dynenv *)  
 val execute     : {executable: executable, imports: import list,  
                    exportPid: pid option, dynenv: dynenv} -> dynenv  
47    
48  end (* signature COMPILE0 *)  end (* signature COMPILE0 *)
49    

Legend:
Removed from v.878  
changed lines
  Added in v.879

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