Examples of INVOKEINTERFACE


Examples of org.apache.bcel.generic.INVOKEINTERFACE

  // Append first code in applyTemplates() - get type of current node
  final int getType = cpg.addInterfaceMethodref(DOM_INTF,
                  "getType", "(I)I");
  body.append(methodGen.loadDOM());
  body.append(new ILOAD(_currentIndex));
  body.append(new INVOKEINTERFACE(getType, 2));

  // Append switch() statement - main dispatch loop in applyTemplates()
  InstructionHandle disp = body.append(new SWITCH(types, targets, ihLoop));

  // Append all the "case:" statements
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

  // Append first code in applyTemplates() - get type of current node
  final int getType = cpg.addInterfaceMethodref(DOM_INTF,
                  "getType", "(I)I");
  body.append(methodGen.loadDOM());
  body.append(new ILOAD(_currentIndex));
  body.append(new INVOKEINTERFACE(getType, 2));

  // Append switch() statement - main dispatch loop in applyTemplates()
  InstructionHandle disp = body.append(new SWITCH(types,targets,ihLoop));

  // Append all the "case:" statements
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

                 "getAxisIterator",
                 "(I)"+
                 NODE_ITERATOR_SIG);
      il.append(methodGen.loadDOM());
      il.append(new PUSH(cpg, Axis.CHILD));
      il.append(new INVOKEINTERFACE(children, 2));
  }
  else {
      nodeSet.translate(classGen, methodGen);
  }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

  final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
              "getIterator",
              "()"+NODE_ITERATOR_SIG);
  il.append(toplevel.loadDOM());
  il.append(new INVOKEINTERFACE(gitr, 1));
        il.append(toplevel.nextNode());
  current.setStart(il.append(new ISTORE(current.getIndex())));

    // Create a new list containing variables/params + keys
    Vector varDepElements = new Vector(_globals);       
    Enumeration elements = elements();
    while (elements.hasMoreElements()) {
        final Object element = elements.nextElement();
        if (element instanceof Key) {
            varDepElements.add(element);
        }
    }
           
    // Determine a partial order for the variables/params and keys
    varDepElements = resolveDependencies(varDepElements);
   
    // Translate vars/params and keys in the right order
    final int count = varDepElements.size();
    for (int i = 0; i < count; i++) {
        final TopLevelElement tle = (TopLevelElement) varDepElements.elementAt(i);           
        tle.translate(classGen, toplevel);           
        if (tle instanceof Key) {
            final Key key = (Key) tle;
            _keys.put(key.getName(), key);
        }
    }

    // Compile code for other top-level elements
    Vector whitespaceRules = new Vector();
    elements = elements();
  while (elements.hasMoreElements()) {
      final Object element = elements.nextElement();
      // xsl:decimal-format
      if (element instanceof DecimalFormatting) {
    ((DecimalFormatting)element).translate(classGen,toplevel);
      }
      // xsl:strip/preserve-space
      else if (element instanceof Whitespace) {
    whitespaceRules.addAll(((Whitespace)element).getRules());
      }
  }

  // Translate all whitespace strip/preserve rules
  if (whitespaceRules.size() > 0) {
      Whitespace.translateRules(whitespaceRules,classGen);
  }

  if (classGen.containsMethod(STRIP_SPACE, STRIP_SPACE_PARAMS) != null) {
      il.append(toplevel.loadDOM());
      il.append(classGen.loadTranslet());
      il.append(new INVOKEINTERFACE(setFilter, 2));
  }

  il.append(RETURN);

  // Compute max locals + stack and add method to class
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

  // continue with globals initialization
  final int gitr = cpg.addInterfaceMethodref(DOM_INTF,
              "getIterator",
              "()"+NODE_ITERATOR_SIG);
  il.append(transf.loadDOM());
  il.append(new INVOKEINTERFACE(gitr, 1));
        il.append(transf.nextNode());
  current.setStart(il.append(new ISTORE(current.getIndex())));

  // Transfer the output settings to the output post-processor
  il.append(classGen.loadTranslet());
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

  parentNode.setEnd(il.append(new ILOAD(parentNode.getIndex())));

  // Now get the node value and push it on the parameter stack
  il.append(methodGen.loadDOM());
  il.append(methodGen.loadCurrentNode());
  il.append(new INVOKEINTERFACE(getNodeValue, 2));   

  // Finally do the call to add an entry in the index for this key.
  il.append(new INVOKEVIRTUAL(buildKeyIndex));
 
  il.append(classGen.loadTranslet());
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

  il.append(methodGen.loadIterator());

  // Get an iterator for all nodes in the DOM
  il.append(methodGen.loadDOM())
  il.append(new PUSH(cpg,Axis.DESCENDANT));
  il.append(new INVOKEINTERFACE(git, 2));

  // Reset the iterator to start with the root node
  il.append(methodGen.loadCurrentNode());
  il.append(methodGen.setStartNode());
  il.append(methodGen.storeIterator());
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

 
  final int startElement =
      cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
              "startElement",
              START_ELEMENT_SIG);
  _startElement = new INVOKEINTERFACE(startElement, 2);
 
  final int endElement =
      cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
              "endElement",
              END_ELEMENT_SIG);
  _endElement = new INVOKEINTERFACE(endElement, 2);

  final int attribute =
      cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
              "addAttribute",
              "("
              + STRING_SIG
              + STRING_SIG
              + ")V");
  _attribute = new INVOKEINTERFACE(attribute, 3);

  final int uniqueAttribute =
      cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
              "addUniqueAttribute",
              "("
              + STRING_SIG
              + STRING_SIG
              + "I)V");
  _uniqueAttribute = new INVOKEINTERFACE(uniqueAttribute, 4);

  final int namespace =
      cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
              "namespaceAfterStartElement",
              "("
              + STRING_SIG
              + STRING_SIG
              + ")V");
  _namespace = new INVOKEINTERFACE(namespace, 3);
 
  int index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
                "startDocument",
                "()V");
  _startDocument = new INVOKEINTERFACE(index, 1);
 
  index = cpg.addInterfaceMethodref(TRANSLET_OUTPUT_INTERFACE,
            "endDocument",
            "()V");
  _endDocument = new INVOKEINTERFACE(index, 1);
 
 
  index = cpg.addInterfaceMethodref(NODE_ITERATOR,
            SET_START_NODE,
            SET_START_NODE_SIG);
  _setStartNode = new INVOKEINTERFACE(index, 2);

  index = cpg.addInterfaceMethodref(NODE_ITERATOR,
            "reset", "()"+NODE_ITERATOR_SIG);
  _reset = new INVOKEINTERFACE(index, 1);
 
  index = cpg.addInterfaceMethodref(NODE_ITERATOR, NEXT, NEXT_SIG);
  _nextNode = new INVOKEINTERFACE(index, 1);
 
  _slotAllocator = new SlotAllocator();
  _slotAllocator.initialize(getLocalVariableRegistry().getLocals(false));
  _allocatorInit = true;
    }
View Full Code Here

Examples of org.apache.bcel.generic.INVOKEINTERFACE

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

Examples of org.apache.bcel.generic.INVOKEINTERFACE

  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;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.