entities
Class Assignment

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

public class Assignment
extends Expression

This class represents a C++ assignment statement


Field Summary
 
Fields inherited from class entities.Expression
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS
 
Constructor Summary
Assignment(ScopeManager parentScope)
           
 
Method Summary
 void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
          This method computes recursively the types on the left and right sides of the assignment
 Expression getLhs()
           
 Expression getRhs()
           
 java.lang.String getString()
           
 void print(java.lang.String indentation)
          Prints all information contained in the Assignment expression
 void setLhs(Expression lhs)
          The parameter "lhs" is used to represent the expression found on the left of the symbol "="
 void setRhs(Expression rhs)
          The parameter "rhs" is used to represent the expression found on the right of the symbol "="
 
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

Assignment

public Assignment(ScopeManager parentScope)
Method Detail

getLhs

public Expression getLhs()
Returns:
the Expression corresponding to the left side of assignment

getRhs

public Expression getRhs()
Returns:
the Expression corresponding to the right side of assignment

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)

setLhs

public void setLhs(Expression lhs)
The parameter "lhs" is used to represent the expression found on the left of the symbol "="

Ex: int a; int b; .... b = a * 10;

In this case "lhs" will contain the expression (of type SimpleVariable) corresponding to "b"


setRhs

public void setRhs(Expression rhs)
The parameter "rhs" is used to represent the expression found on the right of the symbol "="

Ex: int a; int b; .... b = a * 10;

In this case "rhs" will contain the expression (of type CompositeExpression) corresponding to "a*10"


computeType

public void computeType(ScopeInfo scopeInfo,
                        java.lang.String indentation)
This method computes recursively the types on the left and right sides of the assignment

Overrides:
computeType in class Expression

print

public void print(java.lang.String indentation)
Prints all information contained in the Assignment expression

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