|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Expression
entities.SimpleVariable
The class represents a C++ variable
Field Summary |
Fields inherited from class entities.Expression |
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS |
Constructor Summary | |
SimpleVariable(ScopeManager parentScope)
|
Method Summary | |
void |
addIndex(Expression expr)
Add an Expression object to the index expressions |
void |
computeType(ScopeInfo inputScopeInfo,
java.lang.String indentation)
This method computes recursively the types on the field and on the elements of index expressions |
void |
fillName(java.lang.StringBuffer fullName,
java.lang.String previousType)
Compute the complete name to associate to a SimpleVariable |
void |
fillNameNew(java.lang.StringBuffer fullName,
java.lang.String previousType)
Compute the complete name to associate to a SimpleVariable |
Expression |
getField()
|
java.util.Vector |
getIndex()
|
java.lang.String |
getName()
|
Parameter |
getRefParameter()
|
Variable |
getRefVariable()
|
java.lang.String |
getScopedName()
|
java.lang.String |
getString()
|
java.lang.String |
getType()
For expressions that have a field corresponding to the type, it returns the type or null |
boolean |
IsOnRef()
|
void |
print(java.lang.String indentation)
Empty |
java.lang.String |
resolveType()
|
void |
setField(Expression field)
The parameter "field" represents the expression found after "." or "->" |
void |
setName(java.lang.String name)
Set the name of the variable corresponding to the SimpleVariable expression |
void |
setOnRef(boolean onRef)
|
void |
setPreviousExpression(Expression expr)
|
void |
setRefParameter(Parameter par)
|
void |
setRefVariable(Variable var)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleVariable(ScopeManager parentScope)
Method Detail |
public java.lang.String getName()
getName
in interface ScopeManager
getName
in class Expression
public java.lang.String getScopedName()
Ex: class A { int p () { int j; j = 2; } };On the SimpleVariable representing the local variable "j" it returns "A::p::j"
public Expression getField()
Ex: A *a; ...; a->f(); a->g;
On the SimpleVariable object representing the variable "a" returns the Call and the SimpleVariable objects corresponding to the method f() and the field g respectively.
public java.util.Vector getIndex()
Ex: a[3][5] = 10;
On the SimpleVariable object representing the variable "a" returns a Vector containing two ConstantExpression associated to the constant 3 and 5.
public Variable getRefVariable()
public Parameter getRefParameter()
public java.lang.String getString()
getString
in class Expression
public boolean IsOnRef()
public void addIndex(Expression expr)
public void setName(java.lang.String name)
public void setRefParameter(Parameter par)
par
- represents the parameter associated with the
SimpleVariable, if it is a parameterpublic void setRefVariable(Variable var)
var
- represents the variable (local, field or global)
associated with the SimpleVariable if it is not a parameterpublic void fillName(java.lang.StringBuffer fullName, java.lang.String previousType)
fillName
in class Expression
public void fillNameNew(java.lang.StringBuffer fullName, java.lang.String previousType)
fillNameNew
in class Expression
public void setField(Expression field)
Ex: A *a; ... a->f(); a->f;
In the first case "field" is the expression of type Call associated with the method f() and in the second the expression of type SimpleVariable associated with f
public void setPreviousExpression(Expression expr)
setPreviousExpression
in class Expression
expr
- represent the expression found before the "." or "->"Expression.fPreviousExpression
public void setOnRef(boolean onRef)
onRef
- is true if the SimpleVariable is a pointerpublic void computeType(ScopeInfo inputScopeInfo, java.lang.String indentation)
computeType
in class Expression
public java.lang.String getType()
Expression
getType
in class Expression
public java.lang.String resolveType()
resolveType
in class Expression
Ex: class A { public: int h; }; A a; a.h; On the expression a.h returns "int".
public void print(java.lang.String indentation)
Expression
print
in interface ScopeManager
print
in class Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |