defs.tex 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. \newcommand{\itm}[1]{\ensuremath{\mathit{#1}}}
  3. \newcommand{\ttm}[1]{\ensuremath{\mathtt{#1}}}
  4. \newcommand{\Stmt}{\itm{stmt}}
  5. \newcommand{\Exp}{\itm{exp}}
  6. \newcommand{\Def}{\itm{def}}
  7. \newcommand{\Type}{\itm{type}}
  8. \newcommand{\FType}{\itm{ftype}}
  9. \newcommand{\Instr}{\itm{instr}}
  10. \newcommand{\Block}{\itm{block}}
  11. \newcommand{\Tail}{\itm{tail}}
  12. \newcommand{\Prog}{\itm{prog}}
  13. \newcommand{\Arg}{\itm{arg}}
  14. \newcommand{\Atm}{\itm{atm}}
  15. \newcommand{\Reg}{\itm{reg}}
  16. \newcommand{\Int}{\itm{int}}
  17. \newcommand{\Var}{\itm{var}}
  18. \newcommand{\Op}{\itm{op}}
  19. \newcommand{\key}[1]{\texttt{#1}}
  20. \newcommand{\code}[1]{\texttt{#1}}
  21. \newcommand{\LP}[0]{\key{(}}
  22. \newcommand{\RP}[0]{\key{)}}
  23. \newcommand{\LS}[0]{\key{[}}
  24. \newcommand{\RS}[0]{\key{]}}
  25. \newcommand{\INT}[1]{\key{(Int}\;#1\key{)}}
  26. \newcommand{\BOOL}[1]{\key{(Bool}\;#1\key{)}}
  27. \newcommand{\PRIM}[2]{\LP\key{Prim}~#1~\LP\key{list}~#2\RP\RP}
  28. \newcommand{\READ}{\key{(Prim}\;\code{'read}\;\key{'())}}
  29. \newcommand{\CREAD}{\key{(read)}}
  30. \newcommand{\NEG}[1]{\key{(Prim}\;\code{'-}\;\code{(list}\;#1\;\code{))}}
  31. \newcommand{\CNEG}[1]{\LP\key{-}~#1\RP}
  32. \newcommand{\PROGRAM}[2]{\LP\code{Program}\;#1\;#2\RP}
  33. \newcommand{\PROGRAMDEFSEXP}[3]{\code{(ProgramDefsExp}~#1~#2~#3\code{)}}
  34. \newcommand{\PROGRAMDEFS}[2]{\code{(ProgramDefs}~#1~#2\code{)}}
  35. \newcommand{\ADD}[2]{\key{(Prim}\;\code{'+}\;\code{(list}\;#1\;#2\code{))}}
  36. \newcommand{\CADD}[2]{\LP\key{+}~#1~#2\RP}
  37. \newcommand{\SUB}[2]{\key{(Prim}\;\code{'-}\;\code{(list}\;#1\;#2\code{))}}
  38. \newcommand{\CSUB}[2]{\LP\key{-}~#1~#2\RP}
  39. \newcommand{\CWHILE}[2]{\LP\key{while}~#1~#2\RP}
  40. \newcommand{\WHILE}[2]{\LP\key{WhileLoop}~#1~#2\RP}
  41. \newcommand{\CBEGIN}[2]{\LP\key{begin}~#1~#2\RP}
  42. \newcommand{\BEGIN}[2]{\LP\key{Begin}~#1~#2\RP}
  43. \newcommand{\CSETBANG}[2]{\LP\key{set!}~#1~#2\RP}
  44. \newcommand{\SETBANG}[2]{\LP\key{SetBang}~#1~#2\RP}
  45. \newcommand{\AND}[2]{\key{(Prim}\;\code{'and}\;\code{(list}\;#1\;#2\code{))}}
  46. \newcommand{\OR}[2]{\key{(Prim}\;\code{'or}\;\code{(list}\;#1\;#2\code{))}}
  47. \newcommand{\NOT}[1]{\key{(Prim}\;\code{'not}\;\code{(list}\;#1\;\code{))}}
  48. \newcommand{\UNIOP}[2]{\key{(Prim}\;#1\;\code{(list}\;#2\code{))}}
  49. \newcommand{\CUNIOP}[2]{\LP #1\;#2 \RP}
  50. \newcommand{\BINOP}[3]{\key{(Prim}\;#1\;\code{(list}\;#2\;#3\code{))}}
  51. \newcommand{\CBINOP}[3]{\LP #1\;#2\;#3\RP}
  52. \newcommand{\CLET}[3]{\LP\key{let}~\LP\LS#1~#2\RS\RP~#3\RP}
  53. \newcommand{\CIF}[3]{\LP\key{if}~#1~#2~#3\RP}
  54. \newcommand{\VAR}[1]{\key{(Var}\;#1\key{)}}
  55. \newcommand{\LET}[3]{\key{(Let}~#1~#2~#3\key{)}}
  56. \newcommand{\IF}[3]{\key{(If}\,#1\;#2\;#3\key{)}}
  57. \newcommand{\CAST}[3]{\LP\key{Cast}~#1~#2~#3\RP}
  58. \newcommand{\VECTOR}[1]{\LP\key{Prim}\;\code{'vector}\;\LP\key{list}\;#1\RP\RP}
  59. \newcommand{\VECREF}[2]{\LP\key{Prim}\;\code{'vector-ref}\;\LP\key{list}\;#1\;#2\RP\RP}
  60. \newcommand{\VECSET}[3]{\LP\key{Prim}\;\code{'vector-set!}\;\LP\key{list}\;#1\;#2\;#3\RP\RP}
  61. \newcommand{\VECLEN}[1]{\LP\key{Prim}\;\code{'vector-length}\;\LP\key{list}\;#1\RP\RP}
  62. \newcommand{\ANYVECREF}[2]{\LP\key{Prim}\;\code{'any-vector-ref}\;\LP\key{list}\;#1\;#2\RP\RP}
  63. \newcommand{\ANYVECSET}[3]{\LP\key{Prim}\;\code{'any-vector-set!}\;\LP\key{list}\;#1\;#2\;#3\RP\RP}
  64. \newcommand{\ANYVECLEN}[1]{\LP\key{Prim}\;\code{'any-vector-length}\;\LP\key{list}\;#1\RP\RP}
  65. \newcommand{\CLOSURE}[2]{\LP\key{Closure}~#1~#2\RP}
  66. \newcommand{\ALLOC}[2]{\LP\key{Allocate}~#1~#2\RP}
  67. \newcommand{\ALLOCCLOS}[3]{\LP\key{AllocateClosure}~#1~#2~#3\RP}
  68. \newcommand{\VOID}[1]{\key{(Void)}}
  69. \newcommand{\APPLY}[2]{\key{(Apply}\;#1\;#2\code{)}}
  70. \newcommand{\CALL}[2]{\key{(Call}\;#1\;#2\code{)}}
  71. \newcommand{\TAILCALL}[2]{\key{(TailCall}\;#1\;#2\code{)}}
  72. \newcommand{\FUNDEF}[5]{\key{(Def}~#1~#2~#3~#4~#5\code{)}}
  73. \newcommand{\FUNREF}[1]{\key{(FunRef}\;#1\code{)}}
  74. \newcommand{\CFUNREF}[1]{\key{(fun-ref}\;#1\code{)}}
  75. \newcommand{\FUNREFARITY}[2]{\key{(FunRefArity}~#1~#2\code{)}}
  76. \newcommand{\CFUNREFARITY}[2]{\key{(fun-ref-arity}~#1~#2\code{)}}
  77. \newcommand{\LAMBDA}[3]{\key{(Lambda}~#1~#2~#3\code{)}}
  78. \newcommand{\CLAMBDA}[3]{\LP\key{lambda:}\,#1\,\key{:}\,#2\;\Exp\RP}
  79. \newcommand{\CGLAMBDA}[3]{\LP\key{lambda:}\,#1\,#2\;\Exp\RP}
  80. \newcommand{\INJECT}[2]{\LP\key{Inject}~#1~#2\RP}
  81. \newcommand{\PROJECT}[2]{\LP\key{Project}~#1~#2\RP}
  82. \newcommand{\CINJECT}[2]{\LP\key{inject}~#1~#2\RP}
  83. \newcommand{\CPROJECT}[2]{\LP\key{project}~#1~#2\RP}
  84. \newcommand{\VALUEOF}[2]{\LP\key{ValueOf}~#1~#2\RP}
  85. \newcommand{\ASSIGN}[2]{\key{(Assign}~#1\;#2\key{)}}
  86. \newcommand{\RETURN}[1]{\key{(Return}~#1\key{)}}
  87. \newcommand{\SEQ}[2]{\key{(Seq}~#1~#2\key{)}}
  88. \newcommand{\GOTO}[1]{\key{(Goto}~#1\key{)}}
  89. \newcommand{\IFSTMT}[3]{\key{(IfStmt}\,#1\;#2\;#3\key{)}}
  90. \newcommand{\IMM}[1]{\key{(Imm}\;#1\key{)}}
  91. \newcommand{\REG}[1]{\key{(Reg}\;#1\key{)}}
  92. \newcommand{\BYTEREG}[1]{\key{(ByteReg}\;#1\key{)}}
  93. \newcommand{\DEREF}[2]{\key{(Deref}~#1~#2\key{)}}
  94. \newcommand{\DEF}[5]{\key{(Def}~#1~#2~#3~#4~#5\key{)}}
  95. \newcommand{\CDEF}[4]{\LP\key{define}~\LP#1~#2\RP\,\key{:}\,#3~#4\RP}
  96. \newcommand{\CGDEF}[4]{\LP\key{define}~\LP#1~#2\RP\,#3~#4\RP}
  97. \newcommand{\CFG}[1]{\key{(CFG}\;#1\key{)}}
  98. \newcommand{\BLOCK}[2]{\key{(Block}\;#1\;#2\key{)}}
  99. \newcommand{\STACKLOC}[1]{(\key{stack}\;#1)}
  100. \newcommand{\BININSTR}[3]{\key{(Instr}\;#1\;\key{(list}\;#2\;#3\key{))}}
  101. \newcommand{\UNIINSTR}[2]{\key{(Instr}\;#1\;\key{(list}\;#2\key{))}}
  102. \newcommand{\CALLQ}[2]{\key{(Callq}~#1~#2\key{)}}
  103. \newcommand{\INDCALLQ}[2]{\key{(IndirectCallq}~#1~#2\key{)}}
  104. \newcommand{\RETQ}{\key{(Retq)}}
  105. \newcommand{\PUSHQ}[1]{\key{(Pushq}~#1\key{)}}
  106. \newcommand{\POPQ}[1]{\key{(Popq}~#1\key{)}}
  107. \newcommand{\JMP}[1]{\key{(Jmp}~#1\key{)}}
  108. \newcommand{\TAILJMP}[2]{\key{(TailJmp}~#1~#2\key{)}}
  109. \newcommand{\JMPIF}[2]{\key{(JmpIf}~#1~#2\key{)}}
  110. \newcommand{\TTKEY}[1]{{\normalfont\tt #1}}