#include <MethodClass.hpp>
Static Public Member Functions | |
static RexxMethod * | newMethodObject (RexxString *, RexxObject *, RexxObject *, RexxSource *a, bool isBlock=false) |
static RexxMethod * | restore (RexxBuffer *, char *, size_t length) |
static void | createInstance () |
Static Public Member Functions inherited from RexxObject | |
static void | decodeMessageName (RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope) |
static void | createInstance () |
Static Public Member Functions inherited from RexxInternalObject | |
static size_t | getObjectHeaderSize () |
Static Public Attributes | |
static RexxClass * | classInstance = OREF_NULL |
Static Public Attributes inherited from RexxObject | |
static PCPPM | operatorMethods [] |
static RexxClass * | classInstance = OREF_NULL |
Protected Types | |
enum | { PRIVATE_FLAG = 0x01 , UNGUARDED_FLAG = 0x02 , PROTECTED_FLAG = 0x04 , ATTRIBUTE_METHOD = 0x08 , CONSTANT_METHOD = 0x10 , ABSTRACT_METHOD = 0x20 , PACKAGE_FLAG = 0x40 } |
Protected Attributes | |
size_t | methodFlags |
RexxClass * | scope |
Protected Attributes inherited from BaseExecutable | |
RexxString * | executableName |
BaseCode * | code |
Additional Inherited Members | |
Public Attributes inherited from RexxInternalObject | |
ObjectHeader | header |
RexxBehaviour * | behaviour |
Protected Member Functions inherited from RexxVirtualBase | |
virtual | ~RexxVirtualBase () |
virtual void | baseVirtual () |
Definition at line 126 of file MethodClass.hpp.
|
protected |
Enumerator | |
---|---|
PRIVATE_FLAG | |
UNGUARDED_FLAG | |
PROTECTED_FLAG | |
ATTRIBUTE_METHOD | |
CONSTANT_METHOD | |
ABSTRACT_METHOD | |
PACKAGE_FLAG |
Definition at line 200 of file MethodClass.hpp.
RexxMethod::RexxMethod | ( | RexxString * | name, |
BaseCode * | codeObj | ||
) |
Initialize a Routine object from a generated code object. Generally used for routines generated from ::METHOD directives.
name | The routine name. |
codeObj | The associated code object. |
Definition at line 183 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, and OrefSet.
RexxMethod::RexxMethod | ( | RexxString * | name, |
RexxSource * | _source | ||
) |
Generate a method directly from a source object.
source | The source object. |
Definition at line 162 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RexxMethod::RexxMethod | ( | RexxString * | name | ) |
Initialize a RexxMethod object from a file source.
name | The routine name (and the resolved name of the file). |
Definition at line 195 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RexxMethod::RexxMethod | ( | RexxString * | name, |
RexxBuffer * | buf | ||
) |
Initialize a Routine object using a buffered source.
name | The name of the routine. |
source | the source buffer. |
Definition at line 217 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RexxMethod::RexxMethod | ( | RexxString * | name, |
const char * | data, | ||
size_t | length | ||
) |
Initialize a Routine object using directly provided source.
name | The name of the routine. |
data | The source data buffer pointer. |
length | the length of the source buffer. |
Definition at line 240 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
RexxMethod::RexxMethod | ( | RexxString * | name, |
RexxArray * | s | ||
) |
Initialize a Routine object using an array source.
name | The name of the routine. |
source | the source buffer. |
Definition at line 262 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, RexxSource::generateCode(), and OrefSet.
|
inline |
Definition at line 137 of file MethodClass.hpp.
|
inline |
Definition at line 179 of file MethodClass.hpp.
References ATTRIBUTE_METHOD, and methodFlags.
Referenced by setAttribute().
|
static |
Create initial class object at bootstrap time.
Definition at line 74 of file MethodClass.cpp.
References CLASS_CREATE.
Referenced by RexxMemory::createImage().
void RexxMethod::execute | ( | RexxObject * | , |
RexxObject * | |||
) |
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 299 of file MethodClass.cpp.
References cleanUpFlatten, flatten_reference, and setUpFlatten.
|
inline |
Definition at line 187 of file MethodClass.hpp.
References BaseExecutable::code.
|
inline |
Definition at line 183 of file MethodClass.hpp.
References scope.
Referenced by RexxObject::checkPrivate(), InternalActivationFrame::createStackFrame(), RexxBehaviour::define(), RexxNativeActivation::methodVariables(), RexxObject::objectName(), RexxObject::objectNameEquals(), RexxActivation::RexxActivation(), AttributeGetterCode::run(), AttributeSetterCode::run(), and RexxBehaviour::superMethod().
RexxString * RexxMethod::getScopeName | ( | ) |
Retrieve a string name for the method scope. If the scope is .nil, then ".NIL" is returned, otherwise the class name is used.
Definition at line 509 of file MethodClass.cpp.
References TheNilObject.
RexxObject * RexxMethod::getScopeRexx | ( | ) |
Returns the defining class scope for a method. Returns .nil for any method not defined by a class scope.
Definition at line 497 of file MethodClass.cpp.
References resultOrNil().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 169 of file MethodClass.hpp.
References ABSTRACT_METHOD, and methodFlags.
RexxObject * RexxMethod::isAbstractRexx | ( | ) |
Indicate if this is an abstract method
Definition at line 459 of file MethodClass.cpp.
References booleanObject().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 168 of file MethodClass.hpp.
References ATTRIBUTE_METHOD, and methodFlags.
RexxObject * RexxMethod::isAttributeRexx | ( | ) |
Indicate if this method was defined as an attribute method (using ::attribute or ::method attribute)
Definition at line 472 of file MethodClass.cpp.
References booleanObject().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 167 of file MethodClass.hpp.
References CONSTANT_METHOD, and methodFlags.
RexxObject * RexxMethod::isConstantRexx | ( | ) |
Indicate if this method was defined as a constant method (using ::constant)
Definition at line 485 of file MethodClass.cpp.
References booleanObject().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 162 of file MethodClass.hpp.
References methodFlags, and UNGUARDED_FLAG.
Referenced by RexxNativeActivation::methodVariables(), RexxActivation::RexxActivation(), AttributeGetterCode::run(), and AttributeSetterCode::run().
RexxObject * RexxMethod::isGuardedRexx | ( | ) |
Return the Guarded setting for a method object.
Definition at line 416 of file MethodClass.cpp.
References TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
RexxObject * RexxMethod::isPackageRexx | ( | ) |
Return the Package setting for a method object.
Definition at line 437 of file MethodClass.cpp.
References booleanObject().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 165 of file MethodClass.hpp.
References methodFlags, and PACKAGE_FLAG.
Referenced by RexxObject::messageSend().
|
inline |
Definition at line 163 of file MethodClass.hpp.
References methodFlags, and PRIVATE_FLAG.
Referenced by RexxObject::messageSend().
RexxObject * RexxMethod::isPrivateRexx | ( | ) |
Return the Private setting for a method object.
Definition at line 426 of file MethodClass.cpp.
References TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 164 of file MethodClass.hpp.
References methodFlags, and PROTECTED_FLAG.
Referenced by RexxObject::messageSend().
RexxObject * RexxMethod::isProtectedRexx | ( | ) |
Return the Protected setting for a method object.
Definition at line 448 of file MethodClass.cpp.
References TheFalseObject, and TheTrueObject.
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 191 of file MethodClass.hpp.
References BaseExecutable::code, and BaseCode::isSamePackage().
Referenced by RexxObject::checkPackage().
|
inline |
Definition at line 166 of file MethodClass.hpp.
References methodFlags, PACKAGE_FLAG, PRIVATE_FLAG, and PROTECTED_FLAG.
Referenced by RexxObject::messageSend().
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 277 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, and memory_mark.
|
virtual |
Reimplemented from RexxVirtualBase.
Definition at line 288 of file MethodClass.cpp.
References BaseExecutable::code, BaseExecutable::executableName, and memory_mark_general.
RexxMethod * RexxMethod::loadExternalMethod | ( | RexxString * | name, |
RexxString * | descriptor | ||
) |
Create a method from an external library source.
name | The method name. |
Definition at line 974 of file MethodClass.cpp.
References Error_Translation_bad_external, RexxArray::get(), RexxString::getLength(), RexxString::getStringData(), PackageManager::loadMethod(), OREF_NULL, reportException(), RexxArray::size(), stringArgument(), TheNilObject, and StringUtil::words().
Referenced by RexxMemory::createImage().
RexxMethod * RexxMethod::newFileRexx | ( | RexxString * | filename | ) |
Definition at line 760 of file MethodClass.cpp.
References ARG_ONE, RexxClass::checkAbstract(), RexxClass::getInstanceBehaviour(), RexxInternalObject::hasUninit(), RexxClass::hasUninitDefined(), RexxObject::sendMessage(), RexxInternalObject::setBehaviour(), setScope(), stringArgument(), and TheNilObject.
Referenced by RexxMemory::createImage().
|
static |
Static method used for constructing new method objects in various contexts (such as the define method on the Class class).
pgmname | The name of the method we're creating. |
source | The method source (either a string or an array). |
position | The position used for reporting errors. This is the position of the source argument for the calling method context. |
parentScope | The parent code we inherit routine scope from. This overrides anything that might be defined in single method code. |
Definition at line 593 of file MethodClass.cpp.
References ActivityManager::currentActivity, Error_Incorrect_method_no_method, Error_Incorrect_method_noarray, Error_Incorrect_method_nostring_inarray, RexxArray::get(), RexxActivity::getCurrentRexxFrame(), RexxArray::getDimension(), BaseExecutable::getSourceObject(), RexxActivation::getSourceObject(), RexxSource::inheritSourceContext(), IntegerTwo, RexxObject::makeString(), RexxArray::makeString(), new_array(), OREF_NULL, RexxArray::put(), reportException(), RexxObject::requestArray(), RexxSource::setIsBlock(), RexxArray::size(), BaseExecutable::source(), and TheNilObject.
Referenced by RexxClass::defineMethod(), RexxClass::methodDictionaryCreate(), newRexx(), RexxObject::run(), RexxDirectory::setMethod(), and RexxObject::setMethod().
RexxMethod * RexxMethod::newRexx | ( | RexxObject ** | init_args, |
size_t | argCount, | ||
size_t | named_argCount | ||
) |
Definition at line 669 of file MethodClass.cpp.
References ARG_ONE, ARG_TWO, RexxClass::checkAbstract(), Error_Incorrect_call_list, Error_Incorrect_method_argType, Error_Logical_value_method, RexxClass::getInstanceBehaviour(), RexxInternalObject::hasUninit(), RexxClass::hasUninitDefined(), IntegerThree, IntegerTwo, isOfClass, new_string(), newMethodObject(), OREF_NULL, RexxClass::processNewArgs(), reportException(), RexxObject::requestString(), requiredArgument(), RexxObject::sendMessage(), RexxInternalObject::setBehaviour(), stringArgument(), TheNilObject, and RexxObject::truthValue().
Referenced by RexxMemory::createImage().
RexxMethod * RexxMethod::newScope | ( | RexxClass * | _scope | ) |
Definition at line 333 of file MethodClass.cpp.
References RexxObject::copy(), OREF_NULL, OrefSet, and scope.
Referenced by RexxClass::defineClassMethod(), RexxClass::defineMethod(), RexxObject::defMethod(), RexxObject::defMethods(), RexxClass::methodDictionaryCreate(), RexxObject::run(), and RexxDirectory::setMethod().
|
inline |
Definition at line 130 of file MethodClass.hpp.
void * RexxMethod::operator new | ( | size_t | size | ) |
Definition at line 568 of file MethodClass.cpp.
References new_object(), and T_Method.
|
static |
Definition at line 791 of file MethodClass.cpp.
References RexxEnvelope::getReceiver(), and RexxEnvelope::puff().
void RexxMethod::run | ( | RexxActivity * | activity, |
RexxObject * | receiver, | ||
RexxString * | msgname, | ||
RexxObject ** | argPtr, | ||
size_t | count, | ||
size_t | named_count, | ||
ProtectedObject & | result | ||
) |
Definition at line 315 of file MethodClass.cpp.
References BaseExecutable::code, and BaseCode::run().
Referenced by RexxDirectory::allIndexesItems(), RexxDirectory::allItems(), RexxDirectory::appendAllIndexesItemsTo(), RexxDirectory::at(), RexxDirectory::indexRexx(), RexxObject::messageSend(), RexxObject::processProtectedMethod(), RexxObject::processUnknown(), RexxDirectory::pushAllIndexesItemsTo(), RexxObject::run(), and RexxDirectory::supplier().
RexxSmartBuffer * RexxMethod::saveMethod | ( | ) |
Definition at line 553 of file MethodClass.cpp.
References RexxEnvelope::getBuffer(), and RexxEnvelope::pack().
|
inline |
Definition at line 180 of file MethodClass.hpp.
References ABSTRACT_METHOD, and methodFlags.
Referenced by RexxSource::createAbstractMethod(), and RexxSource::methodDirective().
|
inline |
Definition at line 178 of file MethodClass.hpp.
References ATTRIBUTE_METHOD, and methodFlags.
Referenced by RexxSource::attributeDirective(), RexxSource::createAbstractMethod(), RexxSource::createAttributeGetterMethod(), RexxSource::createAttributeSetterMethod(), RexxSource::createMethod(), and RexxSource::methodDirective().
|
inline |
Definition at line 181 of file MethodClass.hpp.
References clearAttribute(), and setAttribute().
Referenced by setAttribute().
void RexxMethod::setAttributes | ( | AccessFlag | _access, |
ProtectedFlag | _protected, | ||
GuardFlag | _guarded | ||
) |
Set the entire set of method attributes with one call. Used during source compilation.
_access | The access setting. |
_protected | The protected setting. |
_guarded | The guarded setting. |
Definition at line 523 of file MethodClass.cpp.
References PACKAGE_SCOPE, PRIVATE_SCOPE, PROTECTED_METHOD, and UNGUARDED_METHOD.
Referenced by RexxSource::attributeDirective(), RexxSource::createAbstractMethod(), RexxSource::createAttributeGetterMethod(), RexxSource::createAttributeSetterMethod(), RexxSource::createMethod(), and RexxSource::methodDirective().
|
inline |
Definition at line 177 of file MethodClass.hpp.
References CONSTANT_METHOD, and methodFlags.
Referenced by RexxSource::createConstantGetterMethod().
|
inline |
Definition at line 172 of file MethodClass.hpp.
References methodFlags, and UNGUARDED_FLAG.
RexxObject * RexxMethod::setGuardedRexx | ( | ) |
Definition at line 384 of file MethodClass.cpp.
References OREF_NULL.
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 175 of file MethodClass.hpp.
References methodFlags, and PACKAGE_FLAG.
|
inline |
Definition at line 174 of file MethodClass.hpp.
References methodFlags, and PRIVATE_FLAG.
Referenced by RexxMemory::definePrivateKernelMethod().
RexxObject * RexxMethod::setPrivateRexx | ( | ) |
Definition at line 393 of file MethodClass.cpp.
References OREF_NULL.
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 176 of file MethodClass.hpp.
References methodFlags, and PROTECTED_FLAG.
Referenced by RexxMemory::defineProtectedKernelMethod().
RexxObject * RexxMethod::setProtectedRexx | ( | ) |
Definition at line 402 of file MethodClass.cpp.
References OREF_NULL.
Referenced by RexxMemory::createImage().
void RexxMethod::setScope | ( | RexxClass * | _scope | ) |
Definition at line 365 of file MethodClass.cpp.
References OrefSet.
Referenced by RexxClass::defineMethods(), RexxClass::methodDictionaryCreate(), newFileRexx(), and RexxDirectory::setMethod().
RexxObject * RexxMethod::setSecurityManager | ( | RexxObject * | manager | ) |
Definition at line 356 of file MethodClass.cpp.
References BaseExecutable::code, and BaseCode::setSecurityManager().
Referenced by RexxMemory::createImage().
|
inline |
Definition at line 171 of file MethodClass.hpp.
References methodFlags, and UNGUARDED_FLAG.
Referenced by RexxSource::createConstantGetterMethod().
RexxObject * RexxMethod::setUnguardedRexx | ( | ) |
Definition at line 375 of file MethodClass.cpp.
References OREF_NULL.
Referenced by RexxMemory::createImage().
Definition at line 197 of file MethodClass.hpp.
|
protected |
Definition at line 211 of file MethodClass.hpp.
Referenced by clearAttribute(), isAbstract(), isAttribute(), isConstant(), isGuarded(), isPackageScope(), isPrivate(), isProtected(), isSpecial(), setAbstract(), setAttribute(), setConstant(), setGuarded(), setPackageScope(), setPrivate(), setProtected(), and setUnguarded().
|
protected |
Definition at line 212 of file MethodClass.hpp.
Referenced by getScope(), and newScope().