home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / compiler / Config.mlp < prev    next >
Encoding:
Text File  |  1997-08-18  |  3.4 KB  |  145 lines  |  [TEXT/R*ch]

  1. local open Fnlib in
  2.  
  3. (* Integer ranges *)
  4.  
  5. val maxint_byte = 255
  6. and minint_byte = 0
  7. and maxint_short = 32767
  8. and minint_short = (~32768)
  9. ;
  10.  
  11. (* The default name for executable bytecode files. *)
  12.  
  13. #ifdef unix
  14. val default_exec_name = "a.out";
  15. #endif
  16. #ifdef macintosh
  17. val default_exec_name = "Mosml.out";
  18. #endif
  19. #ifdef msdos
  20. val default_exec_name = "mosmlout.exe";
  21. #endif
  22.  
  23. (* Prompts *)
  24.  
  25. val toplevel_input_prompt = "- ";
  26. val toplevel_output_prompt = "> ";
  27. val toplevel_output_cont_prompt = "  ";
  28. val toplevel_error_prompt = "! ";
  29. val batch_output_prompt = "> ";
  30. val batch_output_cont_prompt = "  ";
  31. val batch_error_prompt = "! ";
  32.  
  33. (* Run-time values *)
  34.  
  35. val realTag = 254;
  36. val stringTag = 253;
  37. val abstractTag = 252;
  38. val noScanTag = 252;
  39. val closureTag = 251;
  40. val refTag = 250;
  41. val maxBlockTag = refTag-1;
  42.  
  43. (* Unit sets *)
  44.  
  45. val reservedUnitNames = ["General", "Top", "Meta"];
  46. val pervasiveOpenedUnits = ["General"];
  47.  
  48. val fulllib = ["Option", "List", "ListPair", "Strbase", "Char", "String",
  49.            "StringCvt", "TextIO", "BasicIO", "Vector", "Help",
  50.            "Array", "Misc", "Substring",
  51.            "Bool", "Int", "Real", "Math",
  52.            "Word", "Word8", "Word8Vector", "Word8Array", "Byte",
  53.            "BinIO", "CharVector", "CharArray",
  54.            "Time", "Timer", "Date", "Path",
  55.            "OS", "FileSys", "Process",
  56.            "Mosml", "PP", "CommandLine"]
  57.  
  58. val preloadedUnitSets = [
  59.   ("none",     []),
  60.   ("default",  ["Option", "List", "Strbase", "Char", "String",
  61.         "StringCvt", "TextIO", "BasicIO", "Vector", "Help",
  62.         "Array", "Misc"]),
  63.   ("full",     fulllib),
  64.   ("sml90",    ["Option", "List", "Strbase", "Char", "String",
  65.                 "StringCvt", "TextIO", "BasicIO", "Vector", "Help",
  66.         "Array", "Misc", "SML90"]),
  67.   ("nj93",     ["Option", "List", "Strbase", "Char", "String",
  68.         "StringCvt", "TextIO", "BasicIO", "NJ93", "Vector", "Help",
  69.         "Array", "Misc"])
  70. ];
  71.  
  72. val preopenedPreloadedUnitSets = [
  73.   ("none",     []),
  74.   ("default",  ["Misc", "Help"]),
  75.   ("full",     ["Misc", "Help"]),
  76.   ("sml90",    ["Misc", "SML90", "Help"]),
  77.   ("nj93",     ["Misc", "NJ93", "Help"]),
  78.   ("parsing",  ["Misc", "Help"])
  79. ];
  80.  
  81. #ifdef msdos
  82.  
  83. val kosherUnitNames = [
  84.   ("Basicio",  "BasicIO"),
  85.   ("Binio",    "BinIO"),
  86.   ("Chararra", "CharArray"),
  87.   ("Charvect", "CharVector"),
  88.   ("Commandl", "CommandLine"),
  89.   ("Filesys",  "FileSys"),
  90.   ("Listpair", "ListPair"),
  91.   ("Nj93",     "NJ93"),
  92.   ("Os",       "OS"),
  93.   ("Pp",       "PP"),
  94.   ("Sml90",    "SML90"),
  95.   ("Stringcv", "StringCvt"),
  96.   ("Substrin", "Substring"),
  97.   ("Textio",   "TextIO"),
  98.   ("Word8arr", "Word8Array"),
  99.   ("Word8vec", "Word8Vector")
  100. ];
  101.  
  102. local open CharVector; infix 9 sub; in
  103.  
  104.   fun normalizedFileName s = Fnlib.stringToLower s;
  105.  
  106.   fun normalizedUnitName s =
  107.     let val len = size s
  108.         val () = if len = 0 then raise SysErr("Empty unit name", NONE)
  109.          else ()
  110.         val len0 = if len>8 then 8 else len
  111.         val s0 = tabulate(len0, fn i =>
  112.           (case i of 0 => Char.toUpper
  113.                    | _ => Char.toLower) (s sub i))
  114.     in
  115.       lookup s0 kosherUnitNames
  116.         handle Subscript => s0
  117.     end;
  118.  
  119. end;
  120.  
  121. #else
  122. fun normalizedFileName s = s;
  123. fun normalizedUnitName s = s;
  124. #endif
  125.  
  126. (* To translate escape sequences *)
  127.  
  128. val char_for_backslash = fn
  129. #ifdef macintosh
  130. (* *)    #"n" => #"\013"
  131. (* *)  | #"r" => #"\010"
  132. #else
  133. (* *)    #"n" => #"\010"
  134. (* *)  | #"r" => #"\013"
  135. #endif
  136. (* *)  | #"a" => #"\007"
  137. (* *)  | #"b" => #"\008"
  138. (* *)  | #"t" => #"\009"
  139. (* *)  | #"v" => #"\011"
  140. (* *)  | #"f" => #"\012"
  141. (* *)  | c => c
  142. ;
  143.  
  144. end;
  145.