/** * Translates a reference into an object of internal type <code>type</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadDOM()); int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "numberF", "(" + OBJECT_SIG + DOM_INTF_SIG + ")D"); il.append(new INVOKESTATIC(index)); }
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 static void compileGetChildren(ClassGenerator classGen, MethodGenerator methodGen, int node) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final int git = cpg.addInterfaceMethodref(DOM_INTF, GET_CHILDREN, GET_CHILDREN_SIG); il.append(methodGen.loadDOM()); il.append(new ILOAD(node)); il.append(new INVOKEINTERFACE(git, 2)); }
il.append(methodGen.loadDOM());
final String className = clazz.getName(); il.append(methodGen.loadDOM()); il.append(SWAP);
/** * 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)); } }
/** * 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; }
/** * Compiles the default action for DOM text nodes and attribute nodes: * output the node's text value */ private InstructionList compileDefaultText(ClassGenerator classGen, MethodGenerator methodGen, InstructionHandle next) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = new InstructionList(); final int chars = cpg.addInterfaceMethodref(DOM_INTF, CHARACTERS, CHARACTERS_SIG); il.append(methodGen.loadDOM()); il.append(new ILOAD(_currentIndex)); il.append(methodGen.loadHandler()); il.append(new INVOKEINTERFACE(chars, 3)); il.append(new GOTO_W(next)); return il; }
String methodName = Util.escape(_name.toString()); il.append(classGen.loadTranslet()); il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler());
/** * Translates reference into object of internal type <code>type</code>. * * @see org.apache.xalan.xsltc.compiler.util.Type#translateTo */ public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, StringType type) { final int current = methodGen.getLocalIndex("current"); ConstantPoolGen cpg = classGen.getConstantPool(); InstructionList il = methodGen.getInstructionList(); // If no current, conversion is a top-level if (current < 0) { il.append(new PUSH(cpg, DTM.ROOT_NODE)); // push root node } else { il.append(new ILOAD(current)); } il.append(methodGen.loadDOM()); final int stringF = cpg.addMethodref(BASIS_LIBRARY_CLASS, "stringF", "(" + OBJECT_SIG + NODE_SIG + DOM_INTF_SIG + ")" + STRING_SIG); il.append(new INVOKESTATIC(stringF)); }
final String methodName = attrs.getMethodName(); il.append(classGen.loadTranslet()); il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler());
il.append(methodGen.loadDOM()); il.append(methodGen.loadIterator()); il.append(methodGen.loadHandler());
final int check = cpg.addInterfaceMethodref(DOM_INTF, "isElement", "(I)Z"); il.append(methodGen.loadDOM()); il.append(SWAP); il.append(new INVOKEINTERFACE(check, 2)); final int check = cpg.addInterfaceMethodref(DOM_INTF, "isAttribute", "(I)Z"); il.append(methodGen.loadDOM()); il.append(SWAP); il.append(new INVOKEINTERFACE(check, 2)); "getExpandedTypeID", "(I)I"); il.append(methodGen.loadDOM()); il.append(SWAP); il.append(new INVOKEINTERFACE(getEType, 2));
final InstructionList il = methodGen.getInstructionList(); il.append(methodGen.loadDOM());
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { if (hasNodeSetArgs() || hasReferenceArgs()) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); // Call compare() from the BasisLibrary _left.translate(classGen, methodGen); _left.startIterator(classGen, methodGen); _right.translate(classGen, methodGen); _right.startIterator(classGen, methodGen); il.append(new PUSH(cpg, _op)); il.append(methodGen.loadDOM()); int index = cpg.addMethodref(BASIS_LIBRARY_CLASS, "compare", "(" + _left.getType().toSignature() + _right.getType().toSignature() + "I" + DOM_INTF_SIG + ")Z"); il.append(new INVOKESTATIC(index)); } else { translateDesynthesized(classGen, methodGen); synthesize(classGen, methodGen); } }
"(I)I"); il.append(new SIPUSH((short)((Step)_left).getNodeType())); il.append(methodGen.loadDOM()); il.append(methodGen.loadContextNode()); il.append(new INVOKEINTERFACE(idx, 2));
"getIterator", "()"+NODE_ITERATOR_SIG); il.append(methodGen.loadDOM()); il.append(new INVOKEINTERFACE(git, 1));
CHARACTERS_SIG); il.append(methodGen.loadDOM()); _select.translate(classGen, methodGen); il.append(methodGen.loadHandler());