entities
Class Call

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

public class Call
extends Expression

The Call class represents a function or method call statement


Field Summary
 
Fields inherited from class entities.Expression
fCast, fFile, fLBracketPosition, fOperator, fParentScope, fPosition, fPreviousExpression, fRBracketPosition, fToTrace, fTypeOfCast, SEPARATORS
 
Constructor Summary
Call(ScopeManager parentScope)
           
 
Method Summary
 void computeType(ScopeInfo scopeInfo, java.lang.String indentation)
          This method computes recursively the types on the parameter and field expressions.
 void fillName(java.lang.StringBuffer fullName, java.lang.String previousType)
          Compute the complete name to be associated to a SimpleVariable or to a Call expression.
 Expression getField()
           
 Parameter getFormalParameter(int i)
           
 java.util.Vector getFormalParameters()
           
 Function getFunction()
           
 Method getMethod()
           
 java.lang.String getName()
           
 Expression getParameter(int i)
           
 java.util.Vector getParameters()
           
 java.lang.String getScopedName()
           
 java.lang.String getString()
           
 java.lang.String getType()
          For expressions that have a field corresponding to the type, it returns the type or null
 boolean isOnField()
           
 void print(java.lang.String indentation)
          Print all information contained in the Call expression
 java.lang.String resolveType()
           
 void setField(Expression field)
          The parameter "field" represents the expression found after "." or "->"
 void setName(java.lang.String name)
           
 void setParameters(java.util.Vector parameters)
          The parameter "parameters" is used to represent the actual parameters
 void setPreviousExpression(Expression expr)
           
 
Methods inherited from class entities.Expression
addClass, addClassHeaderFile, addEnumerator, addExpression, addExternalField, addExternalMethod, addField, addFriendClass, addFriendFunction, addFriendMethod, addFunction, addGeneralization, addMethod, addNameSpace, addType, addUserType, addVariable, cleanType, fillNameNew, findVariableType, getAllocationType, getCast, getCastType, getClassContext, getContainingMethod, getContext, getContextNew, getCurrentMethod, getFile, getLBracketPosition, getOperator, getOperators, getParent, getParentScope, getPosition, getPreviousExpression, getRBracketPosition, getTypeOfCast, propagateParentScope, setCast, setFile, setLBracketPosition, setOperator, setParentScope, setPosition, setRBracketPosition, setTypeOfCast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Call

public Call(ScopeManager parentScope)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface ScopeManager
Overrides:
getName in class Expression
Returns:
the string corresponding to the function/method name

getParameters

public java.util.Vector getParameters()
Returns:
the Vector containing the objects of type Expression corresponding to the actual parameters

getParameter

public Expression getParameter(int i)
Returns:
the object of type Expression corresponding to the i-parameter, null otherwise

getFormalParameters

public java.util.Vector getFormalParameters()
Returns:
the Vector of Parameter objects corresponding to the formal definition parameters

getFormalParameter

public Parameter getFormalParameter(int i)
Returns:
a object of type Parameter corresponding to the i-parameter if it exists, null otherwise

getMethod

public Method getMethod()
Returns:
the object of type Method corresponding to the call if this has been found, null otherwise

getFunction

public Function getFunction()
Returns:
the object of type Function corresponding to the call if this has been found, null otherwise

getType

public java.lang.String getType()
Description copied from class: Expression
For expressions that have a field corresponding to the type, it returns the type or null

Overrides:
getType in class Expression
Returns:
the string corresponding to the type returned by the function or method

getField

public Expression getField()
Returns:
the expression corresponding to the field

Ex: a()->f(); a()->g; where function a() returns a pointer to A

On the Call object representing the function a() returns the Call and the SimpleVariable objects corresponding to the method f() and the field g respectively.


getScopedName

public java.lang.String getScopedName()
Returns:
the string corresponding to the method name prefixed by the class name

Ex: A a; a.f();

On the Call object representing the method f() returns the String "A::f"


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)

isOnField

public boolean isOnField()
Returns:
true if the Call Exporession is calld on a field of the class.

Ex: class B {void g() {...}}; class A { B b; void f() {b.g()}};

On the Call object representing the method g() returns true because "b" is a field of the class A.


print

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

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

fillName

public void fillName(java.lang.StringBuffer fullName,
                     java.lang.String previousType)
Compute the complete name to be associated to a SimpleVariable or to a Call expression.

Overrides:
fillName in class Expression

setParameters

public void setParameters(java.util.Vector parameters)
The parameter "parameters" is used to represent the actual parameters


setField

public void setField(Expression field)
The parameter "field" represents the expression found after "." or "->"

Ex: a()->f(); a()->f; where function a() returns a pointer to A

In the first case "field" is the expression of type Call associated with the method f() and in the second the expression of type SimpleVariable associated with f


setPreviousExpression

public void setPreviousExpression(Expression expr)
Overrides:
setPreviousExpression in class Expression
Parameters:
expr - represent the expression found before the "." or "->"
See Also:
Expression.fPreviousExpression

setName

public void setName(java.lang.String name)

resolveType

public java.lang.String resolveType()
Overrides:
resolveType in class Expression
Returns:
the type corresonding to the complete expression

Ex: class A { public: int h(); }; A a; a.h; On the expression a.h() returns "int".


computeType

public void computeType(ScopeInfo scopeInfo,
                        java.lang.String indentation)
This method computes recursively the types on the parameter and field expressions.

Overrides:
computeType in class Expression