Class Variable
java.lang.Object
|
+--Ident
|
+--Variable
- public class Variable
- extends Ident
This class represents a variable indentifier.
- Author:
- P. URSO
- See Also:
Type
Method Summary |
Type |
getType()
Returns the type of the variable. |
String |
toString()
Returns a string representation of this variable. |
Variable
public Variable(String name,
Type type)
- Constructor of the variable.
- Parameters:
name
- name of the variable.type
- type of the variable.
Variable
public Variable(Type type)
- Construct a new variable from a specified type.
The name of the variable will be the first letter of name of the type
followed by an uniq number.
- Parameters:
type
- the type of the variable.
getType
public Type getType()
- Returns the type of the variable.
- Returns:
- the type of the variable.
toString
public String toString()
- Returns a string representation of this variable.
- Overrides:
toString
in class Ident
- Returns:
- the name of variable and its type.