Tabnine Logo
PUSH
Code IndexAdd Tabnine to your IDE (free)

How to use
PUSH
in
org.apache.bcel.generic

Best Java code snippets using org.apache.bcel.generic.PUSH (Showing top 20 results out of 315)

origin: xalan/xalan

  public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, _value));
  }
}
origin: xalan/xalan

  /**
   * Translate this attribute value into JVM bytecodes that pushes the
   * attribute value onto the JVM's stack.
   * @param classGen BCEL Java class generator
   * @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));
  }
}
origin: xalan/xalan

public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
ConstantPoolGen cpg = classGen.getConstantPool();
InstructionList il = methodGen.getInstructionList();
il.append(new PUSH(cpg, _value));
}
origin: xalan/xalan

  public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  ConstantPoolGen cpg = classGen.getConstantPool();
  InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, _value));
  }
}
origin: xalan/xalan

/**
 * Translates a void into a string by pushing the empty string ''.
 *
 * @see    org.apache.xalan.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(), ""));
}
origin: xalan/xalan

  public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  ConstantPoolGen cpg = classGen.getConstantPool();
  InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, _value));
  }
}
origin: xalan/xalan

  /**
   * Calls to 'element-available' are resolved at compile time since 
   * the namespaces declared in the stylsheet are not available at run
   * 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));
  }
}
origin: xalan/xalan

/**
 * Calls to 'function-available' are resolved at compile time since 
 * the namespaces declared in the stylsheet are not available at run
 * time. Consequently, arguments to this function must be literals.
 */
public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
final ConstantPoolGen cpg = classGen.getConstantPool();
methodGen.getInstructionList().append(new PUSH(cpg, getResult()));
}
origin: xalan/xalan

  /**
   * Translate code to call the BasisLibrary.unallowed_extensionF(String)
   * method.
   */
  private void translateUnallowedExtension(ConstantPoolGen cpg,
                       InstructionList il) {
  int index = cpg.addMethodref(BASIS_LIBRARY_CLASS,
           "unallowed_extension_functionF",
           "(Ljava/lang/String;)V");
  il.append(new PUSH(cpg, _fname.toString()));
  il.append(new INVOKESTATIC(index));   
  }      
}
origin: xalan/xalan

  /**
   * Translate the fallback element (if any).
   */
  public void translate(ClassGenerator classGen, MethodGenerator methodGen) {
  if (_fallbacks != null) {
    int count = _fallbacks.size();
    for (int i = 0; i < count; i++) {
      Fallback fallback = (Fallback)_fallbacks.elementAt(i);
      fallback.translate(classGen, methodGen);
    }
  }
  // We only go into the else block in forward-compatibility mode, when
  // the unsupported element has no fallback.
  else {		
    // If the unsupported element does not have any fallback child, then
    // at runtime, a runtime error should be raised when the unsupported
    // element is instantiated. Otherwise, no error is thrown.
    ConstantPoolGen cpg = classGen.getConstantPool();
    InstructionList il = methodGen.getInstructionList();
    
    final int unsupportedElem = cpg.addMethodref(BASIS_LIBRARY_CLASS, "unsupported_ElementF",
                             "(" + STRING_SIG + "Z)V");	 
    il.append(new PUSH(cpg, getQName().toString()));
    il.append(new PUSH(cpg, _isExtension));
    il.append(new INVOKESTATIC(unsupportedElem));		
  }
  }
}
origin: xalan/xalan

  /**
   * Generates code that loads the array that will contain the character
   * data represented by this Text node, followed by the offset of the
   * data from the start of the array, and then the length of the data.
   *
   * The pre-condition to calling this method is that
   * canLoadAsArrayOffsetLength() returns true.
   * @see #canLoadArrayOffsetLength()
   */
  public void loadAsArrayOffsetLength(ClassGenerator classGen,
                    MethodGenerator methodGen) {
    final ConstantPoolGen cpg = classGen.getConstantPool();
    final InstructionList il = methodGen.getInstructionList();
    final XSLTC xsltc = classGen.getParser().getXSLTC();

    // The XSLTC object keeps track of character data
    // that is to be stored in char arrays.
    final int offset = xsltc.addCharacterData(_text);
    final int length = _text.length();
    String charDataFieldName =
      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()));
  }
}
origin: xalan/xalan

/**
 * Expects a boolean on the stack and pushes a string. If the value on the
 * stack is zero, then the string 'false' is pushed. Otherwise, the string
 * 'true' is pushed.
 *
 * @see    org.apache.xalan.xsltc.compiler.util.Type#translateTo
 */
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));
}
origin: xalan/xalan

/**
 * Translates an external (primitive) Java type into a string. 
 *
 * @see    org.apache.xalan.xsltc.compiler.util.Type#translateFrom
 */
public void translateFrom(ClassGenerator classGen, 
MethodGenerator methodGen, Class clazz) 
{
final ConstantPoolGen cpg = classGen.getConstantPool();
final InstructionList il = methodGen.getInstructionList();
if (clazz.getName().equals("java.lang.String")) {
  // same internal representation, convert null to ""
  il.append(DUP);
  final BranchHandle ifNonNull = il.append(new IFNONNULL(null));
  il.append(POP);
  il.append(new PUSH(cpg, ""));
  ifNonNull.setTarget(il.append(NOP));
}
else {
  ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
        toString(), clazz.getName());
  classGen.getParser().reportError(Constants.FATAL, err);
}
}
origin: xalan/xalan

