|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Expression
entities.Allocation
The Allocation class represents the information regarding the allocation of a new object obtained by the "new" statement
Field Summary |
Fields inherited from class entities.Expression |
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS |
Constructor Summary | |
Allocation(ScopeManager parentScope)
|
Method Summary | |
void |
computeType(ScopeInfo scopeInfo,
java.lang.String indentation)
This method computes recursively the types on the parameters, size and placement expressions |
void |
fillName(java.lang.StringBuffer fullName,
java.lang.String previousType)
Compute the complete name to be associated to a SimpleVariable or to a Call expression. |
java.lang.String |
getAllocationType()
Give the information about the type |
Parameter |
getFormalParameter(int i)
|
java.util.Vector |
getFormalParameters()
|
Method |
getMethod()
|
java.util.Vector |
getParameters()
|
Expression |
getPlacement()
|
java.util.Vector |
getSize()
|
java.lang.String |
getString()
|
java.lang.String |
getType()
For expressions that have a field corresponding to the type, it returns the type or null |
void |
print(java.lang.String indentation)
Print all information contained in the expression |
void |
setAllocationType(java.lang.String type)
The parameter "type" (of type String) is used to represent the type of the just created object. |
void |
setParameters(java.util.Vector parameters)
The parameter "parameters" is used to represent the actual parameters |
void |
setPlacement(Expression placement)
The parameter "placement" is used to represent the address in memory where to start to allocate the new object |
void |
setSize(java.util.Vector size)
The parameter "size" is used to represent the numbers of objects that have to be created |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Allocation(ScopeManager parentScope)
Method Detail |
public java.lang.String getType()
Expression
getType
in class Expression
Ex: new A () the type is "A".
public java.util.Vector getParameters()
public java.util.Vector getFormalParameters()
public Parameter getFormalParameter(int i)
public Method getMethod()
public Expression getPlacement()
Ex: X* = new (buf)X; --> construct an X at "buf"
In this case it returns the object (of type Expression) corresponding to "buf";
public java.util.Vector getSize()
Ex: int s; Employee *p = new Employee[s];
In this case it returns the Expression object corresponding to "s"
public java.lang.String getString()
getString
in class Expression
public void setAllocationType(java.lang.String type)
Ex: new A () the type is "A".
public void setParameters(java.util.Vector parameters)
Ex: int x =10; A* a = new A(x);
In this case it will contain the expression (of type SimpleVariable) corresponding to the variable "x"
public void setPlacement(Expression placement)
Ex: X* = new (buf)X;
In this case "placement" will contain the expression (of type SimpleVariable) correspondig to the variable "buf".
public void setSize(java.util.Vector size)
Ex: int s; Employee *p = new Employee[s];
In this case "size" will contain the expression (of type SimpleVariable) correspondig to the variable "s"
public void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
computeType
in class Expression
public void print(java.lang.String indentation)
print
in interface ScopeManager
print
in class Expression
public java.lang.String getAllocationType()
getAllocationType
in class Expression
public void fillName(java.lang.StringBuffer fullName, java.lang.String previousType)
Expression
fillName
in class Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |