|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Expression
entities.TryExpression
The class TryExpression represents the statements in a try block
Field Summary |
Fields inherited from class entities.Expression |
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS |
Constructor Summary | |
TryExpression(ScopeManager parentScope)
|
Method Summary | |
void |
addCatch(CatchExpression catchExpr)
|
void |
addExpression(Expression expr,
ScopeManager wrapper)
Add an Expression object associated with a statement inside the try block to the current object |
void |
addVariable(Variable var)
Empty |
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 |
getBody()
|
java.util.Vector |
getCatches()
|
java.lang.String |
getString()
|
void |
print(java.lang.String indentation)
Empty |
void |
setLBracketPosition(int position)
Empty |
void |
setRBracketPosition(int position)
Empty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TryExpression(ScopeManager parentScope)
Method Detail |
public java.util.Vector getBody()
public java.util.Vector getCatches()
Ex: try { } catch (Overflow& o) { .... } catch (Underflow& u) { .... } }In this case it returns a Vector containing 2 CatchExpression associated to the 2 catch statements
public java.lang.String getString()
getString
in class Expression
public void addVariable(Variable var)
Expression
addVariable
in interface ScopeManager
addVariable
in class Expression
var
- represents a local variable declared inside the try
blockpublic ScopeManager findVariableType(java.lang.String nameToBeFound, java.lang.StringBuffer typeToBeFound, Expression expr)
Expression
findVariableType
in interface ScopeManager
findVariableType
in class Expression
public void addExpression(Expression expr, ScopeManager wrapper)
addExpression
in interface ScopeManager
addExpression
in class Expression
public void addCatch(CatchExpression catchExpr)
catchExpr
- represents the expression associated with a catch block
Ex: try { } catch (Overflow& o) { .... } }In this case "catchExpr" represents the statement "catch (Overflow& o) {....}"
public void setLBracketPosition(int position)
Expression
setLBracketPosition
in class Expression
position
- represents the position of "{", if presentpublic void setRBracketPosition(int position)
Expression
setRBracketPosition
in class Expression
position
- represents the position of "}", if presentpublic void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
Expression
computeType
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 |