147 this->
sendMessage(OREF_STRICT_EQUAL, other, result);
286 return method_object;
390 return ((
RexxObject *)result)->stringValue()->getObjectHashCode();
496 void *RexxInternalObject::operator
new(
size_t size,
505 newObject->
setBehaviour(classObject->getInstanceBehaviour());
506 return(
void *)newObject;
509 void *RexxInternalObject::operator
new(
size_t size,
513 size_t named_argCount)
521 newObject->
setBehaviour(classObject->getInstanceBehaviour());
606 if (((
RexxClass *)sender)->isCompatibleWith(scope))
668 this->
sendMessage(message, args, argCount, named_argCount, r);
690 this->
sendMessage(message, argument1, argument2, r);
698 this->
sendMessage(message, argument1, argument2, argument3, r);
706 this->
sendMessage(message, argument1, argument2, argument3, argument4, r);
714 this->
sendMessage(message, argument1, argument2, argument3, argument4, argument5, r);
734 size_t argumentsCount = arguments ? arguments->
size() : 0;
739 this->
messageSend(message, args->
data(), argumentsCount, namedArgumentsCount, result);
746 arguments[0] = argument1;
747 this->
messageSend(message, arguments, 1, 0, result);
761 arguments[0] = argument1;
762 arguments[1] = argument2;
764 this->
messageSend(message, arguments, 2, 0, result);
779 arguments[0] = argument1;
780 arguments[1] = argument2;
781 arguments[2] = argument3;
783 this->
messageSend(message, arguments, 3, 0, result);
799 arguments[0] = argument1;
800 arguments[1] = argument2;
801 arguments[2] = argument3;
802 arguments[3] = argument4;
804 this->
messageSend(message, arguments, 4, 0, result);
821 arguments[0] = argument1;
822 arguments[1] = argument2;
823 arguments[2] = argument3;
824 arguments[3] = argument4;
825 arguments[4] = argument5;
827 this->
messageSend(message, arguments, 5, 0, result);
884 target->
processUnknown(error, msgname, arguments, count, named_count, result);
943 target->
processUnknown(error, msgname, arguments, count, named_count, result);
996 for (
size_t i = 1; i <= count; i++)
998 argumentArray->
put(arguments[i - 1], i);
1008 unknown_arguments[0] = messageName;
1010 unknown_arguments[1] = argumentArray;
1011 unknown_arguments[2] = OREF_NAMEDARGUMENTS;
1012 unknown_arguments[3] = namedArgumentDirectory ? namedArgumentDirectory :
TheNilObject;
1153 return OREF_NULLSTRING;
1308 return string_value;
1314 this->
sendMessage(OREF_REQUEST, OREF_STRINGSYM, string_value);
1317 string_value = ((
RexxObject *)string_value)->primitiveMakeString();
1368 return string_value;
1373 this->
sendMessage(OREF_REQUEST, OREF_STRINGSYM, string_value);
1409 this->
sendMessage(OREF_REQUEST, OREF_TEXT, text_value);
1436 string_value = this->
sendMessage(OREF_REQUEST, OREF_STRINGSYM);
1464 string_value = this->
sendMessage(OREF_REQUEST, OREF_STRINGSYM);
1713 this->
sendMessage(OREF_DEFAULTNAME, string_value);
1749 switch (defaultname->
getChar(0))
1833 this->
defMethod(msgname, methobj, option);
1889 return this->
dynamicTarget(arguments, argCount, named_argCount);
1902 RexxObject **named_arglist,
size_t named_argcount)
1912 size_t count = arguments->
size();
1921 expectedNamedArguments.
match(named_arglist, named_argcount,
true,
false);
1925 size_t named_count = 0;
1930 p_named_arguments_value = named_arguments_value;
1937 named_count = named_arguments_value->
items();
1942 if (named_count != 0)
1946 p_new_arguments = new_arguments;
1953 this->
messageSend(messageName, new_arguments->
data(), count, named_count, r);
1957 this->
messageSend(messageName, new_arguments->
data(), count, named_count, startScope, r);
1991 this->
messageSend(messageName, arguments + 1, argCount - 1, named_argCount, r);
1995 this->
messageSend(messageName, arguments + 1, argCount - 1, named_argCount, startScope, r);
2012 RexxObject **named_arglist,
size_t named_argcount)
2019 size_t count = arguments->
size();
2028 expectedNamedArguments.
match(named_arglist, named_argcount,
true,
false);
2032 size_t named_count = 0;
2037 p_named_arguments_value = named_arguments_value;
2044 named_count = named_arguments_value->
items();
2049 if (named_count != 0)
2052 p_new_arguments = new_arguments;
2057 return startCommon(message, new_arguments->
data(), count, named_count);
2082 return startCommon(message, arguments + 1, argCount - 1, named_argCount);
2145 startScope = messageArray->
get(2);
2155 if (sender != target)
2182 snprintf(buffer,
sizeof buffer,
"%p",
this);
2199 size_t argumentsCount,
2200 size_t named_argumentsCount)
2209 size_t argcount = 0;
2210 size_t named_argcount = 0;
2223 if (argumentsCount == 0)
2248 if (argumentsCount > 1)
2254 option = toupper((
int)optionString->
getChar(0));
2263 if (argumentsCount < 3)
2267 if (argumentsCount > 3)
2276 p_arglist = arglist;
2285 argumentPtr = arglist->
data();
2286 argcount = arglist->
size();
2288 if (arglist == arglistUser)
2292 p_arglist = arglist;
2299 argumentPtr = arguments + 2;
2300 argcount = argumentsCount - 2;
2313 named_argcount = named_argumentsCount;
2322 expectedNamedArguments.
match(arguments + argumentsCount, named_argumentsCount,
true,
false);
2324 argdirectory = (
RexxDirectory *)expectedNamedArguments[0].value;
2328 p_argdirectory = argdirectory;
2333 named_argcount = argdirectory->
items();
2336 if (named_argcount != 0)
2341 arglist =
new_array(2 * named_argcount);
2342 p_arglist = arglist;
2345 argumentPtr = arglist->
data();
2379 name = name->
upper();
2400 msgname = msgname->
upper();
2419 methcopy = methobj->
newScope(targetClass);
2524 ovd->
set(name, value);
2536 OrefSet(
this, objectVariables, dictionary);
2568 if (dictionary->
isScope(scope))
2580 OrefSet(
this, objectVariables, dictionary);
2620 return "unknown Class";
2641 return createClass->
getId();
2710 return new (classThis, arguments, argCount, named_argCount)
RexxObject;
2732 memcpy((
char *)cloneObj, (
char *)
this, size);
2734 cloneObj->
header = newHeader;
2738 #undef operatorMethod
2739 #define operatorMethod(name, message) RexxObject * RexxObject::name(RexxObject *operand) \
2741 ProtectedObject result; \
2743 this->messageSend(OREF_##message, &operand, 1, 0, result); \
2744 if ((RexxObject *)result == OREF_NULL) \
2746 RexxObject *self = this; \
2747 bool alternativeResult = operand->messageSend(OREF_##message##_RIGHT, &self, 1, 0, result, false); \
2748 if (alternativeResult && (RexxObject *)result != OREF_NULL) return (RexxObject *)result; \
2750 reportException(Error_No_result_object_message, OREF_##message); \
2752 return (RexxObject *)result; \
2756 #undef prefixOperatorMethod
2757 #define prefixOperatorMethod(name, message) RexxObject * RexxObject::name(RexxObject *operand) \
2759 ProtectedObject result; \
2761 this->messageSend(OREF_##message, &operand, operand == OREF_NULL ? 0 : 1, 0, result); \
2762 if ((RexxObject *)result == OREF_NULL) \
2764 if (operand != OREF_NULL) \
2766 RexxObject *self = this; \
2767 bool alternativeResult = operand->messageSend(OREF_##message##_RIGHT, &self, 1, 0, result, false); \
2768 if (alternativeResult && (RexxObject *)result != OREF_NULL) return (RexxObject *)result; \
2771 reportException(Error_No_result_object_message, OREF_##message); \
2773 return (RexxObject *)result; \
2790 operatorMethod(operator_isBackslashGreaterThan, BACKSLASH_GREATERTHAN)
2798 operatorMethod(operator_strictBackslashGreaterThan, STRICT_BACKSLASH_GREATERTHAN)
2800 operatorMethod(operator_strictBackslashLessThan, STRICT_BACKSLASH_LESSTHAN)
2802 operatorMethod(operator_strictLessOrEqual, STRICT_LESSTHAN_EQUAL)
2804 operatorMethod(operator_greaterThanLessThan, GREATERTHAN_LESSTHAN)
2819 newObject->
setBehaviour(classObject->getInstanceBehaviour());
2822 if (classObject->hasUninitDefined() || classObject->parentHasUninitDefined())
2827 return(
void *)newObject;
2831 void *RexxObject::operator
new(
size_t size,
RexxClass *classObject,
RexxObject **args,
size_t argCount,
size_t named_argCount)
2839 ((
RexxObject *)newObject)->sendMessage(OREF_INIT, args, argCount, named_argCount);
2915 return this->
copy();
2922 size_t named_argcount)
2930 expectedNamedArguments.
match(named_arglist, named_argcount,
true,
false);
2934 return this->
unknown(message, arguments, namedArguments);
2995 return(
void *)((
RexxBuffer *)C_self)->getData();
3029 return(
void *)((
RexxBuffer *)C_self)->getData();
3042 void *RexxNilObject::operator
new(
size_t size)
3058 (
PCPPM)&RexxObject::operator_plus,
3059 (
PCPPM)&RexxObject::operator_minus,
3060 (
PCPPM)&RexxObject::operator_multiply,
3061 (
PCPPM)&RexxObject::operator_divide,
3062 (
PCPPM)&RexxObject::operator_integerDivide,
3063 (
PCPPM)&RexxObject::operator_remainder,
3064 (
PCPPM)&RexxObject::operator_power,
3065 (
PCPPM)&RexxObject::operator_abuttal,
3066 (
PCPPM)&RexxObject::operator_concat,
3067 (
PCPPM)&RexxObject::operator_concatBlank,
3068 (
PCPPM)&RexxObject::operator_equal,
3069 (
PCPPM)&RexxObject::operator_notEqual,
3070 (
PCPPM)&RexxObject::operator_isGreaterThan,
3071 (
PCPPM)&RexxObject::operator_isBackslashGreaterThan,
3072 (
PCPPM)&RexxObject::operator_isLessThan,
3073 (
PCPPM)&RexxObject::operator_isBackslashLessThan,
3074 (
PCPPM)&RexxObject::operator_isGreaterOrEqual,
3075 (
PCPPM)&RexxObject::operator_isLessOrEqual,
3076 (
PCPPM)&RexxObject::operator_strictEqual,
3077 (
PCPPM)&RexxObject::operator_strictNotEqual,
3078 (
PCPPM)&RexxObject::operator_strictGreaterThan,
3079 (
PCPPM)&RexxObject::operator_strictBackslashGreaterThan,
3080 (
PCPPM)&RexxObject::operator_strictLessThan,
3081 (
PCPPM)&RexxObject::operator_strictBackslashLessThan,
3082 (
PCPPM)&RexxObject::operator_strictGreaterOrEqual,
3083 (
PCPPM)&RexxObject::operator_strictLessOrEqual,
3084 (
PCPPM)&RexxObject::operator_lessThanGreaterThan,
3085 (
PCPPM)&RexxObject::operator_greaterThanLessThan,
3086 (
PCPPM)&RexxObject::operator_and,
3087 (
PCPPM)&RexxObject::operator_or,
3088 (
PCPPM)&RexxObject::operator_xor,
3089 (
PCPPM)&RexxObject::operator_not,
void reportException(wholenumber_t error)
void reportNomethod(RexxErrorCodes error, RexxString *message, RexxObject *receiver)
RexxMethod * lastMethod()
void missingArgument(RexxString *kind, size_t argumentPosition)
RexxArray * new_array(size_t s)
RexxInteger * new_integer(wholenumber_t v)
#define operatorMethod(name, message)
#define prefixOperatorMethod(name, message)
RexxObject *(RexxObject::* PCPPM)()
RexxObject * booleanObject(bool v)
RexxString * stringArgument(RexxObject *object, RexxString *kind, size_t position)
RexxArray * REQUEST_ARRAY(RexxObject *obj)
wholenumber_t RexxErrorCodes
RexxString * REQUEST_STRING(RexxObject *object)
#define isOfClassType(t, r)
RexxArray * arrayArgument(RexxObject *object, RexxString *kind, size_t position)
void requiredArgument(RexxObject *object, RexxString *kind, size_t position)
#define Error_Execution_super
#define Error_Logical_value_method
#define Error_Incorrect_method_option
#define Error_Execution_user_defined
#define Error_Incorrect_method_positive
#define Error_No_result_object_message
#define Error_Incorrect_method_nostring
#define Error_Incorrect_method_nonnegative
#define Error_Incorrect_call_list
#define Error_Incorrect_method_message
#define Error_Incorrect_method_whole
#define Error_Incorrect_method_maxarg
#define Error_No_method_private
#define Error_Invalid_whole_number_compareto
#define Error_No_method_name
#define Error_Incorrect_method_noarray
#define Error_Invalid_argument_string
#define Error_No_method_package
#define memory_mark(oref)
RexxObject * new_object(size_t s)
#define flatten_reference(oref, envel)
#define CLASS_CREATE(name, id, className)
#define memory_mark_general(oref)
#define setUpFlatten(type)
RexxVariableDictionary * new_objectVariableDictionary(RexxObject *s)
RexxString * new_string(const char *s, stringsize_t l)
RexxString * new_proxy(const char *name)
static RexxActivity *volatile currentActivity
void match(RexxObject **namedArglist, size_t namedArgCount, bool strict, bool extraAllowed, size_t minimumRequired=0)
virtual RexxObject * getReceiver()
virtual PackageClass * getPackage()
SecurityManager * getEffectiveSecurityManager()
RexxActivationBase * getTopStackFrame()
bool raiseCondition(RexxString *, RexxObject *, RexxString *, RexxObject *, RexxObject *)
void put(RexxObject *eref, size_t pos)
RexxObject * get(size_t pos)
RexxMethod * methodLookup(RexxString *)
RexxTable * getMethodDictionary()
RexxObject * define(RexxString *, RexxMethod *)
void removeMethod(RexxString *)
RexxClass * getOwningClass()
RexxSupplier * getMethods(RexxObject *scope)
RexxTable * getInstanceMethodDictionary()
RexxMethod * superMethod(RexxString *, RexxObject *)
RexxObject * superScope(RexxObject *)
void addMethod(RexxString *, RexxMethod *)
bool isCompatibleWith(RexxClass *other)
size_t appendAllIndexesItemsTo(RexxArray *array, size_t from)
static RexxDirectory * fromIndexItemArray(RexxObject **arglist, size_t count)
bool available(HashLink pos)
RexxObject * value(HashLink pos)
HashLink next(HashLink pos)
RexxObject * index(HashLink pos)
virtual RexxInteger * integerValue(size_t)
virtual bool isInstanceOf(RexxClass *)
void setBehaviour(RexxBehaviour *b)
virtual RexxString * primitiveMakeString()
virtual bool unsignedNumberValue(stringsize_t &result, size_t precision)
virtual RexxText * makeText()
virtual bool isEqual(RexxObject *)
void setVirtualFunctions(void *t)
bool isSubClassOrEnhanced()
virtual RexxObject * makeProxy(RexxEnvelope *)
virtual bool doubleValue(double &result)
virtual RexxString * stringValue()
virtual RexxSupplier * instanceMethods(RexxClass *)
virtual RexxString * makeString()
virtual bool numberValue(wholenumber_t &result, size_t precision)
virtual RexxArray * makeArray()
virtual RexxText * primitiveMakeText()
virtual RexxObject * dynamicTarget(RexxObject **arguments, size_t count, size_t named_count)
virtual RexxMethod * instanceMethod(RexxString *)
virtual void copyIntoTail(RexxCompoundTail *buffer)
virtual HashCode getHashValue()
virtual RexxObject * copy()
size_t getObjectTypeNumber()
RexxBehaviour * behaviour
virtual RexxText * textValue()
virtual RexxNumberString * numberString()
virtual bool truthValue(int)
virtual bool logicalValue(logical_t &)
void removeUninitObject(RexxObject *obj)
static void * virtualFunctionTable[]
void addUninitObject(RexxObject *obj)
RexxObject * start(RexxObject *)
void run(RexxActivity *, RexxObject *, RexxString *, RexxObject **, size_t, size_t, ProtectedObject &)
bool isSamePackage(PackageClass *p)
static RexxMethod * newMethodObject(RexxString *, RexxObject *, RexxObject *, RexxSource *a, bool isBlock=false)
RexxMethod * newScope(RexxClass *)
static RexxObject * nilObject
virtual HashCode getHashValue()
RexxObject * isInstanceOfRexx(RexxClass *)
RexxInteger * requiredInteger(RexxString *kind, size_t, size_t)
RexxString * stringRexx()
RexxString * defaultNameRexx()
stringsize_t requiredPositive(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
RexxMessage * start(RexxObject **, size_t, size_t)
virtual wholenumber_t compareTo(RexxObject *)
RexxString * objectName()
RexxNumberString * numberString()
RexxMessage * startCommon(RexxObject *message, RexxObject **arguments, size_t argCount, size_t named_argCount)
RexxInteger * integerValue(size_t)
RexxVariableDictionary * getObjectVariables(RexxObject *)
RexxObject * requestRexx(RexxString *)
static void decodeMessageName(RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope)
RexxObject * dynamicTargetRexx(RexxObject **arguments, size_t argCount, size_t named_argCount)
RexxObject * sendWith(RexxObject *, RexxArray *, RexxObject **, size_t)
RexxString * concatRexx(RexxObject *)
RexxObject * unknownRexx(RexxString *, RexxArray *, RexxObject **, size_t)
bool requestUnsignedNumber(stringsize_t &, size_t)
static RexxClass * classInstance
stringsize_t requiredNonNegative(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
RexxObject * hasMethodRexx(RexxString *)
RexxMethod * instanceMethodRexx(RexxString *)
RexxObject * unsetMethod(RexxString *)
static void createInstance()
RexxMethod * checkPrivate(RexxMethod *, RexxErrorCodes &)
RexxObject * superScope(RexxObject *)
virtual RexxInteger * hasMethod(RexxString *msg)
RexxObject * strictEqual(RexxObject *)
void guardOn(RexxActivity *activity, RexxObject *scope)
RexxMessage * startWith(RexxObject *, RexxArray *, RexxObject **, size_t)
virtual bool doubleValue(double &result)
RexxInteger * requestInteger(size_t)
RexxObject * setMethod(RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
RexxMethod * methodLookup(RexxString *name)
virtual RexxObject * defMethod(RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
RexxString * makeString()
RexxObject * send(RexxObject **, size_t, size_t)
RexxObject * objectNameEquals(RexxObject *)
void guardOff(RexxActivity *activity, RexxObject *scope)
void processUnknown(RexxErrorCodes, RexxString *, RexxObject **, size_t, size_t, ProtectedObject &)
virtual RexxObject * unknown(RexxString *msg, RexxArray *args, RexxDirectory *named_args)
RexxArray * requestArray()
RexxString * requiredString()
void processProtectedMethod(RexxString *, RexxMethod *, RexxObject **, size_t, size_t, ProtectedObject &)
RexxString * stringValue()
RexxSupplier * instanceMethods(RexxClass *)
void flatten(RexxEnvelope *)
RexxObject * equal(RexxObject *)
void sendMessage(RexxString *, RexxArray *, RexxDirectory *, ProtectedObject &)
RexxMethod * checkPackage(RexxMethod *, RexxErrorCodes &)
void liveGeneral(int reason)
RexxObject * notEqual(RexxObject *other)
bool requestNumber(wholenumber_t &, size_t)
RexxInteger * identityHashRexx()
RexxDirectory * requestDirectory()
RexxMethod * instanceMethod(RexxString *)
bool messageSend(RexxString *, RexxObject **, size_t, size_t, ProtectedObject &, bool processUnknown=true, bool dynamicTarget=true)
void addObjectVariables(RexxVariableDictionary *)
RexxString * requestString()
void copyIntoTail(RexxCompoundTail *buffer)
RexxObject * makeStringRexx()
virtual bool numberValue(wholenumber_t &result, size_t precision)
RexxObject * newRexx(RexxObject **arguments, size_t argCount, size_t named_argCount)
RexxBehaviour * behaviourObject()
RexxObject * defMethods(RexxDirectory *)
bool isEqual(RexxObject *)
virtual RexxString * defaultName()
static PCPPM operatorMethods[]
RexxString * concatBlank(RexxObject *)
virtual bool unsignedNumberValue(stringsize_t &result, size_t precision)
RexxSupplier * instanceMethodsRexx(RexxClass *)
RexxString * requestStringNoNOSTRING()
RexxClass * classObject()
void setObjectVariable(RexxString *, RexxObject *, RexxObject *)
bool isInstanceOf(RexxClass *)
RexxObject * run(RexxObject **, size_t, size_t)
RexxObject * makeArrayRexx()
RexxMethod * superMethod(RexxString *, RexxObject *)
RexxObject * strictNotEqual(RexxObject *other)
RexxObject * getObjectVariable(RexxString *)
virtual bool logicalValue(logical_t &)
void copyObjectVariables(RexxObject *newObject)
wholenumber_t requiredNumber(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
bool numberValue(wholenumber_t &result, size_t precision)
RexxString * concatRexx(RexxObject *)
RexxInteger * strictEqual(RexxObject *)
bool doubleValue(double &result)
const char * getStringData()
RexxInteger * integerValue(size_t precision)
RexxString * concatBlank(RexxObject *)
RexxNumberString * numberString()
virtual bool logicalValue(logical_t &)
RexxString * concatToCstring(const char *)
bool strCompare(const char *s)
bool unsignedNumberValue(uwholenumber_t &result, size_t precision)
void copyIntoTail(RexxCompoundTail *buffer)
RexxObject * stringGet(RexxString *key)
void setNextDictionary(RexxVariableDictionary *next)
RexxObject * realValue(RexxString *name)
bool isScope(RexxObject *otherScope)
void set(RexxString *, RexxObject *)
RexxVariableDictionary * getNextDictionary()
void reserve(RexxActivity *)
void release(RexxActivity *)
bool checkProtectedMethod(RexxObject *target, RexxString *messageName, size_t count, size_t named_count, RexxObject **arguments, ProtectedObject &result)
static int strCaselessCompare(const char *opt1, const char *opt2)