|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ksu.cis.projects.bogor.ast.Node
edu.ksu.cis.projects.bogor.ast.InitialValue
public final class InitialValue
An initial value of a local or global variable, along with an optional type coercion to make it compatible with the variable declaration.
| Field Summary | |
|---|---|
protected ASTType |
coercedType
Holds the optional coerced type. |
protected IInitialValueParent |
parent
Holds parent of this value |
protected Exp |
value
The constant or literal expression. |
| Fields inherited from class edu.ksu.cis.projects.bogor.ast.Node |
|---|
ILLEGAL_LOCAL_ID_CHAR |
| Constructor Summary | |
|---|---|
InitialValue(Exp value)
Node for initial value of a variable, left as its natural type. |
|
InitialValue(Exp value,
ASTType coercedType)
Node for initial value of a variable, casted to a particular type. |
|
| Method Summary | |
|---|---|
InitialValue |
clone()
Clones this object (deep clone); including location info. |
ASTType |
getOptionalCoercedType()
Gets the type to which this value is cast. |
IInitialValueParent |
getParent()
Gets the parent of this node. |
Exp |
getValue()
Gets the initial value. |
void |
setCoercedType(ASTType newType)
Sets the type to which the initial value is cast. |
void |
setParent(IInitialValueParent newParent)
Make newParent the parent of this node. |
void |
setValue(Exp newValue)
Sets the initial value. |
String |
toString()
|
void |
visit(ASTVisitor visitor)
|
| Methods inherited from class edu.ksu.cis.projects.bogor.ast.Node |
|---|
dispose, getLocationInfo, getProperty, putProperty, setLocationInfo |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Exp value
protected ASTType coercedType
protected IInitialValueParent parent
| Constructor Detail |
|---|
public InitialValue(Exp value)
value - The value initially assigned to the global or local which
owns this node. Must be non-null.
public InitialValue(Exp value,
ASTType coercedType)
value - The value initially assigned to the global or local which
owns this node. Must be non-null.coercedType - The type to which this initial value is casted. Must be
non-null.| Method Detail |
|---|
public void setValue(Exp newValue)
newValue.
newValue - The new value. Must be non-null.public Exp getValue()
public void setCoercedType(ASTType newType)
newType.
newType - The new casted type. Must be non-null.public ASTType getOptionalCoercedType()
null if none is
specified.public void setParent(IInitialValueParent newParent)
newParent the parent of this node.
newParent - The new syntax tree node which owns this InitialValue.
Must be non-null.public IInitialValueParent getParent()
public InitialValue clone()
clone in class Nodepublic void visit(ASTVisitor visitor)
visit in class Nodepublic String toString()
toString in class Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||