scale.backend
Class LabelDisplacement

java.lang.Object
  |
  +--scale.backend.Displacement
        |
        +--scale.backend.LabelDisplacement

public class LabelDisplacement
extends Displacement

This class represents a displacement field in an instruction that represents a label.

$Id: LabelDisplacement.java,v 1.5 2002/01/03 21:41:31 burrill Exp $

Copyright 2002 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.


Constructor Summary
LabelDisplacement(int label)
          Obtain a Displacement for the specified label.
 
Method Summary
 java.lang.String assembler(Assembler asm)
          Generate a String representation that can be used by the assembly code generater.
protected  void finalize()
          Keep the count of instances up-to-date.
 int getDisplacement()
          Return the displacement.
 int getLabelIndex()
          Return the label index.
 boolean isNumeric()
          Return true if the displacement is zero.
 boolean isZero()
          Return true if the displacement is zero.
static int number()
          Return the current number of instances of this class.
 OffsetDisplacement offset(int offset)
          Obtain a Displacement with an offset from this Displacement.
 java.lang.String toString()
           
 Displacement unique()
          Return a unique displacement.
 
Methods inherited from class scale.backend.Displacement
adjust, remap
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelDisplacement

public LabelDisplacement(int label)
Obtain a Displacement for the specified label.
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Keep the count of instances up-to-date.
Overrides:
finalize in class Displacement
Throws:
java.lang.Throwable - [needs description]

number

public static int number()
Return the current number of instances of this class.

unique

public Displacement unique()
Return a unique displacement.
Overrides:
unique in class Displacement
See Also:
SymbolDisplacement

offset

public OffsetDisplacement offset(int offset)
Obtain a Displacement with an offset from this Displacement.
Overrides:
offset in class Displacement

isZero

public boolean isZero()
Return true if the displacement is zero.
Overrides:
isZero in class Displacement

isNumeric

public boolean isNumeric()
Return true if the displacement is zero.
Overrides:
isNumeric in class Displacement

getDisplacement

public int getDisplacement()
Return the displacement.
Overrides:
getDisplacement in class Displacement

getLabelIndex

public int getLabelIndex()
Return the label index.

assembler

public java.lang.String assembler(Assembler asm)
Generate a String representation that can be used by the assembly code generater.
Overrides:
assembler in class Displacement

toString

public java.lang.String toString()
Overrides:
toString in class Displacement