il.append(new PUSH(cpg, _name));
    il.append(new PUSH(cpg,prefix));
    il.append(new PUSH(cpg,uri));
    il.append(methodGen.namespace());
  il.append(new PUSH(cpg, Constants.EMPTYSTRING));
  il.append(new PUSH(cpg, Constants.EMPTYSTRING));
  il.append(methodGen.namespace());
origin: xalan/xalan

/**
 * Compile the value of the parameter, which is either in an expression in
 * a 'select' attribute, or in the with-param element's body
 */
public void translateValue(ClassGenerator classGen,
        MethodGenerator methodGen) {
// Compile expression is 'select' attribute if present
if (_select != null) {
  _select.translate(classGen, methodGen);
  _select.startIterator(classGen, methodGen);
}
// If not, compile result tree from parameter body if present.
else if (hasContents()) {
  compileResultTree(classGen, methodGen);
}
// If neither are present then store empty string in parameter slot
else {
  final ConstantPoolGen cpg = classGen.getConstantPool();
  final InstructionList il = methodGen.getInstructionList();
  il.append(new PUSH(cpg, Constants.EMPTYSTRING));
}
}
origin: xalan/xalan

  field = cpg.addFieldref(TRANSLET_CLASS, "_version", STRING_SIG);
  il.append(DUP);
  il.append(new PUSH(cpg, _version));
  il.append(new PUTFIELD(field));
  field = cpg.addFieldref(TRANSLET_CLASS, "_method", STRING_SIG);
  il.append(DUP);
  il.append(new PUSH(cpg, _method));
  il.append(new PUTFIELD(field));
  field = cpg.addFieldref(TRANSLET_CLASS, "_encoding", STRING_SIG);
  il.append(DUP);
  il.append(new PUSH(cpg, _encoding));
  il.append(new PUTFIELD(field));
  field = cpg.addFieldref(TRANSLET_CLASS, "_omitHeader", "Z");
  il.append(DUP);
  il.append(new PUSH(cpg, _omitHeader));
  il.append(new PUTFIELD(field));
  field = cpg.addFieldref(TRANSLET_CLASS, "_standalone", STRING_SIG);
  il.append(DUP);
  il.append(new PUSH(cpg, _standalone));
  il.append(new PUTFIELD(field));
il.append(new PUSH(cpg, _doctypeSystem));
il.append(new PUTFIELD(field));
field = cpg.addFieldref(TRANSLET_CLASS,"_doctypePublic",STRING_SIG);
il.append(DUP);
origin: xalan/xalan

il.append(new PUSH(cpg, name)); // TODO: namespace ?
il.append(new PUSH(cpg, false));
origin: xalan/xalan

il.append(new PUSH(cpg, _name.toString()));
          "setNaN", "(Ljava/lang/String;)V");
  il.append(DUP);
  il.append(new PUSH(cpg, "NaN"));
  il.append(new INVOKEVIRTUAL(nan));
          "(Ljava/lang/String;)V");
  il.append(DUP);
  il.append(new PUSH(cpg, "Infinity"));
  il.append(new INVOKEVIRTUAL(inf));
         "setNaN", "(Ljava/lang/String;)V");
    il.append(DUP);
  il.append(new PUSH(cpg, value));
  il.append(new INVOKEVIRTUAL(method));
  valid = false;
         "(Ljava/lang/String;)V");
    il.append(DUP);
  il.append(new PUSH(cpg, value));
  il.append(new INVOKEVIRTUAL(method));
  valid = false;
  il.append(new PUSH(cpg, value.charAt(0)));
  il.append(new INVOKEVIRTUAL(method));
origin: xalan/xalan

il.append(new PUSH(cpg, EMPTYSTRING));
il.append(new PUSH(cpg, _resolvedQName.toString()));
origin: xalan/xalan

il.append(new PUSH(cpg, size));
il.append(new ANEWARRAY(cpg.addClass(STRING)));		
  int namesArrayRef = cpg.addFieldref(_className,
    staticConst.markChunkStart();
  il.append(new GETSTATIC(namesArrayRef));
  il.append(new PUSH(cpg, i));
  il.append(new PUSH(cpg, name));
  il.append(AASTORE);
    staticConst.markChunkEnd();
il.append(new PUSH(cpg, size));
il.append(new ANEWARRAY(cpg.addClass(STRING)));		
  int urisArrayRef = cpg.addFieldref(_className,
    staticConst.markChunkStart();
  il.append(new GETSTATIC(urisArrayRef));
  il.append(new PUSH(cpg, i));
  il.append(new PUSH(cpg, uri));
  il.append(AASTORE);
    staticConst.markChunkEnd();
il.append(new PUSH(cpg, size));
il.append(new NEWARRAY(BasicType.INT));		
  int typesArrayRef = cpg.addFieldref(_className,
    staticConst.markChunkStart();
  il.append(new GETSTATIC(typesArrayRef));
  il.append(new PUSH(cpg, i));
org.apache.bcel.genericPUSH

Javadoc

Wrapper class for push operations, which are implemented either as BIPUSH, LDC or xCONST_n instructions.

Most used methods

  • <init>
  • getInstruction

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • getApplicationContext (Context)
  • getSupportFragmentManager (FragmentActivity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JList (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now