/** * Compile the expression - leave boolean expression on stack */ public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); _base.translate(classGen, methodGen); _token.translate(classGen, methodGen); il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS, "startsWith", "("+STRING_SIG+")Z"))); } }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(BOOLEAN_CLASS))); il.append(new INVOKEVIRTUAL(cpg.addMethodref(BOOLEAN_CLASS, BOOLEAN_VALUE, BOOLEAN_VALUE_SIG))); }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(DOUBLE_CLASS))); il.append(new INVOKEVIRTUAL(cpg.addMethodref(DOUBLE_CLASS, DOUBLE_VALUE, DOUBLE_VALUE_SIG))); }
/** * Translates an object of this type to its unboxed representation. */ public void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new CHECKCAST(cpg.addClass(INTEGER_CLASS))); final int index = cpg.addMethodref(INTEGER_CLASS, INT_VALUE, INT_VALUE_SIG); il.append(new INVOKEVIRTUAL(index)); }
/** * Translates a string into a non-synthesized boolean. It does not push a * 0 or a 1 but instead returns branchhandle list to be appended to the * false list. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateToDesynthesized */ public FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, BooleanType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS, "length", "()I"))); return new FlowList(il.append(new IFEQ(null))); }
"<init>", "()V"); final Instruction append = new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS, "append", "(" + STRING_SIG + ")" il.append(append); il.append(new INVOKEVIRTUAL(toString));
/** * Compile expression and update true/false-lists */ public void translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); _base.translate(classGen, methodGen); _token.translate(classGen, methodGen); il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS, "indexOf", "("+STRING_SIG+")I"))); _falseList.add(il.append(new IFLT(null))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); if (argumentCount() > 0) { argument().translate(classGen, methodGen); } else { il.append(methodGen.loadContextNode()); Type.Node.translateTo(classGen, methodGen, Type.String); } il.append(new INVOKEVIRTUAL(cpg.addMethodref(STRING_CLASS, "length", "()I"))); } }
il.append(new INVOKEVIRTUAL(getKeyIndex)); if (this instanceof IdPattern) il.append(new INVOKEVIRTUAL(lookupId)); il.append(new INVOKEVIRTUAL(lookupKey));
il.append(methodGen.loadHandler()); il.append(methodGen.loadCurrentNode()); il.append(new INVOKEVIRTUAL(cpg.addMethodref(className, methodName, "("
"<init>", "()V"); final Instruction append = new INVOKEVIRTUAL(cpg.addMethodref(STRING_BUFFER_CLASS, "append", "("+STRING_SIG+")" il.append(append); il.append(new INVOKEVIRTUAL(toString));
il.append(DUP); il.append(new PUSH(cpg, "NaN")); il.append(new INVOKEVIRTUAL(nan)); il.append(DUP); il.append(new PUSH(cpg, "Infinity")); il.append(new INVOKEVIRTUAL(inf)); il.append(new INVOKEVIRTUAL(put));
PUSH_PARAM_FRAME, PUSH_PARAM_FRAME_SIG); il.append(new INVOKEVIRTUAL(pushFrame)); functionName, signature); il.append(new INVOKEVIRTUAL(applyTemplates)); POP_PARAM_FRAME, POP_PARAM_FRAME_SIG); il.append(new INVOKEVIRTUAL(pushFrame));
/** * Expects an integer on the stack and pushes its string value by calling * <code>Integer.toString(int i)</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, StringType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(DUP); final BranchHandle ifNull = il.append(new IFNULL(null)); il.append(new INVOKEVIRTUAL(cpg.addMethodref(_javaClassName, "toString", "()" + STRING_SIG))); final BranchHandle gotobh = il.append(new GOTO(null)); ifNull.setTarget(il.append(POP)); il.append(new PUSH(cpg, "")); gotobh.setTarget(il.append(NOP)); }
il.append(new INVOKEVIRTUAL(cpg.addMethodref(TRANSLET_CLASS, ADD_PARAMETER, ADD_PARAMETER_SIG)));
_filename.translate(classGen, methodGen); il.append(new PUSH(cpg, _append)); il.append(new INVOKEVIRTUAL(open)); il.append(new INVOKEVIRTUAL(close));
_name.translate(classGen, methodGen); il.append(new INVOKEVIRTUAL(get)); il.append(new INVOKESTATIC(fn3arg));
/** * Compiles the default handling for DOM elements: traverse all children */ private InstructionList compileDefaultRecursion(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = new InstructionList(); final String applyTemplatesSig = classGen.getApplyTemplatesSig(); final int git = cpg.addInterfaceMethodref(DOM_INTF, GET_CHILDREN, GET_CHILDREN_SIG); final int applyTemplates = cpg.addMethodref(getClassName(), functionName(), applyTemplatesSig); il.append(classGen.loadTranslet()); il.append(methodGen.loadDOM()); il.append(methodGen.loadDOM()); il.append(new ILOAD(_currentIndex)); il.append(new INVOKEINTERFACE(git, 2)); il.append(methodGen.loadHandler()); il.append(new INVOKEVIRTUAL(applyTemplates)); il.append(new GOTO_W(next)); return il; }
for (int i = 0; i < length; i++) { _components[i].translate(classGen, methodGen); il.append(new INVOKEVIRTUAL(iter));
_select.translate(classGen, methodGen); il.append(methodGen.loadHandler()); il.append(new INVOKEVIRTUAL(characters)); } else { final int characters = cpg.addInterfaceMethodref(DOM_INTF,