286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2001-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/A/*
286N/A * $Id: MethodGenerator.java,v 1.10 2010-11-01 04:34:19 joehw Exp $
286N/A */
286N/Apackage com.sun.org.apache.xalan.internal.xsltc.compiler.util;
286N/Aimport java.io.DataOutputStream;
286N/Aimport java.io.IOException;
286N/A
286N/Aimport com.sun.org.apache.bcel.internal.Constants;
286N/Aimport com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
286N/Aimport com.sun.org.apache.bcel.internal.generic.Instruction;
286N/Aimport com.sun.org.apache.bcel.internal.generic.Visitor;
286N/A
286N/A/**
286N/A * A special abstract dummy subclass of
286N/A * {@link org.apache.bcel.generic.Instruction} used to mark locations of
286N/A * interest in an {@link com.sun.org.apache.bcel.internal.generic.InstructionList}. It and
286N/A * its subclasses are only used as placeholders, and do not contribute to the
286N/A * actual byte code instruction stream.
286N/A */
286N/Aabstract class MarkerInstruction extends Instruction {
286N/A /**
286N/A * Zero-argument constructor. Sets the opcode to an invalid value and
286N/A * sets the length to zero, as it will not be written as part of the
286N/A * generated byte code.
286N/A */
286N/A public MarkerInstruction() {
286N/A super(Constants.UNDEFINED, (short) 0);
286N/A }
286N/A
286N/A /**
286N/A * {@link com.sun.org.apache.bcel.internal.generic.Visitor}s will know nothing about this
286N/A * kind of {@link org.apche.bcel.generic.Instruction}, so this method does
286N/A * nothing.
286N/A */
286N/A public void accept(Visitor v) {
286N/A }
286N/A
286N/A /**
286N/A * The number of JVM stack entries consumed by the instruction.
286N/A * This instruction is just a place holder, so it does not consume any
286N/A * stack entries.
286N/A * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the
286N/A * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen}
286N/A * @return <code>0</code> always
286N/A */
286N/A final public int consumeStack(ConstantPoolGen cpg) {
286N/A return 0;
286N/A }
286N/A /**
286N/A * The number of JVM stack entries produced by the instruction.
286N/A * This instruction is just a place holder, so it does not produce any
286N/A * stack entries.
286N/A * @param cpg The {@link com.sun.org.apache.bcel.internal.generic.ConstantPoolGen} for the
286N/A * current {@link com.sun.org.apache.bcel.internal.generic.ClassGen}
286N/A * @return <code>0</code> always
286N/A */
286N/A final public int produceStack(ConstantPoolGen cpg) {
286N/A return 0;
286N/A }
286N/A
286N/A /**
286N/A * Produce a copy of the instruction. By default a
286N/A * {@link MarkerInstruction} has no parameters, so the base implementation
286N/A * of {@link #copy()} returns the instruction itself.
286N/A * @return The instruction itself.
286N/A */
286N/A public Instruction copy() {
286N/A return this;
286N/A }
286N/A /**
286N/A * Dump instruction as byte code to stream out. A {@link MarkerInstruction}
286N/A * has no effect on the generated byte code so it is never emitted to the
286N/A * output stream.
286N/A * @param out Output stream
286N/A */
286N/A final public void dump(DataOutputStream out) throws IOException {
286N/A }
286N/A}