entities
Class ThrowExpression

java.lang.Object
  extended byentities.Expression
      extended byentities.ThrowExpression
All Implemented Interfaces:
ScopeManager

public class ThrowExpression
extends Expression

The class ThrowExpression represents the throw-statement


Field Summary
 
Fields inherited from class entities.Expression
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS
 
Constructor Summary
ThrowExpression(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 getException()
           
 java.lang.String getString()
           
 void print(java.lang.String indentation)
          Empty
 void setException(Expression expr)
          The parameter "expr" represents the expression found after the keyword "throw"
 
Methods inherited from class entities.Expression
addClass, addClassHeaderFile, addEnumerator, addExpression, addExternalField, addExternalMethod, addField, addFriendClass, addFriendFunction, addFriendMethod, addFunction, addGeneralization, addMethod, addNameSpace, addType, addUserType, addVariable, cleanType, fillName, fillNameNew, getAllocationType, getCast, getCastType, getClassContext, getContainingMethod, getContext, getContextNew, getCurrentMethod, getFile, getLBracketPosition, getName, getOperator, getOperators, getParent, getParentScope, getPosition, getPreviousExpression, getRBracketPosition, getType, getTypeOfCast, propagateParentScope, resolveType, setCast, setFile, setLBracketPosition, setOperator, setParentScope, setPosition, setPreviousExpression, setRBracketPosition, setTypeOfCast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrowExpression

public ThrowExpression(ScopeManager parentScope)
Method Detail

setException

public void setException(Expression expr)
The parameter "expr" represents the expression found after the keyword "throw"
 void A::f(){ ... throw new E();..}
 
In this case "expr" (of type Allocation) represents the expression "new E()"
 void A::f(){ ... throw E();..}
 
In this case "expr" (of type Call) represents the expression "E()"


getException

public Expression getException()
Returns:
the object of type Expression corresponding to the expression found after the keyword "throw"
 void A::f(){ ... throw new E();..}
 
In this case it returns an object of type Allocation representing the expression "new E()"
 void A::f(){ ... throw E();..}
 
In this case it returns an object of type Call representing the expression "E()"

getString

public java.lang.String getString()
Overrides:
getString in class Expression
Returns:
the representation of the Expression as a String (it is not a thorough reconstruction)

findVariableType

public ScopeManager findVariableType(java.lang.String nameToBeFound,
                                     java.lang.StringBuffer typeToBeFound,
                                     Expression expr)
Description copied from class: Expression
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.

Specified by:
findVariableType in interface ScopeManager
Overrides:
findVariableType in class Expression

computeType

public void computeType(ScopeInfo scopeInfo,
                        java.lang.String indentation)
Description copied from class: Expression
This method, properly overwritten in the subclasses, computes recursively the types of variables involved in the expressions

Overrides:
computeType in class Expression

print

public void print(java.lang.String indentation)
Description copied from class: Expression
Empty

Specified by:
print in interface ScopeManager
Overrides:
print in class Expression