1 28 29 package org.jruby.compiler; 30 31 import org.jruby.lexer.yacc.ISourcePosition; 32 import org.jruby.parser.StaticScope; 33 import org.jruby.util.ByteList; 34 35 45 public interface Compiler { 46 50 public void startScript(); 51 52 56 public void endScript(); 57 58 66 public Object beginMethod(String friendlyName, int arity, int localVarCount); 67 68 72 public void endMethod(Object token); 73 74 80 public void consumeCurrentValue(); 81 82 87 public void lineNumber(ISourcePosition node); 88 89 95 public void invokeDynamic(String name, boolean hasReceiver, boolean hasArgs, ClosureCallback closureArg); 96 97 102 public void yield(boolean hasArgs); 103 104 110 public void assignLocalVariable(int index); 111 112 public void retrieveLocalVariable(int index); 113 114 public void assignLocalVariable(int index, int depth); 115 116 public void retrieveLocalVariable(int index, int depth); 117 118 public void retrieveSelf(); 119 120 123 public void createNewFixnum(long value); 124 125 128 public void createNewBignum(java.math.BigInteger value); 129 130 133 public void createNewString(ByteList value); 134 135 138 public void createNewSymbol(String name); 139 140 147 public void createObjectArray(Object [] elementArray, ArrayCallback callback); 148 149 153 public void createNewArray(); 154 155 158 public void createEmptyArray(); 159 160 public void performBooleanBranch(BranchCallback trueBranch, BranchCallback falseBranch); 161 162 public void performLogicalAnd(BranchCallback longBranch); 163 164 public void performLogicalOr(BranchCallback longBranch); 165 166 public void performBooleanLoop(BranchCallback condition, BranchCallback body, boolean checkFirst); 167 168 public void createNewClosure(StaticScope scope, int arity, ClosureCallback body); 169 170 public void defineNewMethod(String name, int arity, int localVarCount, ClosureCallback body); 171 172 public void defineAlias(String newName, String oldName); 173 174 public void retrieveConstant(String name); 175 176 public void loadFalse(); 177 178 public void loadTrue(); 179 180 public void loadNil(); 181 182 public void retrieveInstanceVariable(String name); 183 184 public void assignInstanceVariable(String name); 185 186 public void assignGlobalVariable(String name); 187 188 public void retrieveGlobalVariable(String name); 189 190 public void negateCurrentValue(); 191 192 196 public void splatCurrentValue(); 197 198 202 public void singlifySplattedValue(); 203 204 208 public void forEachInValueArray(int count, int start, Object source, ArrayCallback callback); 209 210 213 public void ensureRubyArray(); 214 215 218 public void loadInteger(int value); 219 220 223 public void performGEBranch(BranchCallback trueBranch, BranchCallback falseBranch); 224 225 228 public void performGTBranch(BranchCallback trueBranch, BranchCallback falseBranch); 229 230 233 public void performLEBranch(BranchCallback trueBranch, BranchCallback falseBranch); 234 235 238 public void performLTBranch(BranchCallback trueBranch, BranchCallback falseBranch); 239 240 public void loadRubyArraySize(); 241 } 242 | Popular Tags |