1 /* Digital Mars DMDScript source code. 2 * Copyright (c) 2000-2002 by Chromium Communications 3 * D version Copyright (c) 2004-2010 by Digital Mars 4 * Distributed under the Boost Software License, Version 1.0. 5 * (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 * written by Walter Bright 7 * http://www.digitalmars.com 8 * 9 * D2 port by Dmitry Olshansky 10 * 11 * DMDScript is implemented in the D Programming Language, 12 * http://www.digitalmars.com/d/ 13 * 14 * For a C++ implementation of DMDScript, including COM support, see 15 * http://www.digitalmars.com/dscript/cppscript.html 16 */ 17 18 19 // Opcodes for our Intermediate Representation (IR) 20 21 module dmdscript.ir; 22 23 enum 24 { 25 IRerror, 26 IRnop, // no operation 27 IRend, // end of function 28 IRstring, 29 IRthisget, 30 IRnumber, 31 IRobject, 32 IRthis, 33 IRnull, 34 IRundefined, 35 IRboolean, 36 IRcall, 37 IRcalls = IRcall + 1, 38 IRcallscope = IRcalls + 1, 39 IRcallv = IRcallscope + 1, 40 IRputcall, 41 IRputcalls = IRputcall + 1, 42 IRputcallscope = IRputcalls + 1, 43 IRputcallv = IRputcallscope + 1, 44 IRget, 45 IRgets = IRget + 1, // 's' versions must be original + 1 46 IRgetscope = IRgets + 1, 47 IRput, 48 IRputs = IRput + 1, 49 IRputscope = IRputs + 1, 50 IRdel, 51 IRdels = IRdel + 1, 52 IRdelscope = IRdels + 1, 53 IRnext, 54 IRnexts = IRnext + 1, 55 IRnextscope = IRnexts + 1, 56 IRaddass, 57 IRaddasss = IRaddass + 1, 58 IRaddassscope = IRaddasss + 1, 59 IRputthis, 60 IRputdefault, 61 IRmov, 62 IRret, 63 IRretexp, 64 IRimpret, 65 IRneg, 66 IRpos, 67 IRcom, 68 IRnot, 69 IRadd, 70 IRsub, 71 IRmul, 72 IRdiv, 73 IRmod, 74 IRshl, 75 IRshr, 76 IRushr, 77 IRand, 78 IRor, 79 IRxor, 80 IRin, 81 IRpreinc, 82 IRpreincs = IRpreinc + 1, 83 IRpreincscope = IRpreincs + 1, 84 85 IRpredec, 86 IRpredecs = IRpredec + 1, 87 IRpredecscope = IRpredecs + 1, 88 89 IRpostinc, 90 IRpostincs = IRpostinc + 1, 91 IRpostincscope = IRpostincs + 1, 92 93 IRpostdec, 94 IRpostdecs = IRpostdec + 1, 95 IRpostdecscope = IRpostdecs + 1, 96 97 IRnew, 98 99 IRclt, 100 IRcle, 101 IRcgt, 102 IRcge, 103 IRceq, 104 IRcne, 105 IRcid, 106 IRcnid, 107 108 IRjt, 109 IRjf, 110 IRjtb, 111 IRjfb, 112 IRjmp, 113 114 IRjlt, // commonly appears as loop control 115 IRjle, // commonly appears as loop control 116 117 IRjltc, // commonly appears as loop control 118 IRjlec, // commonly appears as loop control 119 120 IRtypeof, 121 IRinstance, 122 123 IRpush, 124 IRpop, 125 126 IRiter, 127 IRassert, 128 129 IRthrow, 130 IRtrycatch, 131 IRtryfinally, 132 IRfinallyret, 133 IRcheckref,//like scope get w/o target, occures mostly on (legal) programmer mistakes 134 IRMAX 135 } 136 137