Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members

CCM::Method Class Reference

List of all members.

Detailed Description

Represents a method.

This class implements IEnumerable to iterate over all possible call arguments.


Public Member Functions

 Method (string name, Type retType, IList pars, List attrs, bool _static)
 Create new method.

void setBody (Block body)
 Set the body of the class.

string getName ()
 Return the method's name.

int numParams ()
 Return the number of parameters.

bool isStatic ()
 Return whether this is a static method.

VariableDecl getParam (string name)
 Get the declaration of the parameter with given name.

Type returnType ()
 Get the return type (null means void).

Attribute getAttribute (string name)
 Returns the first attribute that has the given name.

bool compatibleArgs (IList args)
 Return whether this method is callable with arguments args (which must be either proper values or Expr derivatives).

bool isAmbiguous (Method m)
 Returns wheter this method is ambiguous to the given one (same name and parameters).

Object execute (IList paramValues)
 Execute the method with given parameters (which must be proper values).

override string ToString ()
IEnumerator GetEnumerator ()
 Get an iterator over the method parameters.

IEnumerator getReturnEnumerator ()
 Get an iterator over the return values.


Static Public Member Functions

bool returning ()
 Returns true if a return statement was executed (thus the statements following it must not be executed).

void setReturn (Object val)
 Set the returning flag and return the given value.

Variable getCallParam (string name)
 Get method parameter value by name (for resolving in expressions).


Private Attributes

string name
Type retType
IList pars
Block body
List attrs
bool _static

Static Private Attributes

bool returnFlag = false
Object returnVal = null
Stack calledMethods = new Stack()
 Stack of currently called methods (of MethodCall).


Constructor & Destructor Documentation

CCM::Method::Method string  name,
Type  retType,
IList  pars,
List  attrs,
bool  _static
 

Create new method.

Parameters:
name Method name
retType Return type (null for void)
pars Method parameters (list of VariableDecl)
attrs List of Attributes
_static true if this is a static method


Member Function Documentation

bool CCM::Method::compatibleArgs IList  args  ) 
 

Return whether this method is callable with arguments args (which must be either proper values or Expr derivatives).

Object CCM::Method::execute IList  paramValues  ) 
 

Execute the method with given parameters (which must be proper values).

Attribute CCM::Method::getAttribute string  name  ) 
 

Returns the first attribute that has the given name.

Variable CCM::Method::getCallParam string  name  )  [static]
 

Get method parameter value by name (for resolving in expressions).

IEnumerator CCM::Method::GetEnumerator  ) 
 

Get an iterator over the method parameters.

string CCM::Method::getName  ) 
 

Return the method's name.

VariableDecl CCM::Method::getParam string  name  ) 
 

Get the declaration of the parameter with given name.

IEnumerator CCM::Method::getReturnEnumerator  ) 
 

Get an iterator over the return values.

bool CCM::Method::isAmbiguous Method  m  ) 
 

Returns wheter this method is ambiguous to the given one (same name and parameters).

bool CCM::Method::isStatic  ) 
 

Return whether this is a static method.

int CCM::Method::numParams  ) 
 

Return the number of parameters.

bool CCM::Method::returning  )  [static]
 

Returns true if a return statement was executed (thus the statements following it must not be executed).

Type CCM::Method::returnType  ) 
 

Get the return type (null means void).

void CCM::Method::setBody Block  body  ) 
 

Set the body of the class.

This can not be done in the constructor, because the parameters are already needed when parsing the body block.

void CCM::Method::setReturn Object  val  )  [static]
 

Set the returning flag and return the given value.

override string CCM::Method::ToString  ) 
 


Member Data Documentation

bool CCM::Method::_static [private]
 

List CCM::Method::attrs [private]
 

Block CCM::Method::body [private]
 

Stack CCM::Method::calledMethods = new Stack() [static, private]
 

Stack of currently called methods (of MethodCall).

string CCM::Method::name [private]
 

IList CCM::Method::pars [private]
 

Type CCM::Method::retType [private]
 

bool CCM::Method::returnFlag = false [static, private]
 

Object CCM::Method::returnVal = null [static, private]
 


The documentation for this class was generated from the following file:
Generated on Mon Jun 21 01:20:50 2004 for cs2ccmb by doxygen 1.3.7