scale.backend
Class LabelDisplacement

java.lang.Object
  extended by scale.backend.Displacement
      extended by 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.19 2007-09-19 20:55:34 burrill Exp $

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


Constructor Summary
LabelDisplacement(Label 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.
 boolean equivalent(java.lang.Object o)
          Return true if the displacements are equivalent.
 Label getLabel()
          Return the label associated with this displacement.
 java.lang.String toString()
           
 Displacement unique()
          Return a unique displacement.
 
Methods inherited from class scale.backend.Displacement
adjust, created, getBase, getDisplacement, isNumeric, isStack, isSymbol, isZero, offset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelDisplacement

public LabelDisplacement(Label label)
Obtain a Displacement for the specified label.

Method Detail

unique

public Displacement unique()
Return a unique displacement. Each label reference has a different offset because they are relative to the place of the reference.

Specified by:
unique in class Displacement
See Also:
SymbolDisplacement

getLabel

public Label getLabel()
Return the label associated with this displacement.


assembler

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

Specified by:
assembler in class Displacement

toString

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

equivalent

public boolean equivalent(java.lang.Object o)
Return true if the displacements are equivalent.

Overrides:
equivalent in class Displacement