SFE.Compiler
Class Variable

java.lang.Object
  extended by SFE.Compiler.Variable

public class Variable
extends java.lang.Object

A type representing a variable in the program. A variable is composed of its type and name.


Constructor Summary
Variable(java.lang.String name, Type type)
          Constructs a new variable object of a given name and type.
 
Method Summary
 java.lang.String getName()
          Returns a string representing the name of this variable.
 Type getType()
          Returns the Type of this varable.
 int size()
          Returns an int representing the size of this variable object in bits.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(java.lang.String name,
                Type type)
Constructs a new variable object of a given name and type.

Parameters:
name - the new variale name
type - the variable's type
Method Detail

getType

public Type getType()
Returns the Type of this varable.

Returns:
the Type of this varable.

getName

public java.lang.String getName()
Returns a string representing the name of this variable.

Returns:
a string representing the name of this variable.

size

public int size()
Returns an int representing the size of this variable object in bits.

Returns:
an int representing the size of this variable object in bits.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.