Package com.sun.org.apache.bcel.internal.generic

Examples of com.sun.org.apache.bcel.internal.generic.PUSH


        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());
View Full Code Here


     * @see     com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo
     */
    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                            StringType type) {
        final InstructionList il = methodGen.getInstructionList();
        il.append(new PUSH(classGen.getConstantPool(), ""));
    }
View Full Code Here

    public void translateTo(ClassGenerator classGen, MethodGenerator methodGen,
                            StringType type) {
        final ConstantPoolGen cpg = classGen.getConstantPool();
        final InstructionList il = methodGen.getInstructionList();
        final BranchHandle falsec = il.append(new IFEQ(null));
        il.append(new PUSH(cpg, "true"));
        final BranchHandle truec = il.append(new GOTO(null));
        falsec.setTarget(il.append(new PUSH(cpg, "false")));
        truec.setTarget(il.append(NOP));
    }
View Full Code Here

      {
    int iter = cpg.addInterfaceMethodref(DOM_INTF,
                 "getTypedAxisIterator",
                 "(II)"+NODE_ITERATOR_SIG);
    il.append(methodGen.loadDOM());
    il.append(new PUSH(cpg, Axis.ATTRIBUTE));
    il.append(new PUSH(cpg, _nodeType));
    il.append(new INVOKEINTERFACE(iter, 3));
    return;
      }

      SyntaxTreeNode parent = getParent();
      // Special case for '.'
      if (isAbbreviatedDot()) {
    if (_type == Type.Node) {
        // Put context node on stack if using Type.Node
        il.append(methodGen.loadContextNode());
    }
    else {
        if (parent instanceof ParentLocationPath){
      // Wrap the context node in a singleton iterator if not.
      int init = cpg.addMethodref(SINGLETON_ITERATOR,
                "<init>",
                "("+NODE_SIG+")V");
      il.append(new NEW(cpg.addClass(SINGLETON_ITERATOR)));
      il.append(DUP);
      il.append(methodGen.loadContextNode());
      il.append(new INVOKESPECIAL(init));
        } else {
      // DOM.getAxisIterator(int axis);
      int git = cpg.addInterfaceMethodref(DOM_INTF,
            "getAxisIterator",
            "(I)"+NODE_ITERATOR_SIG);
      il.append(methodGen.loadDOM());
      il.append(new PUSH(cpg, _axis));
      il.append(new INVOKEINTERFACE(git, 2));
        }
    }
    return;
      }

      // Special case for /foo/*/bar
      if ((parent instanceof ParentLocationPath) &&
    (parent.getParent() instanceof ParentLocationPath)) {
    if ((_nodeType == NodeTest.ELEMENT) && (!_hadPredicates)) {
        _nodeType = NodeTest.ANODE;
    }
      }

      // "ELEMENT" or "*" or "@*" or ".." or "@attr" with a parent.
      switch (_nodeType) {
      case NodeTest.ATTRIBUTE:
    _axis = Axis.ATTRIBUTE;
      case NodeTest.ANODE:
    // DOM.getAxisIterator(int axis);
    int git = cpg.addInterfaceMethodref(DOM_INTF,
                "getAxisIterator",
                "(I)"+NODE_ITERATOR_SIG);
    il.append(methodGen.loadDOM());
    il.append(new PUSH(cpg, _axis));
    il.append(new INVOKEINTERFACE(git, 2));
    break;
      default:
    if (star > 1) {
        final String namespace;
        if (_axis == Axis.ATTRIBUTE)
      namespace = name.substring(0,star-2);
        else
      namespace = name.substring(0,star-1);

        final int nsType = xsltc.registerNamespace(namespace);
        final int ns = cpg.addInterfaceMethodref(DOM_INTF,
                "getNamespaceAxisIterator",
                "(II)"+NODE_ITERATOR_SIG);
        il.append(methodGen.loadDOM());
        il.append(new PUSH(cpg, _axis));
        il.append(new PUSH(cpg, nsType));
        il.append(new INVOKEINTERFACE(ns, 3));
        break;
    }
      case NodeTest.ELEMENT:
    // DOM.getTypedAxisIterator(int axis, int type);
    final int ty = cpg.addInterfaceMethodref(DOM_INTF,
            "getTypedAxisIterator",
            "(II)"+NODE_ITERATOR_SIG);
    // Get the typed iterator we're after
    il.append(methodGen.loadDOM());
    il.append(new PUSH(cpg, _axis));
    il.append(new PUSH(cpg, _nodeType));
    il.append(new INVOKEINTERFACE(ty, 3));

    break;
      }
  }
View Full Code Here

      // Turn off character escaping if so is wanted.
      final int esc = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                  "setEscaping", "(Z)Z");
      if (!_escaping) {
    il.append(methodGen.loadHandler());
    il.append(new PUSH(cpg, false));
    il.append(new INVOKEINTERFACE(esc, 2));
      }

            il.append(methodGen.loadHandler());

            // Call characters(String) or characters(char[],int,int), as
            // appropriate.
            if (!canLoadAsArrayOffsetLength()) {
                final int characters = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                                                           "characters",
                                                           "("+STRING_SIG+")V");
                il.append(new PUSH(cpg, _text));
                il.append(new INVOKEINTERFACE(characters, 2));
            } else {
                final int characters = cpg.addInterfaceMethodref(OUTPUT_HANDLER,
                                                                 "characters",
                                                                 "([CII)V");
View Full Code Here

            STATIC_CHAR_DATA_FIELD + (xsltc.getCharacterDataCount()-1);

        il.append(new GETSTATIC(cpg.addFieldref(xsltc.getClassName(),
                                       charDataFieldName,
                                       STATIC_CHAR_DATA_FIELD_SIG)));
        il.append(new PUSH(cpg, offset));
        il.append(new PUSH(cpg, _text.length()));
    }
View Full Code Here

     * @param methodGen BCEL Java method generator
     */
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, _value));
    }
View Full Code Here

     * time. Consequently, arguments to this function must be literals.
     */
    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final boolean result = getResult();
  methodGen.getInstructionList().append(new PUSH(cpg, result));
    }
View Full Code Here

           "(Ljava/lang/String;)"+
           "Ljava/text/DecimalFormat;");
 
  il.append(classGen.loadTranslet());
  if (_name == null) {
      il.append(new PUSH(cpg, EMPTYSTRING));
  }
  else if (_resolvedQName != null) {
      il.append(new PUSH(cpg, _resolvedQName.toString()));
  }
  else {
      _name.translate(classGen, methodGen);
  }
  il.append(new INVOKEVIRTUAL(get));
View Full Code Here

    }

    public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  ConstantPoolGen cpg = classGen.getConstantPool();
  InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, _value));
    }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.bcel.internal.generic.PUSH

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.