/** * Translates object of this type to an object of type <code>type</code>. * Expects an object of the former type and pushes an object of the latter * if not boolean. If type <code>type</code> is boolean then a branchhandle * list (to be appended to the false list) is returned. */ public FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, Type type) { FlowList fl = null; if (type == Type.Boolean) { fl = translateToDesynthesized(classGen, methodGen, (BooleanType)type); } else { translateTo(classGen, methodGen, type); } return fl; }
/** * Expects a node on the stack and pushes a real. * First the node is converted to string, and from string to real. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type) { translateTo(classGen, methodGen, Type.String); Type.String.translateTo(classGen, methodGen, Type.Real); }
/** * Expects a node-set on the stack and pushes a real. * First the node-set is converted to string, and from string to real. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type) { translateTo(classGen, methodGen, Type.String); Type.String.translateTo(classGen, methodGen, Type.Real); }
ltype.translateTo(classGen, methodGen, _type);
/** * Casts a reference into a Node. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, NodeType type) { translateTo(classGen, methodGen, Type.NodeSet); Type.NodeSet.translateTo(classGen, methodGen, type); }
/** * Expects an result tree on the stack and pushes a real. * Translates a result tree into a real by first converting it to string. * * @param classGen A BCEL class generator * @param methodGen A BCEL method generator * @param type An instance of RealType (any) * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type) { translateTo(classGen, methodGen, Type.String); Type.String.translateTo(classGen, methodGen, Type.Real); }
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); } } }
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); } } }
Type.Real.translateTo(classGen, methodGen, Type.Reference);
expType.translateTo(classGen, methodGen, paramTypes[i]); paramTemp[i] = methodGen.addLocalVariable("function_call_tmp"+i, exp.getType().translateTo(classGen, methodGen, paramTypes[i]);
Type.Real.translateTo(classGen, methodGen, Type.Reference); Type.Boolean.translateTo(classGen, methodGen, Type.Reference);
/** * Translates a node-set into a string. The string value of a node-set is * value of its first element. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, StringType type) { final InstructionList il = methodGen.getInstructionList(); getFirstNode(classGen, methodGen); il.append(DUP); final BranchHandle falsec = il.append(new IFLT(null)); Type.Node.translateTo(classGen, methodGen, type); final BranchHandle truec = il.append(new GOTO(null)); falsec.setTarget(il.append(POP)); il.append(new PUSH(classGen.getConstantPool(), "")); truec.setTarget(il.append(NOP)); }
_type.translateTo(classGen, methodGen, Type.NodeSet);
_type.translateTo(classGen, methodGen, Type.NodeSet);
tleft.translateTo(classGen, methodGen, Type.Real); _right.translate(classGen, methodGen); tleft.translateTo(classGen, methodGen, Type.String); _right.translate(classGen, methodGen); tright.translateTo(classGen, methodGen, Type.String); _left.translate(classGen, methodGen); _left.startIterator(classGen, methodGen); Type.NodeSet.translateTo(classGen, methodGen, Type.Boolean); _right.translate(classGen, methodGen); tright.translateTo(classGen, methodGen, Type.String); tright = Type.String;
/** * Expects a node-set on the stack and pushes a real. * First the node-set is converted to string, and from string to real. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type) { translateTo(classGen, methodGen, Type.String); Type.String.translateTo(classGen, methodGen, Type.Real); }
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); } } }