dk.brics.xact.analysis.flowgraph
Class Variable

java.lang.Object
  extended by dk.brics.xact.analysis.flowgraph.Variable

public class Variable
extends Object

A program variable, used in a flow graph.


Constructor Summary
Variable(int id, boolean global, boolean array)
          Constructs a new variable object with no type annotation.
Variable(int id, boolean global, boolean array, String annotation, SchemaType schema)
          Constructs a new variable object.
 
Method Summary
 int getID()
          Returns the variable ID number.
 SchemaType getSchema()
          Returns the schema for the type annotation of this variable, or null if absent.
 String getTypeAnnotation()
          Returns the type annotation for this variable, or null if absent.
 boolean hasTypeAnnotation()
          Checks whether this variable has a type annotation.
 boolean isArray()
          Returns true if this is an array variable.
 boolean isGlobal()
          Returns true if this is a field (or global dummy) variable.
 void setGlobal()
          Marks this variable as being global.
 String toString()
          Returns a name for the variable useful for printing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(int id,
                boolean global,
                boolean array)
Constructs a new variable object with no type annotation.


Variable

public Variable(int id,
                boolean global,
                boolean array,
                String annotation,
                SchemaType schema)
Constructs a new variable object.

Method Detail

getID

public int getID()
Returns the variable ID number.


getSchema

public SchemaType getSchema()
Returns the schema for the type annotation of this variable, or null if absent.


getTypeAnnotation

public String getTypeAnnotation()
Returns the type annotation for this variable, or null if absent.


hasTypeAnnotation

public boolean hasTypeAnnotation()
Checks whether this variable has a type annotation.


isArray

public boolean isArray()
Returns true if this is an array variable.


isGlobal

public boolean isGlobal()
Returns true if this is a field (or global dummy) variable.


setGlobal

public void setGlobal()
Marks this variable as being global.


toString

public String toString()
Returns a name for the variable useful for printing. 'g' means "global", 'l' means "local", 'a' means "array".

Overrides:
toString in class Object


Copyright © 2005-2008 Aarhus University.