|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Expression
entities.IfExpression
The class IfExpression represents an if-statement
Field Summary |
Fields inherited from class entities.Expression |
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS |
Constructor Summary | |
IfExpression(ScopeManager parentScope)
|
Method Summary | |
void |
computeType(ScopeInfo scopeInfo,
java.lang.String indentation)
This method, properly overwritten in the subclasses, computes recursively the types of variables involved in the expressions |
ScopeManager |
findVariableType(java.lang.String nameToBeFound,
java.lang.StringBuffer typeToBeFound,
Expression expr)
Look for the variable declaration whose name is "nameToBeFound" and return the ScopeManager in which it is defined (if found), filling "typeToBeFound" with the variabl type. |
Expression |
getCondition()
|
Expression |
getElsePart()
|
java.lang.String |
getString()
|
Expression |
getThenPart()
|
void |
print(java.lang.String indentation)
Print all information |
void |
setCondition(Expression expr,
ScopeManager wrapper)
The expression "expr" is used to represent the condition after the keyword "if" |
void |
setElsePart(ElseExpression elseExpr)
The expression "elsePart" is used to represent all the statements associated with the else |
void |
setThenPart(ThenExpression thenExpr)
The expression "thenPart" is used to represent all the statements of the then block |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IfExpression(ScopeManager parentScope)
Method Detail |
public Expression getCondition()
Ex: if (i>0) {...}In this case it returns the CompositeExpression corresponding to the statement "i>0"
public Expression getThenPart()
public Expression getElsePart()
public java.lang.String getString()
getString
in class Expression
public void setCondition(Expression expr, ScopeManager wrapper)
Ex: if (a>b) {...}The parameter "expr" represents the expression "a>b"
public void setThenPart(ThenExpression thenExpr)
Ex: if (a>b) {...}
In this case "thenPart" represents all the statements inside the "{}"
public void setElsePart(ElseExpression elseExpr)
Ex: if (a>b) {...} else {....}
In this case elsePart represents all the statements inside the "{}" after the keyword else
public void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
Expression
computeType
in class Expression
public ScopeManager findVariableType(java.lang.String nameToBeFound, java.lang.StringBuffer typeToBeFound, Expression expr)
Expression
findVariableType
in interface ScopeManager
findVariableType
in class Expression
public void print(java.lang.String indentation)
print
in interface ScopeManager
print
in class Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |