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 / Prim.sml < prev    next >
Encoding:
Text File  |  1996-07-03  |  1.3 KB  |  62 lines  |  [TEXT/R*ch]

  1. (* The type of primitives *)
  2.  
  3. local
  4.   open Const;
  5. in
  6.  
  7. datatype primitive =
  8.     Pidentity
  9.   | Pget_global of QualifiedIdent * int
  10.   | Pset_global of QualifiedIdent * int
  11.   | Pdummy of int
  12.   | Pupdate
  13.   | Ptest of bool_test
  14.   | Pmakeblock of BlockTag
  15.   | Ptag_of
  16.   | Pfield of int
  17.   | Psetfield of int
  18.   | Pccall of string * int
  19.   | Praise
  20.   | Pnot
  21.   | Pnegint | Psuccint | Ppredint
  22.   | Paddint | Psubint | Pmulint | Pdivint | Pmodint
  23.   | Pandint | Porint | Pxorint
  24.   | Pshiftleftint | Pshiftrightintsigned | Pshiftrightintunsigned
  25.   | Pincr | Pdecr
  26.   | Pintoffloat
  27.   | Pfloatprim of float_primitive
  28.   | Pstringlength | Pgetstringchar | Psetstringchar
  29.   | Pmakevector | Pvectlength | Pgetvectitem | Psetvectitem
  30.   | Psmlnegint | Psmlsuccint | Psmlpredint
  31.   | Psmladdint | Psmlsubint | Psmlmulint | Psmldivint | Psmlmodint
  32.   | Pmakerefvector
  33.   | Pbreak
  34.   | Patom of int
  35.   | Psmlquotint | Psmlremint
  36.  
  37.  
  38. and float_primitive =
  39.     Pfloatofint
  40.   | Pnegfloat | Paddfloat | Psubfloat | Pmulfloat | Pdivfloat
  41.   | Psmlnegfloat | Psmladdfloat | Psmlsubfloat | Psmlmulfloat | Psmldivfloat
  42.  
  43. and bool_test =
  44.     Peq_test
  45.   | Pnoteq_test
  46.   | Pint_test of int prim_test
  47.   | Pfloat_test of real prim_test
  48.   | Pstring_test of string prim_test
  49.   | Pnoteqtag_test of BlockTag
  50.  
  51. and 'a prim_test =
  52.     PTeq
  53.   | PTnoteq
  54.   | PTnoteqimm of 'a
  55.   | PTlt
  56.   | PTle
  57.   | PTgt
  58.   | PTge
  59. ;
  60.  
  61. end;
  62.