entities
Class CompositeExpression

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

public class CompositeExpression
extends Expression

The class CompositeExpression represents a statement composed by more than one expression

Ex: a < b;

Ex: a + b - c + d;


Field Summary
 
Fields inherited from class entities.Expression
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS
 
Constructor Summary
CompositeExpression(ScopeManager parentScope)
           
 
Method Summary
 void addUse(Expression expr)
          Add an used expression
 void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
          This method computes recursively the variable types on the expressions contained in the used Expression objects
 java.lang.String getString()
           
 java.util.Vector getUse()
           
 void print(java.lang.String indentation)
          Print all information
 void setUse(java.util.Vector useExpr)
          The parameter "useExpr" is used to represent the expressions in which a more complex expression can be subdivided
 
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, findVariableType, 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

CompositeExpression

public CompositeExpression(ScopeManager parentScope)
Method Detail

getUse

public java.util.Vector getUse()
Returns:
a Vector containing objects of type Expression, that represent the expressions which compose the expression

Ex: a + b - c + d;

In this case returns a Vector containing the Expression objects corresponding to a, b, c, d.


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)

addUse

public void addUse(Expression expr)
Add an used expression

See Also:
setUse(java.util.Vector)

setUse

public void setUse(java.util.Vector useExpr)
The parameter "useExpr" is used to represent the expressions in which a more complex expression can be subdivided

Ex: a * (b + c);

In this case "useExpr" will contain two expressions: one of type SimpleVariable corresponding to the variable "a" and one of type CompositeExpression corresponding to "(b +c)"


print

public void print(java.lang.String indentation)
Print all information

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

computeType

public void computeType(ScopeInfo scopeInfo,
                        java.lang.String indentation)
This method computes recursively the variable types on the expressions contained in the used Expression objects

Overrides:
computeType in class Expression