home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / compiler / Config.mlp < prev    next >
Encoding:
Text File  |  1996-07-03  |  3.1 KB  |  135 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 preloadedUnitSets = [
  49.   ("none",     []),
  50.   ("default",  ["List", "Char", "Strbase", "String",
  51.                    "BasicIO", "Vector", "Misc", "Array"]),
  52.   ("full",     ["List", "ListPair", "Char", "Strbase", "String",
  53.                "BasicIO", "Vector", "Misc", "Array", 
  54.         "StringCvt", "Bool", "Integer", "Real", "Math",
  55.             "Word", "Word8", "Word8Vector", "Word8Array", "Byte",
  56.          "CharVector", "CharArray", 
  57.         "Time", "Timer", "Date", "Substring", "Path",
  58.         "OS", "FileSys", "Process",
  59.         "Mosml", "PP"]),
  60.   ("oldbasis", ["List", "Char", "Strbase", "String",
  61.                 "BasicIO", "Vector", "Miscoldb", "Array"]),
  62.   ("nj93",     ["List", "Char", "Strbase", "String",
  63.         "BasicIO", "NJ93", "Vector", "Miscnj93", "Array"])
  64. ];
  65.  
  66. val preopenedPreloadedUnitSets = [
  67.   ("none",     []),
  68.   ("default",  ["BasicIO", "Misc"]),
  69.   ("full",     ["BasicIO", "Misc"]),
  70.   ("oldbasis", ["BasicIO", "Miscoldb"]),
  71.   ("nj93",     ["BasicIO", "NJ93", "Miscnj93"])
  72. ];
  73.  
  74. #ifdef msdos
  75.  
  76. val kosherUnitNames = [
  77.   ("Basicio",  "BasicIO"),
  78.   ("Binio",    "BinIO"),
  79.   ("Chararra", "CharArray"),
  80.   ("Charvect", "CharVector"),
  81.   ("Fmtdate",  "FmtDate"),
  82.   ("Filesys",  "FileSys"),
  83.   ("Listpair", "ListPair"),
  84.   ("Nj93",     "NJ93"),
  85.   ("Os",       "OS"),
  86.   ("Pp",       "PP"),
  87.   ("Stringcv", "StringCvt"),
  88.   ("Textio",   "TextIO"),
  89.   ("Word8arr", "Word8Array"),
  90.   ("Word8vec", "Word8Vector")
  91. ];
  92.  
  93. local open CharVector; infix 9 sub; in
  94.  
  95.   fun normalizedFileName s =
  96.     let val len = size s in
  97.       tabulate(len, fn i => charToLowerCase(s sub i))
  98.     end;
  99.  
  100.   fun normalizedUnitName s =
  101.     let val len = size s
  102.         val () = if len = 0 then raise (Io "Empty unit name") else ()
  103.         val len0 = if len>8 then 8 else len
  104.         val s0 = tabulate(len0, fn i =>
  105.           (case i of 0 => charToUpperCase
  106.                    | _ => charToLowerCase) (s sub i))
  107.     in
  108.       lookup s0 kosherUnitNames
  109.         handle Subscript => s0
  110.     end;
  111.  
  112. end;
  113.  
  114. #else
  115. fun normalizedFileName s = s;
  116. fun normalizedUnitName s = s;
  117. #endif
  118.  
  119. (* To translate escape sequences *)
  120.  
  121. val char_for_backslash = fn
  122. #ifdef macintosh
  123. (* *)    #"n" => #"\^M"
  124. (* *)  | #"r" => #"\^J"
  125. #else
  126. (* *)    #"n" => #"\^J"
  127. (* *)  | #"r" => #"\^M"
  128. #endif
  129. (* *)  | #"b" => #"\^H"
  130. (* *)  | #"t" => #"\t"
  131. (* *)  | c => c
  132. ;
  133.  
  134. end;
  135.