|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Expression
entities.SwitchExpression
The class SwitchExpression represents an switch-statement
Field Summary |
Fields inherited from class entities.Expression |
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS |
Constructor Summary | |
SwitchExpression(ScopeManager parentScope)
|
Method Summary | |
void |
addCase(CaseExpression caseExpr)
|
void |
addExpression(Expression expr,
ScopeManager wrapper)
Add an object of type CaseExpression to the switch |
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. |
java.util.Vector |
getCases()
|
Expression |
getSelector()
|
java.lang.String |
getString()
|
void |
print(java.lang.String indentation)
Empty |
void |
setSelector(Expression expr)
The parameter "expr" represents the expression found after the keyword switch |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SwitchExpression(ScopeManager parentScope)
Method Detail |
public Expression getSelector()
Ex: switch (a) {...}In this case it returns the SimpleVariable corresponding to the variable "a"
public java.util.Vector getCases()
Ex: switch (a) { case 1: ... break; case 2: ... break; case 3: ... break; }In this case it returns a Vector containing 3 CaseExpression associated to the 3 case statements
public java.lang.String getString()
getString
in class Expression
public void addCase(CaseExpression caseExpr)
caseExpr
- represents a case statement inside a switchpublic void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
Expression
computeType
in class Expression
public void setSelector(Expression expr)
Ex: switch (a) {...}In this case "expr" is the SimpleVariable corresponding to the variable "a"
public void addExpression(Expression expr, ScopeManager wrapper)
addExpression
in interface ScopeManager
addExpression
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)
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 |