ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

ObjectClass.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* Object REXX Kernel */
40 /* */
41 /* The main REXX object definitions */
42 /* */
43 /******************************************************************************/
44 #include <ctype.h>
45 #include <string.h>
46 #include "RexxCore.h"
47 #include "ObjectClass.hpp"
48 #include "StringClass.hpp"
49 #include "BufferClass.hpp"
50 #include "RexxSmartBuffer.hpp"
51 #include "DirectoryClass.hpp"
53 #include "ArrayClass.hpp"
54 #include "RexxActivity.hpp"
55 #include "RexxActivation.hpp"
56 #include "MessageClass.hpp"
57 #include "MethodClass.hpp"
59 #include "SourceFile.hpp"
60 #include "ProtectedObject.hpp"
61 #include "PointerClass.hpp"
62 
63 
64 // singleton class instance
67 
68 
73 {
74  CLASS_CREATE(Object, "Object", RexxClass);
75 }
76 
77 
78 void RexxObject::live(size_t liveMark)
79 /******************************************************************************/
80 /* Function: Normal garbage collection live marking */
81 /******************************************************************************/
82 {
83  memory_mark(this->objectVariables);
84 }
85 
86 void RexxObject::liveGeneral(int reason)
87 /******************************************************************************/
88 /* Function: Generalized object marking */
89 /******************************************************************************/
90 {
91  memory_mark_general(this->objectVariables);
92 }
93 
95 /******************************************************************************/
96 /* Function: Flatten an object */
97 /******************************************************************************/
98 {
100 
101  flatten_reference(newThis->objectVariables, envelope);
102 
104 }
105 
107 /******************************************************************************/
108 /* Function: Create a proxy object for a "special" REXX object */
109 /******************************************************************************/
110 {
111  if (this == TheNilObject)
112  {
113  return(RexxObject *)new_proxy("NIL");
114  }
115  else
116  {
117  return(RexxObject *)this;
118  }
119 }
120 
122  RexxObject *other ) /* other object for comparison */
123 /******************************************************************************/
124 /* Function: primitive level equality method used by the hash collection */
125 /* classes for determining equality. */
126 /******************************************************************************/
127 {
128  return ((RexxObject *)this) == other;/* simple identity equality */
129 }
130 
132  RexxObject *other ) /* other object for comparison */
133 /******************************************************************************/
134 /* Function: primitive level equality method used by the hash collection */
135 /* classes for determining equality. */
136 /******************************************************************************/
137 {
138  if (this->isBaseClass()) /* not a primitive? */
139  {
140  /* simple identity equality */
141  return ((RexxObject *)this) == other;
142  }
143  else /* return truth value of a compare */
144  {
145  ProtectedObject result;
146  this->sendMessage(OREF_STRICT_EQUAL, other, result);
147  return ((RexxObject *)result)->truthValue(Error_Logical_value_method);
148  }
149 }
150 
151 
159 {
160  return behaviour->isNonPrimitive();
161 }
162 
163 
164 
165 
173 {
174  return behaviour->isPrimitive();
175 }
176 
177 
187 {
188  ProtectedObject result;
189 
190  sendMessage(OREF_COMPARETO, other, result);
191  if ((RexxObject *)result == OREF_NULL)
192  {
194  }
195  wholenumber_t comparison;
196 
197  if (!((RexxObject *)result)->numberValue(comparison))
198  {
200  }
201  return comparison;
202 }
203 
204 
213 {
214  // internal classes always fail this
215  return false;
216 }
217 
218 
227 {
228  return classObject()->isCompatibleWith(other);
229 }
230 
231 
241 {
242  requiredArgument(other, ARG_ONE);
243  return isInstanceOf(other) ? TheTrueObject : TheFalseObject;
244 }
245 
246 
256 {
257  return (RexxMethod *)TheNilObject;
258 }
259 
260 
270 {
271  // the name must be a string...and we use it in upper case
272  method_name = stringArgument(method_name, ARG_ONE)->upper();
273  // retrieve the method from the dictionary
274  RexxMethod *method_object = (RexxMethod *)this->behaviour->getMethodDictionary()->stringGet(method_name);
275  // We return .nil if the method doesn't exist.
276  if (method_object == OREF_NULL)
277  {
278  return (RexxMethod *)TheNilObject;
279  }
280  return method_object; // got a live one
281 }
282 
283 
296 {
297  return OREF_NULL;
298 }
299 
300 
313 {
314  // the behaviour handles all of this
315  return this->behaviour->getMethods(class_object);
316 }
317 
318 
328 {
329  return instanceMethod(method_name);
330 }
331 
332 
345 {
346  return instanceMethods(class_object);
347 }
348 
349 
356 {
357  // get the hash value directly, then turn it into a binary string value
358  HashCode h = getHashValue();
359  /* create a string value */
360  return (RexxObject *)new_string((char *)&h, sizeof(HashCode));
361 }
362 
363 
372 {
373  // if this is a primitive object, we can just return the primitive hash code.
374  if (this->isBaseClass())
375  {
376  return getHashValue();
377  }
378  else
379  {
380  ProtectedObject result;
381  // we have some other type of object, so we need to request a hash code
382  // by sending the HASHCODE() message.
383  this->sendMessage(OREF_HASHCODE, result);
384  return ((RexxObject *)result)->stringValue()->getObjectHashCode();
385  }
386 }
387 
388 
390  RexxObject * other) /* other object for comparison */
391 /******************************************************************************/
392 /* Function: Process the default "==" strict comparison operator */
393 /******************************************************************************/
394 {
395  requiredArgument(other, ARG_ONE); /* must have the other argument */
396  /* this is direct object equality */
397  return (RexxObject *)((this == other)? TheTrueObject: TheFalseObject);
398 }
399 
401 /******************************************************************************/
402 /* Function: Normal "=" type comparison. This only returns true if the */
403 /* two objects are the same object */
404 /******************************************************************************/
405 {
406  requiredArgument(other, ARG_ONE); /* must have the other argument */
407  /* this is direct object equality */
408  return (RexxObject *)((this == other)? TheTrueObject: TheFalseObject);
409 }
410 
412 /******************************************************************************/
413 /* Function: Return the strict inequality of two objects */
414 /******************************************************************************/
415 {
416  requiredArgument(other, ARG_ONE); /* first argument is required */
417  return this != other ? TheTrueObject : TheFalseObject;
418 }
419 
421 /******************************************************************************/
422 /* Function: Return the inequality of two objects */
423 /******************************************************************************/
424 {
425  requiredArgument(other, ARG_ONE); /* first argument is required */
426  return this != other ? TheTrueObject : TheFalseObject;
427 }
428 
438 {
439  return false;
440 }
441 
442 
452 {
453  return REQUEST_STRING(this)->logicalValue(result);
454 }
455 
456 
458  int errorCode ) /* error to issue for bad conversion */
459 /******************************************************************************/
460 /* Function: test the truth value of a primitive object */
461 /******************************************************************************/
462 {
463  /* report the error */
464  reportException(errorCode, OREF_NULLSTRING);
465  return false; /* need a return value */
466 }
467 
469  int errorCode ) /* error to issue for bad conversion */
470 /******************************************************************************/
471 /* Function: test the truth value of a primitive object */
472 /******************************************************************************/
473 {
474  /* just return string truth value */
475  return REQUEST_STRING(this)->truthValue(errorCode);
476 }
477 
479 /******************************************************************************/
480 /* Function: First level primitive copy of an object. This just copies */
481 /* the object storage, and nothing else. */
482 /******************************************************************************/
483 {
484  /* Instead of calling new_object and memcpy, ask the memory object to make */
485  /* a copy of ourself. This way, any header information can be correctly */
486  /* initialized by memory. */
487  return (RexxObject *)this->clone();
488 }
489 
490 void *RexxInternalObject::operator new(size_t size,
491  RexxClass *classObject) /* class of the object */
492 /******************************************************************************/
493 /* Function: Create a new primitive object */
494 /******************************************************************************/
495 {
496  /* get storage for a new object */
497  RexxObject *newObject = (RexxObject *)new_object(size);
498  /* use the class instance behaviour */
499  newObject->setBehaviour(classObject->getInstanceBehaviour());
500  return(void *)newObject; /* and return the new object */
501 }
502 
503 void *RexxInternalObject::operator new(size_t size,
504  RexxClass * classObject, /* class of the object */
505  RexxObject **arguments, /* arguments to the new method */
506  size_t argCount) /* the count of arguments */
507 /******************************************************************************/
508 /* Function: Create a new instance of object (with arguments) */
509 /******************************************************************************/
510 {
511  /* Get storage for a new object */
512  RexxObject *newObject = (RexxObject *)new_object(size);
513  /* use the classes instance behaviour*/
514  newObject->setBehaviour(classObject->getInstanceBehaviour());
515  return newObject; /* and return the object */
516 }
517 
519 /******************************************************************************/
520 /* Function: Copy an object that has an Object Variable Dictionary (OVD) */
521 /******************************************************************************/
522 {
523  /* Instead of calling new_object and memcpy, ask the memory object to make */
524  /* a copy of ourself. This way, any header information can be correctly */
525  /* initialized by memory. */
526  RexxObject *newObj = (RexxObject *)this->clone();
527  /* have object variables? */
528  if (this->objectVariables != OREF_NULL)
529  {
530  ProtectedObject p(newObj);
531  copyObjectVariables(newObj); /* copy the object variables into the new object */
532  }
533  /* have instance methods? */
535  {
536  /* need to copy the behaviour */
537  newObj->setBehaviour((RexxBehaviour *)newObj->behaviour->copy());
538  }
539  return newObj; /* return the copied version */
540 }
541 
543 /******************************************************************************/
544 /* Function: Copy an object's object variable dictionaries into another obj. */
545 /******************************************************************************/
546 {
547  RexxVariableDictionary *dictionary = objectVariables;
548  /* clear out the existing object variable pointer */
549  newObj->objectVariables = OREF_NULL;
550 
551  while (dictionary != OREF_NULL)
552  {
553  /* copy the dictionary */
554  RexxVariableDictionary *newDictionary = (RexxVariableDictionary *)dictionary->copy();
555  /* add this to the variable set */
556  newObj->addObjectVariables(newDictionary);
557  /* now that the dictionary is anchored in the new object, */
558  /* copy the variable objects inside. */
559  newDictionary->copyValues();
560  /* and repeat for each one */
561  dictionary = dictionary->getNextDictionary();
562  }
563 }
564 
566  RexxMethod * method ) /* method to check */
567 /******************************************************************************/
568 /* Function: Check a private method for accessibility. */
569 /******************************************************************************/
570 {
571  /* get the top activation */
573  /* have an activation? */
574  if (activation != OREF_NULL)
575  {
576  RexxObject *sender = activation->getReceiver();/* get the receiving object */
577  if (sender == (RexxObject *)this) /* the same receiver? */
578  {
579  return method; /* just return the same method */
580  }
581  // no sender means this is a routine or program context. Definitely not allowed.
582  if (sender == OREF_NULL)
583  {
584  return OREF_NULL;
585  }
586  // ok, now we check the various scope possibilities
587  RexxClass *scope = method->getScope();
588  // 1) Another instance of the same class that defined the method?
589  if (sender->isInstanceOf(scope) )
590  {
591  return method; // ok, we'll allow this
592  }
593  // if the sender is a class object, check the class for compatibility with the
594  // method scope
595  if (isOfClassType(Class, sender))
596  {
597  // if this class is part of the compatible hierarchy, this is also permitted
598  if (((RexxClass *)sender)->isCompatibleWith(scope))
599  {
600  return method;
601  }
602  }
603  }
604  return OREF_NULL; /* return a failure indicator */
605 }
606 
608 {
609  ProtectedObject r;
610  this->sendMessage(message, args, r);
611  return (RexxObject *)r;
612 }
613 
615 {
616  ProtectedObject r;
617  this->sendMessage(message, r);
618  return (RexxObject *)r;
619 }
620 
621 RexxObject *RexxObject::sendMessage(RexxString *message, RexxObject **args, size_t argCount)
622 {
623  ProtectedObject r;
624  this->sendMessage(message, args, argCount, r);
625  return (RexxObject *)r;
626 }
627 
629 {
630  ProtectedObject r;
631  this->sendMessage(message, argument1, r);
632  return (RexxObject *)r;
633 }
634 
635 
637 {
638  ProtectedObject r;
639  this->sendMessage(message, argument1, argument2, r);
640  return (RexxObject *)r;
641 }
642 
643 
644 RexxObject *RexxObject::sendMessage(RexxString *message, RexxObject *argument1, RexxObject *argument2, RexxObject *argument3)
645 {
646  ProtectedObject r;
647  this->sendMessage(message, argument1, argument2, argument3, r);
648  return (RexxObject *)r;
649 }
650 
651 
652 RexxObject *RexxObject::sendMessage(RexxString *message, RexxObject *argument1, RexxObject *argument2, RexxObject *argument3, RexxObject *argument4)
653 {
654  ProtectedObject r;
655  this->sendMessage(message, argument1, argument2, argument3, argument4, r);
656  return (RexxObject *)r;
657 }
658 
659 
660 RexxObject *RexxObject::sendMessage(RexxString *message, RexxObject *argument1, RexxObject *argument2, RexxObject *argument3, RexxObject *argument4, RexxObject *argument5)
661 {
662  ProtectedObject r;
663  this->sendMessage(message, argument1, argument2, argument3, argument4, argument5, r);
664  return (RexxObject *)r;
665 }
666 
667 
669  RexxString *message, /* name of the message to process */
670  RexxArray *arguments, /* array of arguments */
671  ProtectedObject &result)
672 /******************************************************************************/
673 /* Function: Issue a using a set of arguments already in an array item */
674 /******************************************************************************/
675 {
676  this->messageSend(message, arguments->data(), arguments->size(), result);
677 }
678 
680  RexxString *message, /* name of the message to process */
681  RexxObject *argument1, /* first argument */
682  RexxObject *argument2, /* second argument */
683  ProtectedObject &result)
684 /******************************************************************************/
685 /* Function: Send a message with two arguments */
686 /******************************************************************************/
687 {
688  RexxObject *arguments[2]; /* argument array */
689 
690  arguments[0] = argument1; /* set each argument */
691  arguments[1] = argument2;
692  /* just pass on to message send */
693  this->messageSend(message, arguments, 2, result);
694 }
695 
697  RexxString *message, /* name of the message to process */
698  RexxObject *argument1, /* first argument */
699  RexxObject *argument2, /* second argument */
700  RexxObject *argument3, /* third argument */
701  ProtectedObject &result)
702 /******************************************************************************/
703 /* Function: Send a message with three arguments */
704 /******************************************************************************/
705 {
706  RexxObject *arguments[3]; /* argument array */
707 
708  arguments[0] = argument1; /* set each argument */
709  arguments[1] = argument2;
710  arguments[2] = argument3;
711  /* just pass on to message send */
712  this->messageSend(message, arguments, 3, result);
713 }
714 
716  RexxString *message, /* name of the message to process */
717  RexxObject *argument1, /* first argument */
718  RexxObject *argument2, /* second argument */
719  RexxObject *argument3, /* third argument */
720  RexxObject *argument4, /* fourth argument */
721  ProtectedObject &result)
722 /******************************************************************************/
723 /* Function: Send a message with four arguments */
724 /******************************************************************************/
725 {
726  RexxObject *arguments[4]; /* argument array */
727 
728  arguments[0] = argument1; /* set each argument */
729  arguments[1] = argument2;
730  arguments[2] = argument3;
731  arguments[3] = argument4;
732  /* just pass on to message send */
733  this->messageSend(message, arguments, 4, result);
734 }
735 
737  RexxString *message, /* name of the message to process */
738  RexxObject *argument1, /* first argument */
739  RexxObject *argument2, /* second argument */
740  RexxObject *argument3, /* third argument */
741  RexxObject *argument4, /* fourth argument */
742  RexxObject *argument5, /* fifth argument */
743  ProtectedObject &result)
744 /******************************************************************************/
745 /* Function: Send a message with five arguments */
746 /******************************************************************************/
747 {
748  RexxObject *arguments[5]; /* argument array */
749 
750  arguments[0] = argument1; /* set each argument */
751  arguments[1] = argument2;
752  arguments[2] = argument3;
753  arguments[3] = argument4;
754  arguments[4] = argument5;
755  /* just pass on to message send */
756  this->messageSend(message, arguments, 5, result);
757 }
758 
760  RexxString *msgname, /* name of the message to process */
761  RexxObject **arguments, /* array of arguments */
762  size_t count, /* count of arguments */
763  ProtectedObject &result) // returned result
764 /******************************************************************************/
765 /* Function: send a message (with message lookup) to an object. */
766 /* All types of methods are handled and dispatched */
767 /******************************************************************************/
768 {
769  ActivityManager::currentActivity->checkStackSpace(); /* have enough stack space? */
770  /* grab the method from this level */
771  RexxMethod *method_save = this->behaviour->methodLookup(msgname);
772  /* method exists...special processing*/
773  if (method_save != OREF_NULL && method_save->isSpecial())
774  {
775  if (method_save->isPrivate()) /* actually private method? */
776  {
777  /* go validate a private method */
778  method_save = this->checkPrivate(method_save);
779  }
780  /* now process protected methods */
781  if (method_save != OREF_NULL && method_save->isProtected())
782  {
783  /* really a protected method */
784  this->processProtectedMethod(msgname, method_save, arguments, count, result);
785  return;
786  }
787  }
788  /* have a method */
789  if (method_save != OREF_NULL)
790  {
791  method_save->run(ActivityManager::currentActivity, this, msgname, arguments, count, result);
792  }
793  else
794  {
795  /* go process an unknown method */
796  this->processUnknown(msgname, arguments, count, result);
797  }
798 }
799 
801  RexxString *msgname, /* name of the message to process */
802  RexxObject **arguments, /* array of arguments */
803  size_t count, /* count of arguments */
804  RexxObject *startscope, /* starting superclass scope */
805  ProtectedObject &result) // returned result
806 /******************************************************************************/
807 /* Function: send a message (with message lookup) to an object. */
808 /* All types of methods are handled and dispatched */
809 /******************************************************************************/
810 {
811  ActivityManager::currentActivity->checkStackSpace(); /* have enough stack space? */
812  /* go to the higher level */
813  RexxMethod *method_save = this->superMethod(msgname, startscope);
814  if (method_save != OREF_NULL && method_save->isProtected())
815  {
816  if (method_save->isPrivate()) /* actually private method? */
817  {
818  method_save = this->checkPrivate(method_save);
819  }
820  /* go validate a private method */
821  else /* really a protected method */
822  {
823  this->processProtectedMethod(msgname, method_save, arguments, count, result);
824  return;
825  }
826  }
827  /* have a method */
828  if (method_save != OREF_NULL)
829  {
830  /* run the method */
831  method_save->run(ActivityManager::currentActivity, this, msgname, arguments, count, result);
832  }
833  else
834  {
835  /* go process an unknown method */
836  this->processUnknown(msgname, arguments, count, result);
837  }
838 }
839 
841  RexxString * messageName, /* message to issue */
842  RexxMethod * targetMethod, // the method to run
843  RexxObject ** arguments, /* actual message arguments */
844  size_t count, /* count of arguments */
845  ProtectedObject &result) // returned result
846 /******************************************************************************/
847 /* Function: Process an unknown message, uncluding looking for an UNKNOWN */
848 /* method and raising a NOMETHOD condition */
849 /******************************************************************************/
850 {
851  // get the current security manager
853  // the security manager can replace provide a new result
854  if (manager->checkProtectedMethod(this, messageName, count, arguments, result))
855  {
856  return;
857  }
858  /* run the method */
859  targetMethod->run(ActivityManager::currentActivity, this, messageName, arguments, count, result);
860 }
861 
863  RexxString * messageName, /* message to issue */
864  RexxObject ** arguments, /* actual message arguments */
865  size_t count, /* count of arguments */
866  ProtectedObject &result) // returned result
867 /******************************************************************************/
868 /* Function: Process an unknown message, uncluding looking for an UNKNOWN */
869 /* method and raising a NOMETHOD condition */
870 /******************************************************************************/
871 {
872  /* no method for this msgname */
873  /* find the unknown method */
874  RexxMethod *method_save = this->behaviour->methodLookup(OREF_UNKNOWN);
875  if (method_save == OREF_NULL) /* "unknown" method exists? */
876  /* no unknown method - try to raise */
877  /* a NOMETHOD condition, and if that */
878  {
879  reportNomethod(messageName, this); /* fails, it is an error message */
880  }
881  RexxArray *argumentArray = new_array(count); /* get an array for the arguments */
882  ProtectedObject p(argumentArray);
883 
884  for (size_t i = 1; i <= count; i++) /* copy the arguments into an array */
885  {
886  argumentArray->put(arguments[i - 1], i);
887  }
888 
889  RexxObject *unknown_arguments[2];/* arguments to the unknown method */
890  unknown_arguments[0] = messageName; /* method name is first argument */
891  /* second argument is array of */
892  unknown_arguments[1] = argumentArray;/* arguments for the original call */
893  /* run the unknown method */
894  method_save->run(ActivityManager::currentActivity, this, OREF_UNKNOWN, unknown_arguments, 2, result);
895 }
896 
898  RexxString *msgname) /* name of the target message */
899 /******************************************************************************/
900 /* Function: Return the method object associated with a message name */
901 /******************************************************************************/
902 {
903  return this->behaviour->methodLookup(msgname);
904 }
905 
907 /******************************************************************************/
908 /* Function: Convert a primitive internal object to a long value */
909 /******************************************************************************/
910 {
911  return false; /* give a "safe" default here */
912 }
913 
915 /******************************************************************************/
916 /* Function: Convert a primitive internal object to a long value */
917 /******************************************************************************/
918 {
919  return false; /* give a "safe" default here */
920 }
921 
923 /******************************************************************************/
924 /* Function: Convert a primitive internal object to a long value */
925 /******************************************************************************/
926 {
927  return false; /* give a "safe" default here */
928 }
929 
931 /******************************************************************************/
932 /* Function: Convert a primitive internal object to a long value */
933 /******************************************************************************/
934 {
935  return false; /* give a "safe" default here */
936 }
937 
939 /******************************************************************************/
940 /* Function: Convert a primitive internal object to a double value */
941 /******************************************************************************/
942 {
943  return false; /* give a "safe" default here */
944 }
945 
947  size_t precision) /* precision to use */
948 /******************************************************************************/
949 /* Function: Convert a primitive internal object to an integer value */
950 /******************************************************************************/
951 {
952  return (RexxInteger *)TheNilObject; /* give a "safe" default here */
953 }
954 
956 /******************************************************************************/
957 /* Function: convert an internal object to a numberstring representation */
958 /******************************************************************************/
959 {
960  return OREF_NULL; /* this never converts */
961 }
962 
964 /******************************************************************************/
965 /* Function: Convert a REXX object to a long value */
966 /******************************************************************************/
967 {
968  /* get a string and convert */
969  return REQUEST_STRING(this)->numberValue(result, digits);
970 }
971 
973 /******************************************************************************/
974 /* Function: Convert a REXX object to a long value */
975 /******************************************************************************/
976 {
977  /* get a string and convert */
978  return REQUEST_STRING(this)->numberValue(result);
979 }
980 
982 /******************************************************************************/
983 /* Function: Convert a REXX object to a long value */
984 /******************************************************************************/
985 {
986  /* get a string and convert */
987  return REQUEST_STRING(this)->unsignedNumberValue(result, digits);
988 }
989 
991 /******************************************************************************/
992 /* Function: Convert a REXX object to a long value */
993 /******************************************************************************/
994 {
995  /* get a string and convert */
996  return REQUEST_STRING(this)->unsignedNumberValue(result);
997 }
998 
999 bool RexxObject::doubleValue(double &result)
1000 /******************************************************************************/
1001 /* Function: Convert a primitive internal object to a double value */
1002 /******************************************************************************/
1003 {
1004  /* get a string and convert */
1005  return this->requestString()->doubleValue(result);
1006 }
1007 
1009  size_t precision) /* precision to use */
1010 /******************************************************************************/
1011 /* Function: Convert a primitive internal object to an integer value */
1012 /******************************************************************************/
1013 {
1014  /* get a string and convert */
1015  return REQUEST_STRING(this)->integerValue(precision);
1016 }
1017 
1019 /******************************************************************************/
1020 /* Function: convert a standard object to a numberstring representation */
1021 /******************************************************************************/
1022 {
1023  /* get the string representation, */
1024  /* return the numberstring form */
1025  return this->requestString()->numberString();
1026 }
1027 
1029 /******************************************************************************/
1030 /* Function: Convert a primitive internal object to a string value */
1031 /******************************************************************************/
1032 {
1033  return OREF_NULLSTRING; /* give a "safe" default here */
1034 }
1035 
1037 /******************************************************************************/
1038 /* Function: Convert a primitive object to a string value */
1039 /******************************************************************************/
1040 {
1041  /* issue the object name message */
1042  return (RexxString *)this->sendMessage(OREF_OBJECTNAME);
1043 }
1044 
1046 /******************************************************************************/
1047 /* Function: Handle a string conversion REQUEST for an internal object */
1048 /******************************************************************************/
1049 {
1050  return (RexxString *)TheNilObject; /* should never occur */
1051 }
1052 
1053 
1055 /******************************************************************************/
1056 /* Function: Handle a tail construction request for an internal object */
1057 /******************************************************************************/
1058 {
1059  return; /* should never occur */
1060 }
1061 
1063 /******************************************************************************/
1064 /* Function: Handle a string conversion REQUEST for an internal object */
1065 /******************************************************************************/
1066 {
1067  return (RexxString *)TheNilObject; /* should never occur */
1068 }
1069 
1071 /******************************************************************************/
1072 /* Function: Handle a string conversion REQUEST for a REXX object */
1073 /******************************************************************************/
1074 {
1075  if (this->isBaseClass()) /* primitive object? */
1076  return (RexxString *)TheNilObject; /* this never converts */
1077  else /* process as a string request */
1078  {
1079  return (RexxString *)this->sendMessage(OREF_REQUEST, OREF_STRINGSYM);
1080  }
1081 }
1082 
1083 
1085 /******************************************************************************/
1086 /* Function: Handle a tail construction request for an internal object */
1087 /******************************************************************************/
1088 {
1089  /* get our string value */
1090  RexxString *value = REQUEST_STRING(this);
1091  value->copyIntoTail(tail); /* pass this on to the string value */
1092 }
1093 
1094 
1096 /******************************************************************************/
1097 /* Function: Handle a string conversion REQUEST for a REXX object */
1098 /******************************************************************************/
1099 {
1100  return (RexxString *)TheNilObject; /* this never converts */
1101 }
1102 
1104 /******************************************************************************/
1105 /* Function: Handle an array conversion REQUEST for an internal object */
1106 /******************************************************************************/
1107 {
1108  return (RexxArray *)TheNilObject; /* should never occur */
1109 }
1110 
1112 /******************************************************************************/
1113 /* Function: Handle a string conversion REQUEST for a REXX object */
1114 /******************************************************************************/
1115 {
1116  if (this->isBaseClass()) /* primitive object? */
1117  return (RexxArray *)TheNilObject; /* this never converts */
1118  else /* process as a string request */
1119  {
1120  return (RexxArray *)this->sendMessage(OREF_REQUEST, OREF_ARRAYSYM);
1121  }
1122 }
1123 
1125 /******************************************************************************/
1126 /* Function: Handle a string request for a REXX object. This will go */
1127 /* through the whole search order to do the conversion. */
1128 /******************************************************************************/
1129 {
1130 
1131  /* primitive object? */
1132  if (this->isBaseClass())
1133  {
1134  RexxString *string_value; /* converted object */
1135  /* get the string representation */
1136  string_value = this->primitiveMakeString();
1137  if (string_value == TheNilObject)
1138  {/* didn't convert? */
1139  /* get the final string value */
1140  string_value = this->stringValue();
1141  /* raise a NOSTRING condition */
1142  ActivityManager::currentActivity->raiseCondition(OREF_NOSTRING, OREF_NULL, string_value, this, OREF_NULL);
1143  }
1144  return string_value; /* return the converted form */
1145  }
1146  else
1147  { /* do a real request for this */
1148  ProtectedObject string_value;
1149 
1150  this->sendMessage(OREF_REQUEST, OREF_STRINGSYM, string_value);
1151  // The returned value might be an Integer or NumberString value. We need to
1152  // force this to be a real string value.
1153  string_value = ((RexxObject *)string_value)->primitiveMakeString();
1154  if (string_value == TheNilObject)
1155  {/* didn't convert? */
1156  /* get the final string value */
1157  this->sendMessage(OREF_STRINGSYM, string_value);
1158  // we're really dependent upon the program respecting the protocol
1159  // here and returning a value. It is possible there is a
1160  // problem, so how to handle this. We could just raise an error, but this
1161  // isn't the most ideal message since the error is raised at the
1162  // line where the string value is required, but this is a rare
1163  // situation. As a fallback, use the default object STRING method,
1164  // then raise an error if we still don't get anything. This at least
1165  // keeps the interpreter from crashing, there's a good chance the
1166  // program will run. Frankly, there's something seriously wrong
1167  // if this error ever gets issued.
1168  if (((RexxObject *)string_value) == OREF_NULL)
1169  {
1170  string_value = RexxObject::stringValue();
1171  if (((RexxObject *)string_value) == OREF_NULL)
1172  {
1174  }
1175  }
1176  // The returned value might be an Integer or NumberString value. We need to
1177  // force this to be a real string value.
1178  string_value = ((RexxObject *)string_value)->primitiveMakeString();
1179  /* raise a NOSTRING condition */
1180  ActivityManager::currentActivity->raiseCondition(OREF_NOSTRING, OREF_NULL, (RexxString *)string_value, this, OREF_NULL);
1181  }
1182  return (RexxString *)string_value; /* return the converted form */
1183  }
1184 }
1185 
1187 /******************************************************************************/
1188 /* Function: Handle a string request for a REXX object. This will go */
1189 /* through the whole search order to do the conversion. */
1190 /******************************************************************************/
1191 {
1192 
1193  /* primitive object? */
1194  if (this->isBaseClass())
1195  {
1196  RexxString *string_value; /* converted object */
1197  /* get the string representation */
1198  string_value = this->primitiveMakeString();
1199  if (string_value == TheNilObject)
1200  {/* didn't convert? */
1201  /* get the final string value */
1202  string_value = this->stringValue();
1203  }
1204  return string_value;
1205  }
1206  else
1207  { /* do a real request for this */
1208  ProtectedObject string_value;
1209  this->sendMessage(OREF_REQUEST, OREF_STRINGSYM, string_value);
1210  if (string_value == TheNilObject)
1211  {/* didn't convert? */
1212  /* get the final string value */
1213  this->sendMessage(OREF_STRINGSYM, string_value);
1214  }
1215  return(RexxString *)string_value; /* return the converted form */
1216  }
1217 }
1218 
1219 
1221  size_t position ) /* required argument position */
1222 /******************************************************************************/
1223 /* Function: Handle a string request for a REXX object in a context where */
1224 /* the object MUST have a string value. */
1225 /******************************************************************************/
1226 {
1227  RexxObject *string_value; /* converted object */
1228 
1229  if (this->isBaseClass()) /* primitive object? */
1230  {
1231  string_value = this->makeString(); /* get the string representation */
1232  }
1233  else /* do a full request for this */
1234  {
1235  string_value = this->sendMessage(OREF_REQUEST, OREF_STRINGSYM);
1236  }
1237  /* didn't convert? */
1238  if (string_value == TheNilObject)
1239  {
1240  /* this is an error */
1242  }
1243  return(RexxString *)string_value; /* return the converted form */
1244 }
1245 
1246 
1248  const char *name) /* required argument position */
1249 /******************************************************************************/
1250 /* Function: Handle a string request for a REXX object in a context where */
1251 /* the object MUST have a string value. */
1252 /******************************************************************************/
1253 {
1254  RexxObject *string_value; /* converted object */
1255 
1256  if (this->isBaseClass()) /* primitive object? */
1257  {
1258  string_value = this->makeString(); /* get the string representation */
1259  }
1260  else /* do a full request for this */
1261  {
1262  string_value = this->sendMessage(OREF_REQUEST, OREF_STRINGSYM);
1263  }
1264  /* didn't convert? */
1265  if (string_value == TheNilObject)
1266  {
1267  /* this is an error */
1269  }
1270  return(RexxString *)string_value; /* return the converted form */
1271 }
1272 
1281 {
1282  // primitive object? We have a bypass for this
1283  if (this->isBaseClass())
1284  {
1285  return this->makeString();
1286  }
1287  else
1288  {
1289  // we have to use REQUEST to get this
1290  return (RexxString *)this->sendMessage(OREF_REQUEST, OREF_STRINGSYM);
1291  }
1292 }
1293 
1294 
1296  size_t precision ) /* precision to use */
1297 /******************************************************************************/
1298 /* Function: Request an integer value from an object. If this is not a */
1299 /* primitive object, the object will be converted to a string, */
1300 /* and then the string integer value will be returned. */
1301 /******************************************************************************/
1302 {
1303  if (this->isBaseClass()) /* primitive object? */
1304  {
1305  /* return the integer value */
1306  return this->integerValue(precision);
1307  }
1308  else /* return integer value of string */
1309  {
1310  return this->requestString()->integerValue(precision);
1311  }
1312 }
1313 
1315  size_t position, /* precision to use */
1316  size_t precision) /* argument position for errors */
1317 /******************************************************************************/
1318 /* Function: Request an integer value from an object. If this is not a */
1319 /* primitive object, a REQUEST('STRING') will be performeding, */
1320 /* and then the string integer value will be returned. */
1321 /******************************************************************************/
1322 {
1323  RexxInteger *result; /* returned result */
1324 
1325  if (this->isBaseClass()) /* primitive object? */
1326  {
1327  /* return the integer value */
1328  result = this->integerValue(precision);
1329  }
1330  else /* return integer value of string */
1331  {
1332  result = this->requiredString(position)->integerValue(precision);
1333  }
1334  /* didn't convert well? */
1335  if (result == (RexxInteger *)TheNilObject)
1336  {
1337  /* raise an error */
1339  }
1340  return result; /* return the new integer */
1341 }
1342 
1343 
1352 bool RexxObject::requestNumber(wholenumber_t &result, size_t precision)
1353 {
1354  if (isBaseClass())
1355  {
1356  // are we already a base class?
1357  // the base classes can handle this directly.
1358  return numberValue(result, precision);
1359  }
1360  else
1361  {
1362  // we need to perform the operation on the string value
1363  return numberValue(result, precision);
1364  }
1365 }
1366 
1367 
1376 bool RexxObject::requestUnsignedNumber(stringsize_t &result, size_t precision)
1377 {
1378  if (isBaseClass())
1379  {
1380  // are we already a base class?
1381  // the base classes can handle this directly.
1382  return unsignedNumberValue(result, precision);
1383  }
1384  else
1385  {
1386  // we need to perform the operation on the string value
1387  return unsignedNumberValue(result, precision);
1388  }
1389 }
1390 
1391 
1393  size_t position , /* precision to use */
1394  size_t precision) /* argument position for errors */
1395 /******************************************************************************/
1396 /* Function: Request a long value from an object. If this is not a */
1397 /* primitive object, a REQUEST('STRING') will be performed */
1398 /* and then the string long value will be returned. */
1399 /******************************************************************************/
1400 {
1401  wholenumber_t result; /* returned result */
1402 
1403  /* primitive object? */
1404  if (this->isBaseClass() && !isOfClass(Object, this))
1405  {
1406  if (!numberValue(result, precision))
1407  {
1408  /* raise an error */
1410  }
1411  }
1412  else /* return integer value of string */
1413  {
1414  if (!requiredString(position)->numberValue(result, precision))
1415  {
1416  /* raise an error */
1418  }
1419  }
1420  return result; /* return the result */
1421 }
1422 
1424  size_t position, /* precision to use */
1425  size_t precision) /* argument position for errors */
1426 /******************************************************************************/
1427 /* Function: Request a a positive long value from an object. If this is not */
1428 /* positive, it will raise an error. */
1429 /******************************************************************************/
1430 {
1431  stringsize_t result; /* returned result */
1432 
1433  if (!unsignedNumberValue(result, precision) || result == 0)
1434  {
1435  /* raise the error */
1437  }
1438  return result;
1439 }
1440 
1441 
1443  size_t position , /* precision to use */
1444  size_t precision) /* argument position for errors */
1445 /******************************************************************************/
1446 /* Function: Request a non-negative long value from an object. If this is */
1447 /* less than zero, it will raise an error */
1448 /******************************************************************************/
1449 {
1450  stringsize_t result; /* returned result */
1451 
1452  if (!unsignedNumberValue(result, precision))
1453  {
1454  /* raise the error */
1456  }
1457  return result;
1458 }
1459 
1460 
1462 /******************************************************************************/
1463 /* Function: Request an array value from an object. */
1464 /******************************************************************************/
1465 {
1466  if (this->isBaseClass()) /* primitive object? */
1467  {
1468  if (isOfClass(Array, this)) /* already an array? */
1469  return (RexxArray *)this; /* return directly, don't makearray */
1470  else
1471  return this->makeArray(); /* return the array value */
1472  }
1473  else /* return integer value of string */
1474  {
1475  return (RexxArray *)this->sendMessage(OREF_REQUEST, OREF_ARRAYSYM);
1476  }
1477 }
1478 
1480 /******************************************************************************/
1481 /* Function: Retrieve the object name for a primitive object */
1482 /******************************************************************************/
1483 {
1484  ProtectedObject string_value; /* returned string value */
1485 
1486  RexxObject *scope = lastMethod()->getScope(); /* get the method's scope */
1487  /* get the object name variable */
1488  string_value = (RexxString *)this->getObjectVariable(OREF_NAME, scope);
1489  if ((RexxObject *)string_value == OREF_NULL)
1490  { /* no name? */
1491  if (this->isBaseClass()) /* primitive object? */
1492  {
1493  /* use fast path to default name */
1494  string_value = this->defaultName();
1495  }
1496  else /* go through the full search */
1497  {
1498  this->sendMessage(OREF_DEFAULTNAME, string_value);
1499  }
1500  }
1501  return(RexxString *)string_value; /* return the string value */
1502 }
1503 
1505 /******************************************************************************/
1506 /* Function: retrieve an objects default name value */
1507 /******************************************************************************/
1508 {
1509  RexxObject *scope; /* scope of the object */
1510 
1511  requiredArgument(name, ARG_ONE); /* must have a name */
1512  scope = lastMethod()->getScope(); /* get the method's scope */
1513  /* get this as a string */
1514  name = (RexxObject *)stringArgument(name, ARG_ONE);
1515  /* set the name */
1516  this->setObjectVariable(OREF_NAME, name, scope);
1517  return OREF_NULL; /* no return value */
1518 }
1519 
1521 /******************************************************************************/
1522 /* Function: Handle "final" string coercion level */
1523 /******************************************************************************/
1524 {
1525  /* use the class id as the default */
1526  /* name */
1527  RexxString *defaultname = this->behaviour->getOwningClass()->getId();
1528  /* check if it is from an enhanced */
1529  if (this->behaviour->isEnhanced())
1530  { /* class */
1531  /* return the 'enhanced' id */
1532  return defaultname->concatToCstring("enhanced ");
1533  }
1534  switch (defaultname->getChar(0))
1535  { /* process based on first character*/
1536  case 'a': /* vowels */
1537  case 'A':
1538  case 'e':
1539  case 'E':
1540  case 'i':
1541  case 'I':
1542  case 'o':
1543  case 'O':
1544  case 'u':
1545  case 'U':
1546  /* prefix with "an" */
1547  defaultname = defaultname->concatToCstring("an ");
1548  break;
1549 
1550  default: /* consonants */
1551  /* prefix with "a" */
1552  defaultname = defaultname->concatToCstring("a ");
1553  break;
1554  }
1555  return defaultname; /* return that value */
1556 }
1557 
1559 /******************************************************************************/
1560 /* Function: Check for the presense of a method on the object */
1561 /******************************************************************************/
1562 {
1563  /* check the behaviour for the method*/
1564  return (this->behaviour->methodLookup(msgname) != OREF_NULL) ? TheTrueObject : TheFalseObject;
1565 }
1566 
1568 /******************************************************************************/
1569 /* Function: Return the class object associated with an object */
1570 /******************************************************************************/
1571 {
1572  /* just return class from behaviour */
1573  return this->behaviour->getOwningClass();
1574 }
1575 
1577  RexxString *msgname, /* name of the new method */
1578  RexxMethod *methobj, /* associated method object/code */
1579  RexxString *option)
1580 /******************************************************************************/
1581 /* Function: Add a new method to an object instance */
1582 /******************************************************************************/
1583 {
1584  /* get the message name as a string */
1585  msgname = stringArgument(msgname, ARG_ONE)->upper();
1586  if (option)
1587  {
1588  option = stringArgument(option, ARG_THREE);
1589  if (!Utilities::strCaselessCompare("OBJECT",option->getStringData()))
1590  {
1591  // do nothing if OBJECT
1592  }
1593  else if (!Utilities::strCaselessCompare("FLOAT",option->getStringData()))
1594  {
1595  // "FLOAT" makes option a NULL pointer, causing the old default behaviour on setMethod...
1596  option = OREF_NULL;
1597  }
1598  else
1599  {
1600  reportException(Error_Incorrect_call_list, CHAR_SETMETHOD, IntegerThree, "\"FLOAT\", \"OBJECT\"", option);
1601  }
1602  }
1603 
1604  if (methobj == OREF_NULL) /* we weren't passed a method, */
1605  {
1606  /* add a dummy method */
1607  methobj = (RexxMethod *)TheNilObject;
1608  }
1609  else if (!isOfClass(Method, methobj)) /* not a method type already? */
1610  {
1611  /* make one from a string or array */
1612  methobj = RexxMethod::newMethodObject(msgname, (RexxObject *)methobj, IntegerTwo, OREF_NULL);
1613  }
1614  this->defMethod(msgname, methobj, option); /* defMethod handles all the details */
1615  return OREF_NULL; /* no return value */
1616 }
1617 
1619  RexxString *msgname) /* target message name */
1620 /******************************************************************************/
1621 /* Function: Remove a method from an object instance */
1622 /******************************************************************************/
1623 {
1624  /* get the message name as a string */
1625  msgname = stringArgument(msgname, ARG_ONE)->upper();
1626  /* now just go remove this */
1627  this->behaviour->removeMethod(msgname);
1628  return OREF_NULL; /* no return value */
1629 }
1630 
1632  RexxString *className) /* target name of the class */
1633 /******************************************************************************/
1634 /* Function: Externalized version of the REQUEST method. This tries to */
1635 /* convert one class of object into another. */
1636 /******************************************************************************/
1637 {
1638  /* Verify we have a string parm */
1639  className = stringArgument(className, ARG_ONE)->upper();
1640  RexxString *class_id = this->id()->upper(); /* get the class name in uppercase */
1641  /* of the same class? */
1642  if (className->strictEqual(class_id) == TheTrueObject)
1643  {
1644  return this; /* already converted */
1645  }
1646  /* Get "MAKE"||class methodname */
1647  RexxString *make_method = className->concatToCstring(CHAR_MAKE);
1648  /* find the MAKExxxx method */
1649  RexxMethod *method = this->behaviour->methodLookup(make_method);
1650  /* have this method? */
1651  if (method != OREF_NULL)
1652  {
1653  /* Return its results */
1654  return this->sendMessage(make_method);
1655  }
1656  else /* No makeclass method */
1657  {
1658  return TheNilObject; /* Let user handle it */
1659  }
1660 }
1661 
1662 
1673 {
1674  RexxString *messageName;
1675  RexxObject *startScope;
1676  // decode and validate the message input
1677  decodeMessageName(this, message, messageName, startScope);
1678  arguments = arrayArgument(arguments, ARG_TWO);
1679 
1680  ProtectedObject r;
1681  if (startScope == OREF_NULL)
1682  {
1683  this->messageSend(messageName, arguments->data(), arguments->size(), r);
1684  }
1685  else
1686  {
1687  this->messageSend(messageName, arguments->data(), arguments->size(), startScope, r);
1688  }
1689  return (RexxObject *)r;
1690 }
1691 
1692 
1705 RexxObject *RexxObject::send(RexxObject **arguments, size_t argCount)
1706 {
1707  if (argCount < 1 ) /* no arguments? */
1708  {
1709  missingArgument(ARG_ONE); /* Yes, this is an error. */
1710  }
1711 
1712  RexxString *messageName;
1713  RexxObject *startScope;
1714  // decode and validate the message input
1715  decodeMessageName(this, arguments[0], messageName, startScope);
1716 
1717  ProtectedObject r;
1718  if (startScope == OREF_NULL)
1719  {
1720  this->messageSend(messageName, arguments + 1, argCount - 1, r);
1721  }
1722  else
1723  {
1724  this->messageSend(messageName, arguments + 1, argCount - 1, startScope, r);
1725  }
1726  return (RexxObject *)r;
1727 }
1728 
1729 
1741 {
1742  // the message is required
1743  requiredArgument(message, ARG_ONE);
1744  // this is required and must be an array
1745  arguments = arrayArgument(arguments, ARG_TWO);
1746  // the rest is handled by code common to startWith();
1747  return startCommon(message, arguments->data(), arguments->size());
1748 }
1749 
1750 
1761 RexxMessage *RexxObject::start(RexxObject **arguments, size_t argCount)
1762 {
1763  if (argCount < 1 ) /* no arguments? */
1764  {
1765  missingArgument(ARG_ONE); /* Yes, this is an error. */
1766  }
1767  /* Get the message name. */
1768  RexxObject *message = arguments[0]; /* get the message . */
1769  /* Did we receive a message name */
1770  requiredArgument(message, ARG_ONE);
1771  // the rest is handled by code common to startWith();
1772  return startCommon(message, arguments + 1, argCount - 1);
1773 }
1774 
1775 
1786 RexxMessage *RexxObject::startCommon(RexxObject *message, RexxObject **arguments, size_t argCount)
1787 {
1788  RexxString *messageName;
1789  RexxObject *startScope;
1790  // decode and validate the message input
1791  decodeMessageName(this, message, messageName, startScope);
1792 
1793  /* Create the new message object. */
1794  RexxMessage *newMessage = new RexxMessage(this, messageName, startScope, new (argCount, arguments) RexxArray);
1795  ProtectedObject p(newMessage);
1796  newMessage->start(OREF_NULL); /* Tell the message object to start */
1797  return newMessage; /* return the new message object */
1798 }
1799 
1800 
1811 void RexxObject::decodeMessageName(RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope)
1812 {
1813  // clear the starting scope
1814  startScope = OREF_NULL;
1815 
1816  /* if 1st arg is a string, we can do */
1817  /* this quickly */
1818  if (!isOfClass(String, message))
1819  {
1820  // this must be an array
1821  RexxArray *messageArray = arrayArgument(message, ARG_ONE);
1822 
1823  // must be single dimension with two arguments
1824  if (messageArray->getDimension() != 1 || messageArray->size() != 2)
1825  {
1826  /* raise an error */
1828  }
1829  // get the message as a string in uppercase.
1830  messageName = stringArgument(messageArray->get(1), ARG_ONE)->upper();
1831  startScope = messageArray->get(2);
1832  requiredArgument(startScope, ARG_TWO);
1833 
1834  // validate the message creator now
1836  /* have an activation? */
1837  if (activation != OREF_NULL)
1838  {
1839  /* get the receiving object */
1840  RexxObject *sender = activation->getReceiver();
1841  if (sender != target) /* not the same receiver? */
1842  {
1843  /* this is an error */
1845  }
1846  }
1847  else
1848  {
1849  /* this is an error */
1851  }
1852  }
1853  else /* not an array as message. */
1854  {
1855  /* force to a string value */
1856  messageName = stringArgument(message, ARG_ONE)->upper();
1857  }
1858 }
1859 
1860 
1862 /****************************************************************************/
1863 /* Function: Return the objects address as a HEX string (debugging only) */
1864 /****************************************************************************/
1865 {
1866  char buffer[20]; /* buffered address */
1867 
1868  sprintf(buffer, "%p", this); /* format this */
1869  /* and return a string */
1870  return(RexxString *)new_string(buffer,8);
1871 }
1872 
1874 /****************************************************************************/
1875 /* Function: Tag an object as having an UNINIT method */
1876 /****************************************************************************/
1877 {
1878  /* tell the activity about this */
1880 }
1881 
1882 
1884  RexxObject **arguments, /* method arguments */
1885  size_t argCount) /* the number of arguments */
1886 /****************************************************************************/
1887 /* Function: Run a method on an object as if it was part of the object's */
1888 /* behaviour. */
1889 /****************************************************************************/
1890 {
1891  RexxArray *arglist = OREF_NULL; /* forwarded option string */
1892  RexxObject **argumentPtr = NULL; /* default to no arguments passed along */
1893  size_t argcount = 0;
1894 
1895  /* get the method object */
1896  RexxMethod *methobj = (RexxMethod *)arguments[0];
1897  requiredArgument(methobj, ARG_ONE); /* make sure we have a method */
1898  if (!isOfClass(Method, methobj)) /* this a method object? */
1899  {
1900  /* create a method object */
1901  methobj = RexxMethod::newMethodObject(OREF_RUN, (RexxObject *)methobj, IntegerOne, OREF_NULL);
1902  /* set the correct scope */
1903  methobj->setScope((RexxClass *)TheNilObject);
1904  }
1905  else
1906  {
1907  /* ensure correct scope on method */
1908  methobj = methobj->newScope((RexxClass *)TheNilObject);
1909  }
1910  // we need to save this, since we might be working off of a newly created
1911  // one or a copy
1912  ProtectedObject p(methobj);
1913 
1914  if (argCount > 1) /* if any arguments passed */
1915  {
1916  /* get the 1st one, its the option */
1917  RexxString *option = (RexxString *)arguments[1];
1918  /* this is now required */
1919  option = stringArgument(option, ARG_TWO);
1920  /* process the different options */
1921  switch (toupper(option->getChar(0)))
1922  {
1923  case 'A': /* args are an array */
1924  {
1925  /* so they say, make sure we have an */
1926  /* array and we were only passed 3 */
1927  /*args */
1928  if (argCount < 3) /* not enough arguments? */
1929  {
1930  missingArgument(ARG_THREE); /* this is an error */
1931  }
1932  if (argCount > 3) /* too many arguments? */
1933  {
1935  }
1936  /* now get the array */
1937  arglist = (RexxArray *)arguments[2];
1938  /* force to array form */
1939  arglist = REQUEST_ARRAY(arglist);
1940  /* not an array? */
1941  if (arglist == TheNilObject || arglist->getDimension() != 1)
1942  {
1943  /* raise an error */
1945  }
1946  // request array may create a new one...keep it safe
1947  ProtectedObject p1(arglist);
1948  /* grab the argument information */
1949  argumentPtr = arglist->data();
1950  argcount = arglist->size();
1951  break;
1952  }
1953 
1954  case 'I': /* args are "strung out" */
1955  /* point to the array data for the second value */
1956  argumentPtr = arguments + 2;
1957  argcount = argCount - 2;
1958  break;
1959 
1960  default:
1961  /* invalid option */
1963  break;
1964  }
1965  }
1966  ProtectedObject result;
1967  /* now just run the method.... */
1968  methobj->run(ActivityManager::currentActivity, this, OREF_NONE, argumentPtr, argcount, result);
1969  return (RexxObject *)result;
1970 }
1971 
1973  RexxDirectory *methods) /* new table of methods */
1974 /****************************************************************************/
1975 /* Function: Add a table of methods to an object's behaviour */
1976 /****************************************************************************/
1977 {
1978  /* make a copy of the behaviour */
1979  OrefSet(this, this->behaviour, (RexxBehaviour *)this->behaviour->copy());
1980  /* loop through the list of methods */
1981  for (HashLink i = methods->first(); methods->available(i); i = methods->next(i))
1982  {
1983  /* Get the methjod Object */
1984  RexxMethod *method = (RexxMethod *)methods->value(i);
1985  if (method != TheNilObject) /* not a removal? */
1986  {
1987  /* set a new scope on this */
1988  method = method->newScope((RexxClass *)this);
1989  }
1990  else
1991  {
1992  method = OREF_NULL; // this is a method removal
1993  }
1994  /* Get the name for this method */
1995  RexxString *name = (RexxString *)methods->index(i);
1996  name = name->upper(); /* make sure the name is upperCase. */
1997  /* add this method to the object's */
1998  /* behaviour */
1999  this->behaviour->define(name, method);
2000  }
2001  return OREF_NULL;
2002 }
2003 
2005  RexxString *msgname, /* new method name */
2006  RexxMethod *methobj, /* associated method object */
2007  RexxString *option)
2008 /****************************************************************************/
2009 /* Function: Add a method to an object's behaviour */
2010 /****************************************************************************/
2011 {
2012  RexxMethod *methcopy; /* copy of the original method */
2013  /* default scope "FLOAT" */
2014  RexxClass *targetClass = (RexxClass*) TheNilObject;
2015 
2016  msgname = msgname->upper(); /* add this as an uppercase name */
2017  if (methobj != TheNilObject) /* not a removal? */
2018  {
2019  /* got an option? */
2020  if (option)
2021  {
2022  if (!Utilities::strCaselessCompare("OBJECT",option->getStringData()))
2023  {
2024  targetClass = this->behaviour->getOwningClass();
2025  }
2026  else
2027  {
2028  reportException(Error_Incorrect_call_list, CHAR_SETMETHOD, IntegerThree, "\"FLOAT\", \"OBJECT\"", option);
2029  }
2030  }
2031  /* set a new scope on this */
2032  methcopy = methobj->newScope(targetClass);
2033  }
2034  else
2035  {
2036  /* no real method added */
2037  methcopy = (RexxMethod *)TheNilObject;
2038  }
2039  /* is this the first added method? */
2041  {
2042 
2043 /* copy primitive behaviour object and define the method, a copy is made to */
2044 /* ensure that we don't update the behaviour of any other object, since they*/
2045 /* may have been sharing the mvd. */
2046  OrefSet(this, this->behaviour, (RexxBehaviour *)this->behaviour->copy());
2047  }
2048  /* now add this to the behaviour */
2049  this->behaviour->addMethod(msgname, methcopy);
2050  /* adding an UNINIT method to obj? */
2051  if (methobj != TheNilObject && msgname->strCompare(CHAR_UNINIT))
2052  {
2053  this->hasUninit(); /* yes, mark it as such */
2054  }
2055  return OREF_NULL;
2056 }
2057 
2059 /******************************************************************************/
2060 /* Function: Return the object's primitive type number */
2061 /******************************************************************************/
2062 {
2063  return this->behaviour->getClassType();
2064 }
2065 
2067 /******************************************************************************/
2068 /* Function: Remove an UNINIT method from an object */
2069 /******************************************************************************/
2070 {
2072 }
2073 
2084 {
2085  RexxVariableDictionary *dictionary = objectVariables;
2086  while (dictionary != OREF_NULL)
2087  {
2088  // see if this dictionary has the variable
2089  RexxObject *val = dictionary->realValue(name);
2090  // return this if it exists
2091  if (val != OREF_NULL)
2092  {
2093  return val;
2094  }
2095  // step to the next dictionary in the chain
2096  dictionary = dictionary->getNextDictionary();
2097  }
2098  return OREF_NULL; // no variable found
2099 }
2100 
2101 
2103  RexxString * name, /* variable name (name object) */
2104  RexxObject * scope) /* target variable scope */
2105 /******************************************************************************/
2106 /* Function: retrieve the value of an object variable. This name */
2107 /* must be a name object, and only simple variables are supported.*/
2108 /* If the variable has not been assigned a value, then OREF_NULL */
2109 /* is returned. */
2110 /******************************************************************************/
2111 {
2112  if (OREF_NULL == scope) /* were we passed a scope for lookup */
2113  {
2114  scope = this; /* no, we use our own. */
2115  }
2116  /* get the ovd for our scope level */
2117  RexxVariableDictionary *ovd = this->getObjectVariables(scope);
2118  return ovd->realValue(name); /* get the real variable value */
2119 }
2120 
2122  RexxString *name, /* variable name (name object) */
2123  RexxObject *value, /* new variable value */
2124  RexxObject *scope) /* target variable scope */
2125 /******************************************************************************/
2126 /* Function: assign a new value to a object variable. This name */
2127 /* must be a name object, and only simple variables are supported.*/
2128 /******************************************************************************/
2129 {
2130  if (OREF_NULL == scope) /* were we passed a scope for lookup */
2131  {
2132  scope = this; /* no, we use our own. */
2133  }
2134  /* get the ovd for our scope level */
2135  RexxVariableDictionary *ovd = this->getObjectVariables(scope);
2136  ovd->set(name, value); /* do the variable assignment */
2137 }
2138 
2140  RexxVariableDictionary *dictionary)/* new variable set */
2141 /******************************************************************************/
2142 /* Function: Add a new variable dictionary to an object with a given scope */
2143 /******************************************************************************/
2144 {
2145  /* chain any existing dictionaries off of the new one */
2146  dictionary->setNextDictionary(objectVariables);
2147  /* make this the new head of the chain */
2148  OrefSet(this, objectVariables, dictionary);
2149 }
2150 
2152  RexxObject *startScope) /* target scope */
2153 /******************************************************************************/
2154 /* Function: Find the scope of a method's super class */
2155 /******************************************************************************/
2156 {
2157  return this->behaviour->superScope(startScope);
2158 }
2159 
2161  RexxString *msgName, /* target message name */
2162  RexxObject *startScope) /* starting lookup scope */
2163 /******************************************************************************/
2164 /* Function: Find a method using the given starting scope information */
2165 /******************************************************************************/
2166 {
2167  return this->behaviour->superMethod(msgName, startScope);
2168 }
2169 
2171  RexxObject *scope) /* required dictionary scope */
2172 /******************************************************************************/
2173 /* Function: Retrieve an object dictionary for a given scope */
2174 /******************************************************************************/
2175 {
2176  RexxVariableDictionary *dictionary = objectVariables; /* get the head of the chain */
2177  while (dictionary != OREF_NULL)
2178  { /* search for a scope match */
2179  /* if we've found a match, return it */
2180  if (dictionary->isScope(scope))
2181  {
2182  return dictionary;
2183  }
2184  dictionary = dictionary->getNextDictionary();
2185  }
2186 
2187  /* just create a new vdict */
2188  dictionary = new_objectVariableDictionary(scope);
2189  /* chain any existing dictionaries off of the new one */
2190  dictionary->setNextDictionary(objectVariables);
2191  /* make this the new head of the chain */
2192  OrefSet(this, objectVariables, dictionary);
2193  this->setHasReferences(); /* we now have references */
2194  return dictionary; /* return the correct ovd */
2195 }
2196 
2204 {
2206  vdict->reserve(activity);
2207 }
2208 
2209 
2217 {
2219  vdict->release(activity);
2220 }
2221 
2222 
2223 
2224 const char *RexxObject::idString(void)
2225 /******************************************************************************/
2226 /* Function: Return a pointer to the object's string value */
2227 /******************************************************************************/
2228 {
2229  RexxString *classId = this->id(); /* get the id string */
2230  if (classId == OREF_NULL) /* internal class? */
2231  {
2232  return "unknown Class"; /* return an unknown identifier */
2233  }
2234  else
2235  {
2236  return classId->getStringData(); /* return the actual class ID */
2237  }
2238 }
2239 
2241 /******************************************************************************/
2242 /* Function: Get the class string name */
2243 /******************************************************************************/
2244 {
2245  /* get the class */
2246  RexxClass *createClass = this->behaviourObject()->getOwningClass();
2247  if (createClass == OREF_NULL) /* no class object? */
2248  {
2249  return OREF_NULL; /* return nothing */
2250  }
2251  else
2252  {
2253  return createClass->getId(); /* return the class id string */
2254  }
2255 }
2256 
2258 /******************************************************************************/
2259 /* Function: Exported Object INIT method */
2260 /******************************************************************************/
2261 {
2262  return OREF_NULL; /* this is basically a no-op */
2263 }
2264 
2265 
2274 {
2275  return new_integer(this->identityHash());
2276 }
2277 
2278 
2280 /******************************************************************************/
2281 /* Function: Exported Object INIT method */
2282 /******************************************************************************/
2283 {
2284  if (TheTrueObject == this->hasMethod(OREF_UNINIT))
2285  {
2286  this->sendMessage(OREF_UNINIT);
2287  }
2288 
2289 }
2290 
2292 /******************************************************************************/
2293 /* Function: Check to see if an object has an UNINIT method. */
2294 /******************************************************************************/
2295 {
2296  return TheTrueObject == this->hasMethod(OREF_UNINIT);
2297 }
2298 
2299 RexxObject *RexxObject::newRexx(RexxObject **arguments, size_t argCount)
2300 /******************************************************************************/
2301 /* Function: Exposed REXX NEW method */
2302 /******************************************************************************/
2303 {
2304  return new ((RexxClass *)this, arguments, argCount) RexxObject;
2305 }
2306 
2307 
2309 /******************************************************************************/
2310 /* Arguments: Clone an object, and set up its header. This method should */
2311 /* be called by other _copy methods instead of using new_object */
2312 /* and memcpy, so that memory can properly initialize the new */
2313 /* object's header to avoid early gc. */
2314 /* */
2315 /* Returned: A new object copied from objr, but set to be live to avoid */
2316 /* being garbage collected on a pending sweep. */
2317 /******************************************************************************/
2318 {
2319  // we need an identically sized object
2320  size_t size = getObjectSize();
2321  RexxObject *cloneObj = new_object(size);
2322  // copy the object header. That's the only piece of this we're not going to keep from
2323  // the old object.
2324  ObjectHeader newHeader = cloneObj->header;
2325  // copy everything but the object header over from the source object.
2326  memcpy((char *)cloneObj, (char *)this, size);
2327  // restore the new header to the cloned object
2328  cloneObj->header = newHeader;
2329  return cloneObj;
2330 }
2331 
2332 #undef operatorMethod
2333 #define operatorMethod(name, message) RexxObject * RexxObject::name(RexxObject *operand) \
2334 {\
2335  ProtectedObject result; /* returned result */\
2336  /* do a real message send */\
2337  this->messageSend(OREF_##message, &operand, 1, result); \
2338  if ((RexxObject *)result == OREF_NULL) /* in an expression and need a result*/ \
2339  { \
2340  /* need to raise an exception */ \
2341  reportException(Error_No_result_object_message, OREF_##message); \
2342  } \
2343  return (RexxObject *)result; /* return the final result */ \
2344 }\
2345 
2346 
2347 #undef prefixOperatorMethod
2348 #define prefixOperatorMethod(name, message) RexxObject * RexxObject::name(RexxObject *operand) \
2349 {\
2350  ProtectedObject result; /* returned result */\
2351  /* do a real message send */\
2352  this->messageSend(OREF_##message, &operand, operand == OREF_NULL ? 0 : 1, result); \
2353  if ((RexxObject *)result == OREF_NULL) /* in an expression and need a result*/ \
2354  { \
2355  /* need to raise an exception */ \
2356  reportException(Error_No_result_object_message, OREF_##message); \
2357  } \
2358  return (RexxObject *)result; /* return the final result */ \
2359 }\
2360 
2361 
2362 prefixOperatorMethod(operator_plus , PLUS)
2363 prefixOperatorMethod(operator_minus , SUBTRACT)
2364 operatorMethod(operator_multiply , MULTIPLY)
2365 operatorMethod(operator_divide , DIVIDE)
2366 operatorMethod(operator_integerDivide , INTDIV)
2367 operatorMethod(operator_remainder , REMAINDER)
2368 operatorMethod(operator_power , POWER)
2369 operatorMethod(operator_abuttal , NULLSTRING)
2370 operatorMethod(operator_concat , CONCATENATE)
2371 operatorMethod(operator_concatBlank , BLANK)
2372 operatorMethod(operator_equal , EQUAL)
2373 operatorMethod(operator_notEqual , BACKSLASH_EQUAL)
2374 operatorMethod(operator_isGreaterThan , GREATERTHAN)
2375 operatorMethod(operator_isBackslashGreaterThan , BACKSLASH_GREATERTHAN)
2376 operatorMethod(operator_isLessThan , LESSTHAN)
2377 operatorMethod(operator_isBackslashLessThan , BACKSLASH_LESSTHAN)
2378 operatorMethod(operator_isGreaterOrEqual , GREATERTHAN_EQUAL)
2379 operatorMethod(operator_isLessOrEqual , LESSTHAN_EQUAL)
2380 operatorMethod(operator_strictEqual , STRICT_EQUAL)
2381 operatorMethod(operator_strictNotEqual , STRICT_BACKSLASH_EQUAL)
2382 operatorMethod(operator_strictGreaterThan , STRICT_GREATERTHAN)
2383 operatorMethod(operator_strictBackslashGreaterThan, STRICT_BACKSLASH_GREATERTHAN)
2384 operatorMethod(operator_strictLessThan , STRICT_LESSTHAN)
2385 operatorMethod(operator_strictBackslashLessThan , STRICT_BACKSLASH_LESSTHAN)
2386 operatorMethod(operator_strictGreaterOrEqual , STRICT_GREATERTHAN_EQUAL)
2387 operatorMethod(operator_strictLessOrEqual , STRICT_LESSTHAN_EQUAL)
2388 operatorMethod(operator_lessThanGreaterThan , LESSTHAN_GREATERTHAN)
2389 operatorMethod(operator_greaterThanLessThan , GREATERTHAN_LESSTHAN)
2390 operatorMethod(operator_and , AND)
2391 operatorMethod(operator_or , OR)
2392 operatorMethod(operator_xor , XOR)
2393 prefixOperatorMethod(operator_not , BACKSLASH)
2394 
2395 void *RexxObject::operator new(size_t size, RexxClass *classObject)
2396 /******************************************************************************/
2397 /* Function: Create a new translator object */
2398 /******************************************************************************/
2399 {
2400  /* get storage for new object */
2401  RexxObject *newObject = (RexxObject *)new_object(size);
2402  // the virtual function table is still object, but the behaviour is whatever
2403  // the class object defines.
2404  newObject->setBehaviour(classObject->getInstanceBehaviour());
2405  // the hash value and nulled object table was handled by new_object();
2406 
2407  if (classObject->hasUninitDefined() || classObject->parentHasUninitDefined())
2408  { /* or parent has one */
2409  newObject->hasUninit();
2410  }
2411 
2412  return(void *)newObject; /* Initialize the new object */
2413 }
2414 
2415 
2416 void *RexxObject::operator new(size_t size, RexxClass *classObject, RexxObject **args, size_t argCount)
2417 /******************************************************************************/
2418 /* Function: Create a new instance of object */
2419 /******************************************************************************/
2420 {
2421  /* create a new object */
2422  ProtectedObject newObject = new (classObject) RexxObject;
2423  /* now drive the user INIT */
2424  ((RexxObject *)newObject)->sendMessage(OREF_INIT, args, argCount);
2425  return(RexxObject *)newObject; /* and returnthe new object */
2426 }
2427 
2428 
2439 {
2440  RexxString *alias = (RexxString *)REQUEST_STRING(this);
2441  return alias->concatRexx(otherObj);
2442 }
2443 
2444 
2455 {
2456  RexxString *alias = (RexxString *)REQUEST_STRING(this);
2457  return alias->concatBlank(otherObj);
2458 }
2459 
2460 
2462 /******************************************************************************/
2463 /* Function: Exported access to an object virtual function */
2464 /******************************************************************************/
2465 {
2466  return this->stringValue(); /* forward to the virtual function */
2467 }
2468 
2470 /******************************************************************************/
2471 /* Function: Exported access to an object virtual function */
2472 /******************************************************************************/
2473 {
2474  return this->makeString(); /* forward to the virtual function */
2475 }
2476 
2478 /******************************************************************************/
2479 /* Function: Exported access to an object virtual function */
2480 /******************************************************************************/
2481 {
2482  return this->makeArray(); /* forward to the virtual function */
2483 }
2484 
2486 /******************************************************************************/
2487 /* Function: Exported access to an object virtual function */
2488 /******************************************************************************/
2489 {
2490  return this->defaultName(); /* forward to the virtual function */
2491 }
2492 
2494 /******************************************************************************/
2495 /* Function: Exported access to an object virtual function */
2496 /******************************************************************************/
2497 {
2498  return this->copy(); /* forward to the virtual function */
2499 }
2500 
2502  RexxString *message, /* unknown message */
2503  RexxArray *arguments ) /* message arguments */
2504 /******************************************************************************/
2505 /* Function: Exported access to an object virtual function */
2506 /******************************************************************************/
2507 {
2508  /* forward to the virtual function */
2509  return this->unknown(message, arguments);
2510 }
2511 
2513  RexxString *message ) /* method name */
2514 /******************************************************************************/
2515 /* Function: Exported access to an object virtual function */
2516 /******************************************************************************/
2517 {
2518  message = stringArgument(message, ARG_ONE)->upper();
2519  return this->hasMethod(message); /* forward to the virtual function */
2520 }
2521 
2523 /******************************************************************************/
2524 /* Function: give a formatted print of object information. */
2525 /******************************************************************************/
2526 {
2527  printf("Object at %p, of type %d\n", this, (int)this->getObjectTypeNumber());
2528 }
2529 
2534 {
2535  // use the initial identify hash and save this.
2536  hashValue = identityHash();
2537 }
2538 
2543 {
2544  return hashValue;
2545 }
2546 
2547 
2555 {
2556  // try for the variable value
2557  RexxObject *C_self = getObjectVariable(OREF_CSELF);
2558  // if we found one, validate for unwrappering
2559  if (C_self != OREF_NULL)
2560  {
2561  // if this is a pointer, then unwrapper the value
2562  if (C_self->isInstanceOf(ThePointerClass))
2563  {
2564  return ((RexxPointer *)C_self)->pointer();
2565  }
2566  // this could be a containing buffer instance as well
2567  else if (C_self->isInstanceOf(TheBufferClass))
2568  {
2569  // return a pointer to the buffer beginning
2570  return(void *)((RexxBuffer *)C_self)->getData();
2571  }
2572  }
2573  return NULL; /* no object available */
2574 }
2575 
2576 
2587 {
2588  while (scope != TheNilObject)
2589  {
2590  // try for the variable value
2591  RexxObject *C_self = getObjectVariable(OREF_CSELF, scope);
2592  // if we found one, validate for unwrappering
2593  if (C_self != OREF_NULL)
2594  {
2595  // if this is a pointer, then unwrapper the value
2596  if (C_self->isInstanceOf(ThePointerClass))
2597  {
2598  return ((RexxPointer *)C_self)->pointer();
2599  }
2600  // this could be a containing buffer instance as well
2601  else if (C_self->isInstanceOf(TheBufferClass))
2602  {
2603  // return a pointer to the buffer beginning
2604  return(void *)((RexxBuffer *)C_self)->getData();
2605  }
2606  }
2607  // step to the next scope
2608  scope = this->superScope(scope);
2609  }
2610  return NULL; /* no object available */
2611 }
2612 
2613 
2617 void *RexxNilObject::operator new(size_t size)
2618 {
2619  // At this point, this will be an instance of object. After we've removed
2620  // some of the methods during setup but before the image save, we'll update the
2621  // behaviour type information so that it will restore with the correct virtual
2622  // function table pointer.
2623  RexxObject *newObj = new_object(size, T_Object);
2624  // we need to switch the virtual method table pointer new.
2626  return newObj;
2627 }
2628 
2629 
2631 {
2632  NULL,
2633  (PCPPM)&RexxObject::operator_plus,
2634  (PCPPM)&RexxObject::operator_minus,
2635  (PCPPM)&RexxObject::operator_multiply,
2636  (PCPPM)&RexxObject::operator_divide,
2637  (PCPPM)&RexxObject::operator_integerDivide,
2638  (PCPPM)&RexxObject::operator_remainder,
2639  (PCPPM)&RexxObject::operator_power,
2640  (PCPPM)&RexxObject::operator_abuttal,
2641  (PCPPM)&RexxObject::operator_concat,
2642  (PCPPM)&RexxObject::operator_concatBlank,
2643  (PCPPM)&RexxObject::operator_equal,
2644  (PCPPM)&RexxObject::operator_notEqual,
2645  (PCPPM)&RexxObject::operator_isGreaterThan,
2646  (PCPPM)&RexxObject::operator_isBackslashGreaterThan,
2647  (PCPPM)&RexxObject::operator_isLessThan,
2648  (PCPPM)&RexxObject::operator_isBackslashLessThan,
2649  (PCPPM)&RexxObject::operator_isGreaterOrEqual,
2650  (PCPPM)&RexxObject::operator_isLessOrEqual,
2651  (PCPPM)&RexxObject::operator_strictEqual,
2652  (PCPPM)&RexxObject::operator_strictNotEqual,
2653  (PCPPM)&RexxObject::operator_strictGreaterThan,
2654  (PCPPM)&RexxObject::operator_strictBackslashGreaterThan,
2655  (PCPPM)&RexxObject::operator_strictLessThan,
2656  (PCPPM)&RexxObject::operator_strictBackslashLessThan,
2657  (PCPPM)&RexxObject::operator_strictGreaterOrEqual,
2658  (PCPPM)&RexxObject::operator_strictLessOrEqual,
2659  (PCPPM)&RexxObject::operator_lessThanGreaterThan,
2660  (PCPPM)&RexxObject::operator_greaterThanLessThan,
2661  (PCPPM)&RexxObject::operator_and,
2662  (PCPPM)&RexxObject::operator_or,
2663  (PCPPM)&RexxObject::operator_xor,
2664  (PCPPM)&RexxObject::operator_not,
2665 };
2666 
RexxInternalObject::logicalValue
virtual bool logicalValue(logical_t &)
Definition: ObjectClass.cpp:437
RexxObject::defMethods
RexxObject * defMethods(RexxDirectory *)
Definition: ObjectClass.cpp:1972
RexxObject::makeString
RexxString * makeString()
Definition: ObjectClass.cpp:1070
RexxVariableDictionary::copyValues
void copyValues()
Definition: RexxVariableDictionary.cpp:82
RexxObject::copy
RexxObject * copy()
Definition: ObjectClass.cpp:518
Error_Incorrect_method_noarray
#define Error_Incorrect_method_noarray
Definition: RexxErrorCodes.h:490
RexxObject::sendMessage
void sendMessage(RexxString *, RexxArray *, ProtectedObject &)
Definition: ObjectClass.cpp:668
RexxArray::getDimension
size_t getDimension()
Definition: ArrayClass.cpp:690
new_array
RexxArray * new_array(size_t s)
Definition: ArrayClass.hpp:250
logical_t
size_t logical_t
Definition: rexx.h:230
RexxVariableDictionary::getNextDictionary
RexxVariableDictionary * getNextDictionary()
Definition: RexxVariableDictionary.hpp:127
RexxTable::stringGet
RexxObject * stringGet(RexxString *key)
Definition: TableClass.hpp:67
RexxHashTableCollection::index
RexxObject * index(HashLink pos)
Definition: RexxCollection.hpp:90
RexxObject::idString
const char * idString()
Definition: ObjectClass.cpp:2224
RexxHashTableCollection::next
HashLink next(HashLink pos)
Definition: RexxCollection.hpp:88
RexxArray
Definition: ArrayClass.hpp:100
RexxObject::decodeMessageName
static void decodeMessageName(RexxObject *target, RexxObject *message, RexxString *&messageName, RexxObject *&startScope)
Definition: ObjectClass.cpp:1811
RexxInternalObject::numberValue
virtual bool numberValue(wholenumber_t &result, size_t precision)
Definition: ObjectClass.cpp:922
RexxObject::unknownRexx
RexxObject * unknownRexx(RexxString *, RexxArray *)
Definition: ObjectClass.cpp:2501
RexxObject::isInstanceOf
bool isInstanceOf(RexxClass *)
Definition: ObjectClass.cpp:226
Error_Incorrect_call_list
#define Error_Incorrect_call_list
Definition: RexxErrorCodes.h:344
RexxObject::objectName
RexxString * objectName()
Definition: ObjectClass.cpp:1479
RexxBehaviour::getMethods
RexxSupplier * getMethods(RexxObject *scope)
Definition: RexxBehaviour.cpp:560
RexxObject::truthValue
bool truthValue(int)
Definition: ObjectClass.cpp:468
RexxObject::stringRexx
RexxString * stringRexx()
Definition: ObjectClass.cpp:2461
RexxObject::newRexx
RexxObject * newRexx(RexxObject **arguments, size_t argCount)
Definition: ObjectClass.cpp:2299
TheFalseObject
#define TheFalseObject
Definition: RexxCore.h:184
CHAR_SETMETHOD
char CHAR_SETMETHOD[]
RexxObject::checkPrivate
RexxMethod * checkPrivate(RexxMethod *)
Definition: ObjectClass.cpp:565
MethodClass.hpp
new_proxy
RexxString * new_proxy(const char *name)
Definition: StringClass.hpp:567
reportNomethod
void reportNomethod(RexxString *message, RexxObject *receiver)
Definition: ActivityManager.hpp:236
RexxActivity::getEffectiveSecurityManager
SecurityManager * getEffectiveSecurityManager()
Definition: RexxActivity.cpp:2782
RexxObject::guardOn
void guardOn(RexxActivity *activity, RexxObject *scope)
Definition: ObjectClass.cpp:2203
new_integer
RexxInteger * new_integer(wholenumber_t v)
Definition: IntegerClass.hpp:198
RexxObject::defaultName
virtual RexxString * defaultName()
Definition: ObjectClass.cpp:1520
RexxVariableDictionary::isScope
bool isScope(RexxObject *otherScope)
Definition: RexxVariableDictionary.hpp:126
memory_mark_general
#define memory_mark_general(oref)
Definition: RexxMemory.hpp:437
memoryObject
RexxMemory memoryObject
Definition: RexxMemory.cpp:84
RexxInternalObject::behaviour
RexxBehaviour * behaviour
Definition: ObjectClass.hpp:306
RexxInternalObject::makeProxy
virtual RexxObject * makeProxy(RexxEnvelope *)
Definition: ObjectClass.cpp:106
RexxActivation.hpp
RexxObject::strictNotEqual
RexxObject * strictNotEqual(RexxObject *other)
Definition: ObjectClass.cpp:411
OrefSet
#define OrefSet(o, r, v)
Definition: RexxCore.h:94
RexxVariableDictionary::release
void release(RexxActivity *)
Definition: RexxVariableDictionary.cpp:379
new_objectVariableDictionary
RexxVariableDictionary * new_objectVariableDictionary(RexxObject *s)
Definition: RexxVariableDictionary.hpp:152
T_Object
Definition: ClassTypeCodes.h:57
RexxMethod::run
void run(RexxActivity *, RexxObject *, RexxString *, RexxObject **, size_t, ProtectedObject &)
Definition: MethodClass.cpp:311
RexxObject::copyRexx
RexxObject * copyRexx()
Definition: ObjectClass.cpp:2493
RexxObject::requestRexx
RexxObject * requestRexx(RexxString *)
Definition: ObjectClass.cpp:1631
RexxArray::data
RexxObject ** data()
Definition: ArrayClass.hpp:202
RexxMethod::newScope
RexxMethod * newScope(RexxClass *)
Definition: MethodClass.cpp:328
RexxInternalObject::getObjectTypeNumber
size_t getObjectTypeNumber()
Definition: ObjectClass.cpp:2058
RexxObject::requiredInteger
RexxInteger * requiredInteger(size_t, size_t)
Definition: ObjectClass.cpp:1314
RexxMethod::getScope
RexxClass * getScope()
Definition: MethodClass.hpp:143
RexxInternalObject::clone
RexxObject * clone()
Definition: ObjectClass.cpp:2308
RexxInternalObject::copy
virtual RexxObject * copy()
Definition: ObjectClass.cpp:478
prefixOperatorMethod
#define prefixOperatorMethod(name, message)
Definition: ObjectClass.cpp:2348
RexxClass::getId
RexxString * getId()
Definition: ClassClass.cpp:250
PointerClass.hpp
RexxMemory::addUninitObject
void addUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:589
RexxObject::hasUninitMethod
bool hasUninitMethod()
Definition: ObjectClass.cpp:2291
RexxObject::compareTo
virtual wholenumber_t compareTo(RexxObject *)
Definition: ObjectClass.cpp:186
RexxString::truthValue
bool truthValue(int)
Definition: StringClass.cpp:1344
requiredArgument
void requiredArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:284
RexxObject::messageSend
void messageSend(RexxString *, RexxObject **, size_t, ProtectedObject &)
Definition: ObjectClass.cpp:759
Error_Incorrect_method_whole
#define Error_Incorrect_method_whole
Definition: RexxErrorCodes.h:459
RexxString::copyIntoTail
void copyIntoTail(RexxCompoundTail *buffer)
Definition: StringClass.cpp:226
RexxNilObject::RexxNilObject
RexxNilObject()
Definition: ObjectClass.cpp:2533
RexxBehaviour::getClassType
size_t getClassType()
Definition: RexxBehaviour.hpp:101
RexxVariableDictionary::reserve
void reserve(RexxActivity *)
Definition: RexxVariableDictionary.cpp:343
RexxInternalObject::isEqual
virtual bool isEqual(RexxObject *)
Definition: ObjectClass.cpp:121
RexxArray::size
size_t size()
Definition: ArrayClass.hpp:200
RexxObject::doubleValue
virtual bool doubleValue(double &result)
Definition: ObjectClass.cpp:999
RexxPointer
Definition: PointerClass.hpp:49
RexxObject::superMethod
RexxMethod * superMethod(RexxString *, RexxObject *)
Definition: ObjectClass.cpp:2160
RexxObject::getObjectVariables
RexxVariableDictionary * getObjectVariables(RexxObject *)
Definition: ObjectClass.cpp:2170
RexxBehaviour::methodLookup
RexxMethod * methodLookup(RexxString *)
Definition: RexxBehaviour.cpp:364
RexxObject::methodLookup
RexxMethod * methodLookup(RexxString *name)
Definition: ObjectClass.cpp:897
RexxObject::hash
HashCode hash()
Definition: ObjectClass.cpp:371
RexxObject::strictEqual
RexxObject * strictEqual(RexxObject *)
Definition: ObjectClass.cpp:389
RexxObject::id
RexxString * id()
Definition: ObjectClass.cpp:2240
ARG_TWO
const int ARG_TWO
Definition: RexxCore.h:81
RexxVariableDictionary
Definition: RexxVariableDictionary.hpp:55
RexxActivity::checkStackSpace
void checkStackSpace()
Definition: RexxActivity.cpp:1964
RexxObject::getCSelf
void * getCSelf()
Definition: ObjectClass.cpp:2554
RexxObject::guardOff
void guardOff(RexxActivity *activity, RexxObject *scope)
Definition: ObjectClass.cpp:2216
RexxObject::concatRexx
RexxString * concatRexx(RexxObject *)
Definition: ObjectClass.cpp:2438
RexxInternalObject::hasUninit
void hasUninit()
Definition: ObjectClass.cpp:1873
RexxMemory::virtualFunctionTable
static void * virtualFunctionTable[]
Definition: RexxMemory.hpp:289
RexxInternalObject::isInstanceOf
virtual bool isInstanceOf(RexxClass *)
Definition: ObjectClass.cpp:212
reportException
void reportException(wholenumber_t error)
Definition: ActivityManager.hpp:136
RexxObject::startWith
RexxMessage * startWith(RexxObject *, RexxArray *)
Definition: ObjectClass.cpp:1740
RexxObject::getObjectVariable
RexxObject * getObjectVariable(RexxString *)
Definition: ObjectClass.cpp:2083
RexxString::unsignedNumberValue
bool unsignedNumberValue(stringsize_t &result, size_t precision)
Definition: StringClass.cpp:287
RexxObject::operatorMethods
static PCPPM operatorMethods[]
Definition: ObjectClass.hpp:542
RexxBehaviour::isPrimitive
bool isPrimitive()
Definition: RexxBehaviour.hpp:102
RexxObject::uninit
void uninit()
Definition: ObjectClass.cpp:2279
TheTrueObject
#define TheTrueObject
Definition: RexxCore.h:185
RexxSupplier
Definition: SupplierClass.hpp:47
RexxString::getStringData
const char * getStringData()
Definition: StringClass.hpp:333
RexxString::getChar
char getChar(size_t p)
Definition: StringClass.hpp:338
RexxActivationBase
Definition: ObjectClass.hpp:574
RexxBehaviour::isEnhanced
bool isEnhanced()
Definition: RexxBehaviour.hpp:106
RexxEnvelope
Definition: RexxEnvelope.hpp:53
RexxObject::notEqual
RexxObject * notEqual(RexxObject *other)
Definition: ObjectClass.cpp:420
RexxInternalObject::identityHash
HashCode identityHash()
Definition: ObjectClass.hpp:278
RexxBehaviour::getInstanceMethodDictionary
RexxTable * getInstanceMethodDictionary()
Definition: RexxBehaviour.hpp:96
RexxBuffer
Definition: BufferClass.hpp:91
RexxInternalObject::isSubClassOrEnhanced
bool isSubClassOrEnhanced()
Definition: ObjectClass.cpp:158
Error_Incorrect_method_nonnegative
#define Error_Incorrect_method_nonnegative
Definition: RexxErrorCodes.h:460
RexxArray::get
RexxObject * get(size_t pos)
Definition: ArrayClass.hpp:201
REQUEST_ARRAY
RexxArray * REQUEST_ARRAY(RexxObject *obj)
Definition: RexxCore.h:433
RexxBehaviour
Definition: RexxBehaviour.hpp:49
isOfClass
#define isOfClass(t, r)
Definition: RexxCore.h:211
RexxObject::makeArrayRexx
RexxObject * makeArrayRexx()
Definition: ObjectClass.cpp:2477
RexxActivity::getTopStackFrame
RexxActivationBase * getTopStackFrame()
Definition: RexxActivity.hpp:281
RexxInternalObject::makeArray
virtual RexxArray * makeArray()
Definition: ObjectClass.cpp:1103
RexxObject::send
RexxObject * send(RexxObject **, size_t)
Definition: ObjectClass.cpp:1705
RexxObject::objectNameEquals
RexxObject * objectNameEquals(RexxObject *)
Definition: ObjectClass.cpp:1504
RexxString::strictEqual
RexxInteger * strictEqual(RexxObject *)
Definition: StringClass.cpp:1035
RexxInternalObject::integerValue
virtual RexxInteger * integerValue(size_t)
Definition: ObjectClass.cpp:946
RexxObject::createInstance
static void createInstance()
Definition: ObjectClass.cpp:72
RexxMessage::start
RexxObject * start(RexxObject *)
Definition: MessageClass.cpp:301
RexxObject::integerValue
RexxInteger * integerValue(size_t)
Definition: ObjectClass.cpp:1008
RexxInternalObject::numberString
virtual RexxNumberString * numberString()
Definition: ObjectClass.cpp:955
RexxInternalObject::getObjectSize
size_t getObjectSize()
Definition: ObjectClass.hpp:224
RexxHashTableCollection::first
HashLink first()
Definition: RexxCollection.hpp:87
RexxMethod::newMethodObject
static RexxMethod * newMethodObject(RexxString *, RexxObject *, RexxObject *, RexxSource *a)
Definition: MethodClass.cpp:503
RexxInternalObject::removedUninit
void removedUninit()
Definition: ObjectClass.cpp:2066
ThePointerClass
#define ThePointerClass
Definition: RexxCore.h:168
RexxString::numberString
RexxNumberString * numberString()
Definition: StringClass.cpp:366
Error_Incorrect_method_nostring
#define Error_Incorrect_method_nostring
Definition: RexxErrorCodes.h:489
RexxObject::concatBlank
RexxString * concatBlank(RexxObject *)
Definition: ObjectClass.cpp:2454
RexxObject::processUnknown
void processUnknown(RexxString *, RexxObject **, size_t, ProtectedObject &)
Definition: ObjectClass.cpp:862
RexxBehaviour::superMethod
RexxMethod * superMethod(RexxString *, RexxObject *)
Definition: RexxBehaviour.cpp:485
new_string
RexxString * new_string(const char *s, stringsize_t l)
Definition: StringClass.hpp:524
RexxObject::requestNumber
bool requestNumber(wholenumber_t &, size_t)
Definition: ObjectClass.cpp:1352
RexxInternalObject::setHasReferences
void setHasReferences()
Definition: ObjectClass.hpp:239
RexxObject::copyIntoTail
void copyIntoTail(RexxCompoundTail *buffer)
Definition: ObjectClass.cpp:1084
CHAR_UNINIT
char CHAR_UNINIT[]
RexxHashTableCollection::value
RexxObject * value(HashLink pos)
Definition: RexxCollection.hpp:89
HashCode
size_t HashCode
Definition: ObjectClass.hpp:77
ARG_ONE
const int ARG_ONE
Definition: RexxCore.h:80
OREF_NULL
#define OREF_NULL
Definition: RexxCore.h:60
RexxObject::requiredNumber
wholenumber_t requiredNumber(size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
Definition: ObjectClass.cpp:1392
RexxVariableDictionary::realValue
RexxObject * realValue(RexxString *name)
Definition: RexxVariableDictionary.cpp:98
TheBufferClass
#define TheBufferClass
Definition: RexxCore.h:169
ArrayClass.hpp
RexxActivity
Definition: RexxActivity.hpp:127
RexxObject::init
RexxObject * init()
Definition: ObjectClass.cpp:2257
RexxObject::primitiveMakeString
RexxString * primitiveMakeString()
Definition: ObjectClass.cpp:1095
ARG_THREE
const int ARG_THREE
Definition: RexxCore.h:82
RexxInternalObject::instanceMethod
virtual RexxMethod * instanceMethod(RexxString *)
Definition: ObjectClass.cpp:255
RexxArray::put
void put(RexxObject *eref, size_t pos)
Definition: ArrayClass.cpp:203
ExpressionBaseVariable.hpp
RexxInternalObject::instanceMethods
virtual RexxSupplier * instanceMethods(RexxClass *)
Definition: ObjectClass.cpp:295
CHAR_MAKE
char CHAR_MAKE[]
RexxDirectory
Definition: DirectoryClass.hpp:49
RexxBehaviour::getOwningClass
RexxClass * getOwningClass()
Definition: RexxBehaviour.hpp:97
RexxObject::behaviourObject
RexxBehaviour * behaviourObject()
Definition: ObjectClass.hpp:469
RexxMethod::isProtected
bool isProtected()
Definition: MethodClass.hpp:135
arrayArgument
RexxArray * arrayArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:376
IntegerTwo
#define IntegerTwo
Definition: RexxCore.h:190
RexxInternalObject::setVirtualFunctions
void setVirtualFunctions(void *t)
Definition: ObjectClass.hpp:233
RexxObject::requestUnsignedNumber
bool requestUnsignedNumber(stringsize_t &, size_t)
Definition: ObjectClass.cpp:1376
RexxClass
Definition: ClassClass.hpp:49
RexxActivity::raiseCondition
bool raiseCondition(RexxString *, RexxObject *, RexxString *, RexxObject *, RexxObject *)
Definition: RexxActivity.cpp:434
RexxInternalObject::setBehaviour
void setBehaviour(RexxBehaviour *b)
Definition: ObjectClass.hpp:265
ProtectedObject.hpp
RexxInternalObject::doubleValue
virtual bool doubleValue(double &result)
Definition: ObjectClass.cpp:938
RexxObject::requiredNonNegative
stringsize_t requiredNonNegative(size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
Definition: ObjectClass.cpp:1442
flatten_reference
#define flatten_reference(oref, envel)
Definition: RexxMemory.hpp:440
IntegerThree
#define IntegerThree
Definition: RexxCore.h:191
RexxObject::flatten
void flatten(RexxEnvelope *)
Definition: ObjectClass.cpp:94
cleanUpFlatten
#define cleanUpFlatten
Definition: RexxMemory.hpp:432
RexxString::concatToCstring
RexxString * concatToCstring(const char *)
Definition: StringClass.cpp:1251
RexxObject::startCommon
RexxMessage * startCommon(RexxObject *message, RexxObject **arguments, size_t argCount)
Definition: ObjectClass.cpp:1786
ProtectedObject
Definition: ProtectedObject.hpp:46
MessageClass.hpp
RexxObject::unknown
virtual RexxObject * unknown(RexxString *msg, RexxArray *args)
Definition: ObjectClass.hpp:372
StringClass.hpp
RexxVariableDictionary::copy
RexxObject * copy()
Definition: RexxVariableDictionary.cpp:64
RexxNilObject::nilObject
static RexxObject * nilObject
Definition: ObjectClass.hpp:563
Error_Incorrect_method_maxarg
#define Error_Incorrect_method_maxarg
Definition: RexxErrorCodes.h:456
Error_Incorrect_method_positive
#define Error_Incorrect_method_positive
Definition: RexxErrorCodes.h:461
PCPPM
RexxObject *(RexxObject::* PCPPM)()
Definition: ObjectClass.hpp:198
RexxObject::instanceMethodRexx
RexxMethod * instanceMethodRexx(RexxString *)
Definition: ObjectClass.cpp:327
RexxObject::equal
RexxObject * equal(RexxObject *)
Definition: ObjectClass.cpp:400
RexxBehaviour::removeMethod
void removeMethod(RexxString *)
Definition: RexxBehaviour.cpp:301
RexxBehaviour::copy
RexxObject * copy()
Definition: RexxBehaviour.cpp:163
IntegerOne
#define IntegerOne
Definition: RexxCore.h:189
RexxMessage
Definition: MessageClass.hpp:54
Error_Incorrect_method_message
#define Error_Incorrect_method_message
Definition: RexxErrorCodes.h:496
CLASS_CREATE
#define CLASS_CREATE(name, id, className)
Definition: RexxMemory.hpp:445
ObjectClass.hpp
T_NilObject
Definition: ClassTypeCodes.h:110
RexxObject::classObject
RexxClass * classObject()
Definition: ObjectClass.cpp:1567
Error_Execution_super
#define Error_Execution_super
Definition: RexxErrorCodes.h:542
memory_mark
#define memory_mark(oref)
Definition: RexxMemory.hpp:436
Error_No_result_object_message
#define Error_No_result_object_message
Definition: RexxErrorCodes.h:437
RexxInternalObject::getHashValue
virtual HashCode getHashValue()
Definition: ObjectClass.hpp:276
RexxObject::defMethod
virtual RexxObject * defMethod(RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
Definition: ObjectClass.cpp:2004
HashLink
size_t HashLink
Definition: RexxHashTable.hpp:49
RexxVariableDictionary::set
void set(RexxString *, RexxObject *)
Definition: RexxVariableDictionary.cpp:330
RexxInternalObject::copyIntoTail
virtual void copyIntoTail(RexxCompoundTail *buffer)
Definition: ObjectClass.cpp:1054
SecurityManager
Definition: SecurityManager.hpp:52
RexxObject::logicalValue
virtual bool logicalValue(logical_t &)
Definition: ObjectClass.cpp:451
REQUEST_STRING
RexxString * REQUEST_STRING(RexxObject *object)
Definition: RexxCore.h:276
RexxNilObject::getHashValue
virtual HashCode getHashValue()
Definition: ObjectClass.cpp:2542
RexxObject::numberValue
virtual bool numberValue(wholenumber_t &result, size_t precision)
Definition: ObjectClass.cpp:963
RexxInternalObject::truthValue
virtual bool truthValue(int)
Definition: ObjectClass.cpp:457
RexxString::strCompare
bool strCompare(const char *s)
Definition: StringClass.hpp:346
missingArgument
void missingArgument(size_t argumentPosition)
Definition: ActivityManager.hpp:246
RexxNumberString
Definition: NumberStringClass.hpp:93
RexxObject::hasMethod
virtual RexxInteger * hasMethod(RexxString *msg)
Definition: ObjectClass.cpp:1558
RexxObject::makeStringRexx
RexxObject * makeStringRexx()
Definition: ObjectClass.cpp:2469
RexxObject::makeArray
RexxArray * makeArray()
Definition: ObjectClass.cpp:1111
RexxInternalObject::unsignedNumberValue
virtual bool unsignedNumberValue(stringsize_t &result, size_t precision)
Definition: ObjectClass.cpp:906
wholenumber_t
ssize_t wholenumber_t
Definition: rexx.h:229
Error_Invalid_whole_number_compareto
#define Error_Invalid_whole_number_compareto
Definition: RexxErrorCodes.h:232
RexxObject::instanceMethod
RexxMethod * instanceMethod(RexxString *)
Definition: ObjectClass.cpp:269
operatorMethod
#define operatorMethod(name, message)
Definition: ObjectClass.cpp:2333
RexxInternalObject::makeString
virtual RexxString * makeString()
Definition: ObjectClass.cpp:1045
stringsize_t
size_t stringsize_t
Definition: rexx.h:228
RexxObject::sendWith
RexxObject * sendWith(RexxObject *, RexxArray *)
Definition: ObjectClass.cpp:1672
RexxBehaviour::isNonPrimitive
bool isNonPrimitive()
Definition: RexxBehaviour.hpp:103
RexxObject::requiredString
RexxString * requiredString()
Definition: ObjectClass.cpp:1280
RexxClass::isCompatibleWith
bool isCompatibleWith(RexxClass *other)
Definition: ClassClass.cpp:1493
RexxObject::hasMethodRexx
RexxObject * hasMethodRexx(RexxString *)
Definition: ObjectClass.cpp:2512
RexxString::numberValue
bool numberValue(wholenumber_t &result, size_t precision)
Definition: StringClass.cpp:244
RexxBehaviour::addMethod
void addMethod(RexxString *, RexxMethod *)
Definition: RexxBehaviour.cpp:319
ObjectHeader
Definition: ObjectClass.hpp:83
RexxObject::setMethod
RexxObject * setMethod(RexxString *, RexxMethod *, RexxString *a=OREF_NULL)
Definition: ObjectClass.cpp:1576
RexxObject::unsignedNumberValue
virtual bool unsignedNumberValue(stringsize_t &result, size_t precision)
Definition: ObjectClass.cpp:981
lastMethod
RexxMethod * lastMethod()
Definition: ActivityManager.hpp:265
RexxString::concatBlank
RexxString * concatBlank(RexxObject *)
Definition: StringClass.cpp:1291
setUpFlatten
#define setUpFlatten(type)
Definition: RexxMemory.hpp:427
SecurityManager::checkProtectedMethod
bool checkProtectedMethod(RexxObject *target, RexxString *messageName, size_t count, RexxObject **arguments, ProtectedObject &result)
Definition: SecurityManager.cpp:164
RexxMethod::isPrivate
bool isPrivate()
Definition: MethodClass.hpp:134
TheNilObject
#define TheNilObject
Definition: RexxCore.h:180
ActivityManager::currentActivity
static RexxActivity *volatile currentActivity
Definition: ActivityManager.hpp:95
RexxObject::start
RexxMessage * start(RexxObject **, size_t)
Definition: ObjectClass.cpp:1761
RexxObject::setObjectVariable
void setObjectVariable(RexxString *, RexxObject *, RexxObject *)
Definition: ObjectClass.cpp:2121
RexxNilObject::hashValue
HashCode hashValue
Definition: ObjectClass.hpp:568
RexxBehaviour::define
RexxObject * define(RexxString *, RexxMethod *)
Definition: RexxBehaviour.cpp:249
Error_Logical_value_method
#define Error_Logical_value_method
Definition: RexxErrorCodes.h:273
RexxHashTableCollection::available
bool available(HashLink pos)
Definition: RexxCollection.hpp:91
RexxMethod::isSpecial
bool isSpecial()
Definition: MethodClass.hpp:136
RexxObject::numberString
RexxNumberString * numberString()
Definition: ObjectClass.cpp:1018
RexxInternalObject::primitiveMakeString
virtual RexxString * primitiveMakeString()
Definition: ObjectClass.cpp:1062
RexxActivity.hpp
RexxObject::addObjectVariables
void addObjectVariables(RexxVariableDictionary *)
Definition: ObjectClass.cpp:2139
RexxObject::isEqual
bool isEqual(RexxObject *)
Definition: ObjectClass.cpp:131
RexxObject::defaultNameRexx
RexxString * defaultNameRexx()
Definition: ObjectClass.cpp:2485
RexxObject::copyObjectVariables
void copyObjectVariables(RexxObject *newObject)
Definition: ObjectClass.cpp:542
RexxObject::requestInteger
RexxInteger * requestInteger(size_t)
Definition: ObjectClass.cpp:1295
RexxString::doubleValue
bool doubleValue(double &result)
Definition: StringClass.cpp:330
Error_Incorrect_method_option
#define Error_Incorrect_method_option
Definition: RexxErrorCodes.h:468
stringArgument
RexxString * stringArgument(RexxObject *object, size_t position)
Definition: RexxCore.h:296
RexxObject::requestArray
RexxArray * requestArray()
Definition: ObjectClass.cpp:1461
RexxString::integerValue
RexxInteger * integerValue(size_t)
Definition: StringClass.cpp:1694
RexxObject::run
RexxObject * run(RexxObject **, size_t)
Definition: ObjectClass.cpp:1883
RexxObject::liveGeneral
void liveGeneral(int reason)
Definition: ObjectClass.cpp:86
RexxObject::oref
RexxString * oref()
Definition: ObjectClass.cpp:1861
RexxObject::identityHashRexx
RexxInteger * identityHashRexx()
Definition: ObjectClass.cpp:2273
RexxActivationBase::getReceiver
virtual RexxObject * getReceiver()
Definition: ObjectClass.hpp:595
RexxCore.h
RexxObject::processProtectedMethod
void processProtectedMethod(RexxString *, RexxMethod *, RexxObject **, size_t, ProtectedObject &)
Definition: ObjectClass.cpp:840
RexxObject::requestStringNoNOSTRING
RexxString * requestStringNoNOSTRING()
Definition: ObjectClass.cpp:1186
DirectoryClass.hpp
RexxInternalObject::isBaseClass
bool isBaseClass()
Definition: ObjectClass.cpp:172
RexxObject::requiredPositive
stringsize_t requiredPositive(size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
Definition: ObjectClass.cpp:1423
RexxObject::superScope
RexxObject * superScope(RexxObject *)
Definition: ObjectClass.cpp:2151
RexxCompoundTail
Definition: RexxCompoundTail.hpp:52
RexxMethod
Definition: MethodClass.hpp:101
new_object
RexxObject * new_object(size_t s)
Definition: RexxMemory.hpp:422
RexxVariableDictionary::setNextDictionary
void setNextDictionary(RexxVariableDictionary *next)
Definition: RexxVariableDictionary.cpp:429
RexxObject::stringValue
RexxString * stringValue()
Definition: ObjectClass.cpp:1036
RexxString::concatRexx
RexxString * concatRexx(RexxObject *)
Definition: StringClass.cpp:1207
RexxSmartBuffer.hpp
RexxObject::instanceMethodsRexx
RexxSupplier * instanceMethodsRexx(RexxClass *)
Definition: ObjectClass.cpp:344
RexxInternalObject::stringValue
virtual RexxString * stringValue()
Definition: ObjectClass.cpp:1028
RexxInteger
Definition: IntegerClass.hpp:56
RexxString::upper
RexxString * upper()
Definition: StringClass.cpp:1442
RexxObject::instanceMethods
RexxSupplier * instanceMethods(RexxClass *)
Definition: ObjectClass.cpp:312
Error_Invalid_argument_string
#define Error_Invalid_argument_string
Definition: RexxErrorCodes.h:413
RexxObject::live
void live(size_t)
Definition: ObjectClass.cpp:78
RexxObject::requestString
RexxString * requestString()
Definition: ObjectClass.cpp:1124
RexxInternalObject::printObject
void printObject()
Definition: ObjectClass.cpp:2522
RexxVariableDictionary.hpp
RexxString::logicalValue
virtual bool logicalValue(logical_t &)
Definition: StringClass.cpp:1386
RexxObject::isInstanceOfRexx
RexxObject * isInstanceOfRexx(RexxClass *)
Definition: ObjectClass.cpp:240
Utilities::strCaselessCompare
static int strCaselessCompare(const char *opt1, const char *opt2)
Definition: Utilities.cpp:82
RexxObject::classInstance
static RexxClass * classInstance
Definition: ObjectClass.hpp:545
BufferClass.hpp
RexxBehaviour::superScope
RexxObject * superScope(RexxObject *)
Definition: RexxBehaviour.cpp:471
SourceFile.hpp
RexxInternalObject::header
ObjectHeader header
Definition: ObjectClass.hpp:305
RexxObject
Definition: ObjectClass.hpp:311
RexxObject::unsetMethod
RexxObject * unsetMethod(RexxString *)
Definition: ObjectClass.cpp:1618
RexxBehaviour::getMethodDictionary
RexxTable * getMethodDictionary()
Definition: RexxBehaviour.hpp:93
RexxString
Definition: StringClass.hpp:119
RexxObject::RexxObject
RexxObject()
Definition: ObjectClass.hpp:327
RexxMemory::removeUninitObject
void removeUninitObject(RexxObject *obj)
Definition: RexxMemory.cpp:578
isOfClassType
#define isOfClassType(t, r)
Definition: RexxCore.h:212
RexxObject::hashCode
RexxObject * hashCode()
Definition: ObjectClass.cpp:355