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/ml-nlffigen/gen.sml
ViewVC logotype

Diff of /sml/trunk/src/ml-nlffigen/gen.sml

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

revision 839, Thu Jun 7 20:28:44 2001 UTC revision 840, Fri Jun 15 19:05:19 2001 UTC
# Line 8  Line 8 
8   *)   *)
9  local  local
10      val program = "ml-ffigen"      val program = "ml-ffigen"
11      val version = "0.2"      val version = "0.3"
12      val author = "Matthias Blume"      val author = "Matthias Blume"
13      val email = "blume@research.bell-labs.com"      val email = "blume@research.bell-labs.com"
14      structure S = Spec      structure S = Spec
# Line 24  Line 24 
24                  strname: string,                  strname: string,
25                  allSU: bool,                  allSU: bool,
26                  lambdasplit: string option,                  lambdasplit: string option,
27                  wid: int } -> unit                  wid: int,
28                    target : { name  : string,
29                               sizes : Sizes.sizes,
30                               shift : int * int * word -> word,
31                               stdcall : bool } } -> unit
32  end = struct  end = struct
33    
34      structure P = PrettyPrint      structure P = PrettyPrint
# Line 47  Line 51 
51    
52      val dontedit = "(* This file has been generated automatically. \      val dontedit = "(* This file has been generated automatically. \
53                     \DO NOT EDIT! *)"                     \DO NOT EDIT! *)"
54      fun mkCredits src = concat ["(* [from ", src, " by ", author, "'s ",      fun mkCredits (src, archos) =
55                                  program, " (version ", version, ")] *)"]          concat ["(* [from ", src, " by ", author, "'s ",
56                    program, " (version ", version, ") for ",
57                    archos, "] *)"]
58      val commentsto = concat ["(* Send comments and suggestions to ",      val commentsto = concat ["(* Send comments and suggestions to ",
59                               email, ". Thanks! *)"]                               email, ". Thanks! *)"]
60    
# Line 58  Line 64 
64                sigfile, strfile, cmfile,                sigfile, strfile, cmfile,
65                signame, strname,                signame, strname,
66                allSU, lambdasplit,                allSU, lambdasplit,
67                wid } = args                wid,
68                  target = { name = archos, sizes, shift, stdcall } } = args
69    
70          val credits = mkCredits idlfile          val credits = mkCredits (idlfile, archos)
71    
72          val astbundle = ParseToAst.fileToAst'          val astbundle = ParseToAst.fileToAst'
73                              TextIO.stdErr                              TextIO.stdErr
74                              (GenSizes.sizes, State.INITIAL)                              (sizes, State.INITIAL)
75                              idlsource                              idlsource
76    
77          val spec = AstToSpec.build (astbundle, GenSizes.sizes, idlfile, allSU)          val spec = AstToSpec.build (astbundle, sizes, idlfile, allSU, shift)
78    
79          val { structs, unions, gvars, gfuns, gtys } = spec          val { structs, unions, gvars, gfuns, gtys } = spec
80    
# Line 575  Line 582 
582    
583                  val e_arg = Tuple (Unit :: map encode args)                  val e_arg = Tuple (Unit :: map encode args)
584                  val e_res = case res of NONE => Unit | SOME t => encode t                  val e_res = case res of NONE => Unit | SOME t => encode t
585                  val e_proto = Con ("list", [Arrow (e_arg, e_res)])                  val e_proto0 = Con ("list", [Arrow (e_arg, e_res)])
586                    val e_proto =
587                        if stdcall then Con ("list", [e_proto0]) else e_proto0
588    
589                  (* generating the call operation *)                  (* generating the call operation *)
590    

Legend:
Removed from v.839  
changed lines
  Added in v.840

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