/** * This method compiles code for the select expression for this * xsl:sort element. The method is called from the static code-generating * methods in this class. */ public void translateSelect(ClassGenerator classGen, MethodGenerator methodGen) { _select.translate(classGen,methodGen); }
/** * Translate a filter expression by pushing the appropriate iterator * onto the stack. */ public void translate(ClassGenerator classGen, MethodGenerator methodGen) { if (_predicates.size() > 0) { translatePredicates(classGen, methodGen); } else { _primary.translate(classGen, methodGen); } }
/** * Redefined by expressions of type boolean that use flow lists. */ public void translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen) { translate(classGen, methodGen); if (_type instanceof BooleanType) { desynthesize(classGen, methodGen); } }
/** * 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"))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { InstructionList il = methodGen.getInstructionList(); _left.translate(classGen, methodGen); il.append(_type.NEG()); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList il = methodGen.getInstructionList(); argument().translate(classGen, methodGen); il.append(ICONST_1); il.append(IXOR); }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final Type ltype = _left.getType(); _left.translate(classGen, methodGen); if (_type.identicalTo(ltype) == false) { _left.startIterator(classGen, methodGen); ltype.translateTo(classGen, methodGen, _type); } } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { _arg.translate(classGen, methodGen); final Type targ = _arg.getType(); if (!targ.identicalTo(Type.Boolean)) { _arg.startIterator(classGen, methodGen); targ.translateTo(classGen, methodGen, Type.Boolean); } } }
/** * Translate this node into a fresh instruction list. * The original instruction list is saved and restored. */ public final InstructionList compile(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList result, save = methodGen.getInstructionList(); methodGen.setInstructionList(result = new InstructionList()); translate(classGen, methodGen); methodGen.setInstructionList(save); return result; }
/** * 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(); _right.translate(classGen, methodGen); il.append(new CHECKCAST(cpg.addClass(_className))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { argument().translate(classGen, methodGen); methodGen.getInstructionList() .append(new INVOKESTATIC(classGen.getConstantPool() .addMethodref(MATH_CLASS, "floor", "(D)D"))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); argument(0).translate(classGen, methodGen); il.append(new INVOKESTATIC(cpg.addMethodref(MATH_CLASS, "ceil", "(D)D"))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); // Get two copies of the argument on the stack argument().translate(classGen, methodGen); il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS, "roundF", "(D)D"))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); // Push the this pointer on the stack... il.append(methodGen.loadDOM()); // ...then the entity name... _entity.translate(classGen, methodGen); // ...to get the URI from the DOM object. il.append(new INVOKEINTERFACE( cpg.addInterfaceMethodref(DOM_INTF, GET_UNPARSED_ENTITY_URI, GET_UNPARSED_ENTITY_URI_SIG), 2)); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList il = methodGen.getInstructionList(); if (argumentCount() == 0) { il.append(methodGen.loadContextNode()); } else { // one argument argument().translate(classGen, methodGen); } final ConstantPoolGen cpg = classGen.getConstantPool(); il.append(new INVOKESTATIC(cpg.addMethodref(BASIS_LIBRARY_CLASS, "generate_idF", // reuse signature GET_NODE_NAME_SIG))); } }
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"))); } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList il = methodGen.getInstructionList(); Type targ; if (argumentCount() == 0) { il.append(methodGen.loadContextNode()); targ = Type.Node; } else { final Expression arg = argument(); arg.translate(classGen, methodGen); arg.startIterator(classGen, methodGen); targ = arg.getType(); } if (!targ.identicalTo(Type.String)) { targ.translateTo(classGen, methodGen, Type.String); } } }
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final InstructionList il = methodGen.getInstructionList(); Type targ; if (argumentCount() == 0) { il.append(methodGen.loadContextNode()); targ = Type.Node; } else { final Expression arg = argument(); arg.translate(classGen, methodGen); arg.startIterator(classGen, methodGen); targ = arg.getType(); } if (!targ.identicalTo(Type.Real)) { targ.translateTo(classGen, methodGen, Type.Real); } } }
/** * This method is called when the constructor is compiled in * Stylesheet.compileConstructor() and not as the syntax tree is traversed. */ public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final int tst = cpg.addMethodref(BASIS_LIBRARY_CLASS, "testLanguage", "("+STRING_SIG+DOM_INTF_SIG+"I)Z"); _lang.translate(classGen,methodGen); il.append(methodGen.loadDOM()); if (classGen instanceof FilterGenerator) il.append(new ILOAD(1)); else il.append(methodGen.loadContextNode()); il.append(new INVOKESTATIC(tst)); } }