RexxCore.h
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 /* REXX Kernel RexxCore.h */
40 /* */
41 /* Global Declarations */
42 /******************************************************************************/
43 
44 /******************************************************************************/
45 /* Globally required include files */
46 /******************************************************************************/
47 #ifndef RexxCore_INCLUDED
48 #define RexxCore_INCLUDED
49 
50 #include "oorexxapi.h" // this is the core to everything
51 
52 /* ANSI C definitions */
53 #include <stdio.h>
54 #include <stdarg.h>
55 #include <string.h>
56 #include <ctype.h>
57 #include <limits.h>
58 #include <stdexcept>
59 
60 /* REXX Library definitions */
61 #define OREF_NULL NULL /* definition of a NULL REXX object */
62 
64 
65 typedef wholenumber_t RexxErrorCodes; // ooRexx5 defines RexxErrorCodes as an enum type in RexxErrorCodes.h
66 
67 /******************************************************************************/
68 /* Literal definitions */
69 /******************************************************************************/
70 #include "RexxConstants.hpp"
71 
72 /******************************************************************************/
73 /* Kernel Internal Limits */
74 /******************************************************************************/
75 
76 const int MAX_ERROR_NUMBER = 99999; /* maximum error code number */
77 const int MAX_SYMBOL_LENGTH = 250; /* length of a symbol name */
78 
79 /******************************************************************************/
80 /* Defines for argument error reporting */
81 /******************************************************************************/
82 
83 const int ARG_ONE = 1;
84 const int ARG_TWO = 2;
85 const int ARG_THREE = 3;
86 const int ARG_FOUR = 4;
87 const int ARG_FIVE = 5;
88 const int ARG_SIX = 6;
89 const int ARG_SEVEN = 7;
90 const int ARG_EIGHT = 8;
91 const int ARG_NINE = 9;
92 const int ARG_TEN = 10;
93 
94 
95 #define debug_encoding 0
96 
97 
98 /* Object Reference Assignment */
99 // #define CHECKOREFS 1
100 #ifndef CHECKOREFS
101 #define OrefSet(o,r,v) ((o)->isOldSpace() ? memoryObject.setOref((void *)&(r),(RexxObject *)v) : (RexxObject *)(r=v))
102 #else
103 #define OrefSet(o,r,v) memoryObject.checkSetOref((RexxObject *)o, (RexxObject **)&(r), (RexxObject *)v, __FILE__, __LINE__)
104 #endif
105 
106 
107 // forward declaration of commonly used classes
108 class RexxExpressionStack;
109 class RexxActivation;
110 class RexxObject;
111 class RexxClass;
112 class RexxDirectory;
113 class RexxIntegerClass;
114 class RexxArray;
115 class RexxMemory;
116 class RexxString;
117 class RexxText;
118 
119 /******************************************************************************/
120 /* Change EXTERN definition if not already created by GDATA */
121 /******************************************************************************/
122 
123 #ifndef INITGLOBALPTR // if not the global, this is a NOP.
124 #define INITGLOBALPTR
125 #endif
126 #ifndef EXTERN
127 #define EXTERN extern /* turn into external definition */
128 #endif
129 
130 #ifndef EXTERNMEM
131 #define EXTERNMEM extern /* turn into external definition */
132 #endif
133 
134 /******************************************************************************/
135 /* Primitive Method Type Definition Macros */
136 /******************************************************************************/
137  /* following two are used by OKINIT */
138  /* to build the VFT Array. */
139 #define CLASS_EXTERNAL(b,c)
140 #define CLASS_INTERNAL(b,c)
141 
142 #define koper(name) RexxObject *name(RexxObject *);
143 
144 
145 /******************************************************************************/
146 /* Global Objects - General */
147 /******************************************************************************/
148 
149 
150 // this one is special, and is truly global.
151 EXTERNMEM RexxMemory memoryObject; /* memory object */
152 
153 // TODO: make these into statics inside classes.
154 
155 #define TheArrayClass RexxArray::classInstance
156 #define TheClassClass RexxClass::classInstance
157 #define TheDirectoryClass RexxDirectory::classInstance
158 #define TheIntegerClass RexxInteger::classInstance
159 #define TheListClass RexxList::classInstance
160 #define TheMessageClass RexxMessage::classInstance
161 #define TheMethodClass RexxMethod::classInstance
162 #define TheRoutineClass RoutineClass::classInstance
163 #define ThePackageClass PackageClass::classInstance
164 #define TheRexxContextClass RexxContext::classInstance
165 #define TheNumberStringClass RexxNumberString::classInstance
166 #define TheObjectClass RexxObject::classInstance
167 #define TheQueueClass RexxQueue::classInstance
168 #define TheStemClass RexxStem::classInstance
169 #define TheStringClass RexxString::classInstance
170 #define TheMutableBufferClass RexxMutableBuffer::classInstance
171 #define TheSupplierClass RexxSupplier::classInstance
172 #define TheTableClass RexxTable::classInstance
173 #define TheIdentityTableClass RexxIdentityTable::classInstance
174 #define TheRelationClass RexxRelation::classInstance
175 #define ThePointerClass RexxPointer::classInstance
176 #define TheBufferClass RexxBuffer::classInstance
177 #define TheWeakReferenceClass WeakReference::classInstance
178 #define TheStackFrameClass StackFrameClass::classInstance
179 #define TheRexxBlockClass RexxBlock::classInstance
180 #define TheRexxTextClass RexxText::classInstance
181 #define TheUnicodeClass Unicode::classInstance
182 
183 #define TheEnvironment RexxMemory::environment
184 #define TheStaticRequires RexxMemory::staticRequires
185 #define TheFunctionsDirectory RexxMemory::functionsDir
186 #define TheCommonRetrievers RexxMemory::commonRetrievers
187 #define TheKernel RexxMemory::kernel
188 #define TheSystem RexxMemory::system
189 #define TheRexxPackage RexxMemory::rexxPackage
190 
191 #define TheNilObject RexxNilObject::nilObject
192 
193 #define TheNullArray RexxArray::nullArray
194 
195 #define TheFalseObject RexxInteger::falseObject
196 #define TheTrueObject RexxInteger::trueObject
197 #define TheNullPointer RexxPointer::nullPointer
198 
199 #define IntegerZero RexxInteger::integerZero
200 #define IntegerOne RexxInteger::integerOne
201 #define IntegerTwo RexxInteger::integerTwo
202 #define IntegerThree RexxInteger::integerThree
203 #define IntegerFour RexxInteger::integerFour
204 #define IntegerFive RexxInteger::integerFive
205 #define IntegerSix RexxInteger::integerSix
206 #define IntegerSeven RexxInteger::integerSeven
207 #define IntegerEight RexxInteger::integerEight
208 #define IntegerNine RexxInteger::integerNine
209 #define IntegerMinusOne RexxInteger::integerMinusOne
210 
211 #define TheNullText RexxText::nullText
212 
213 #include "ClassTypeCodes.h"
214 
215 
216 
217 /******************************************************************************/
218 /* Utility Macros */
219 /******************************************************************************/
220 
221 #define RXROUNDUP(n,to) ((((n)+(to-1))/(to))*to)
222 #define rounddown(n,to) (((n)/(to))*to)
223 
224 #define isOfClass(t,r) (r)->isObjectType(The##t##Behaviour)
225 #define isOfClassType(t,r) (r)->isObjectType(T_##t)
226 
227 /******************************************************************************/
228 /* Utility Functions */
229 /******************************************************************************/
230 
231  /* find an environment symbol */
232 #define env_find(s) (TheEnvironment->entry(s))
233 
234 /******************************************************************************/
235 /* Thread constants */
236 /******************************************************************************/
237 
238 #define NO_THREAD -1
239 
240 /******************************************************************************/
241 /* Global Objects - Names */
242 /******************************************************************************/
243 #undef GLOBAL_NAME
244 #define GLOBAL_NAME(name, value) EXTERN RexxString * OREF_##name INITGLOBALPTR;
245 #include "GlobalNames.h"
246 
247 #include "ObjectClass.hpp" /* get real definition of Object */
248 
249  #include "TableClass.hpp"
250  #include "StackClass.hpp"
251  #include "RexxMemory.hpp" /* memory next, to get OrefSet */
252  #include "RexxBehaviour.hpp" /* now behaviours and */
253  #include "ClassClass.hpp" /* classes, which everything needs */
254  #include "RexxEnvelope.hpp" /* envelope is needed for flattens */
255  #include "RexxActivity.hpp" /* activity is needed for errors */
256  #include "NumberStringClass.hpp" /* added to make 'number_digits()' */
257  /* in 'ArrayClass.c' visible */
258 /******************************************************************************/
259 /* Method arguments special codes */
260 /******************************************************************************/
261 
262 const size_t A_COUNT = 127; /* pass arguments as pointer/count pair */
263 
264 /******************************************************************************/
265 /* Return codes */
266 /******************************************************************************/
267 
268 const int RC_OK = 0;
269 const int RC_LOGIC_ERROR = 2;
270 
271 const int POSITIVE = 1; /* integer must be positive */
272 const int NONNEGATIVE = 2; /* integer must be non-negative */
273 const int WHOLE = 3; /* integer must be whole */
274 
275 
276 /******************************************************************************/
277 /* Argument helpers */
278 /******************************************************************************/
279 
280 // some very common class tests
281 inline bool isString(RexxObject *o) { return isOfClass(String, o); }
282 inline bool isInteger(RexxObject *o) { return isOfClass(Integer, o); }
283 inline bool isNumberString(RexxObject *o) { return isOfClass(NumberString, o); }
284 inline bool isPolymorphicString(RexxObject *o) { return isInteger(o) || isNumberString(o) || isString(o); }
285 inline bool isArray(RexxObject *o) { return isOfClass(Array, o); }
286 inline bool isStem(RexxObject *o) { return isOfClass(Stem, o); }
287 inline bool isActivation(RexxObject *o) { return isOfClass(Activation, o); }
288 inline bool isMethod(RexxObject *o) { return isOfClass(Method, o); }
289 
290 #include "ActivityManager.hpp"
291 
292 /* The next macro is specifically for REQUESTing a STRING, since there are */
293 /* four primitive classes that are equivalents for strings. It will trap on */
294 /* OREF_NULL. */
296 {
297  return (isOfClass(String, object) ? (RexxString *)object : (object)->requestString());
298 }
299 
300 
301 // The next routine checks for required arguments and raises a missing argument
302 // error for the given position.
303 inline void requiredArgument(RexxObject *object, RexxString *kind, size_t position)
304 {
305  if (object == OREF_NULL) /* missing argument? */
306  {
307  missingArgument(kind, position); /* raise an error */
308  }
309 }
310 
311 
312 /* The next routine is specifically for REQUESTing a STRING needed as a method*/
313 /* argument. This raises an error if the object cannot be converted to a */
314 /* string value. */
315 inline RexxString * stringArgument(RexxObject *object, RexxString *kind, size_t position)
316 {
317  if (object == OREF_NULL) /* missing argument? */
318  {
319  missingArgument(kind, position); /* raise an error */
320  }
321  /* force to a string value */
322  return object->requiredString(kind, position);
323 }
324 
325 
326 /* The next routine is specifically for REQUESTing a STRING needed as a method*/
327 /* argument. This raises an error if the object cannot be converted to a */
328 /* string value. */
329 inline RexxString * stringArgument(RexxObject *object, RexxString *kind, const char *name)
330 {
331  if (object == OREF_NULL) /* missing argument? */
332  {
334  }
335  /* force to a string value */
336  return object->requiredString(kind, name);
337 }
338 
339 
341 {
342  return (o == OREF_NULL ? d : stringArgument(o, kind, p));
343 }
344 
345 
346 inline RexxString *optionalStringArgument(RexxObject *o, RexxString *d, RexxString *kind, const char *p)
347 {
348  return (o == OREF_NULL ? d : stringArgument(o, kind, p));
349 }
350 
351 
352 // resides in the string class util
353 size_t lengthArgument(RexxObject *o, size_t p);
354 
355 inline size_t optionalLengthArgument(RexxObject *o, size_t d, size_t p)
356 {
357  return (o == OREF_NULL ? d : lengthArgument(o, p));
358 }
359 
360 // resides in the string class util
361 size_t positionArgument(RexxObject *o, size_t p);
362 
363 inline size_t optionalPositionArgument(RexxObject *o, size_t d, size_t p)
364 {
365  return (o == OREF_NULL ? d : positionArgument(o, p));
366 }
367 
368 codepoint_t padArgument(RexxObject *o, size_t p);
369 
371 {
372  return (o == OREF_NULL ? d : padArgument(o, p));
373 }
374 
375 char optionArgument(RexxObject *o, size_t p);
376 
377 inline char optionalOptionArgument(RexxObject *o, char d, size_t p)
378 {
379  return (o == OREF_NULL ? d : optionArgument(o, p));
380 }
381 
382 inline size_t optionalNonNegative(RexxObject *o, size_t d, RexxString *kind, size_t p)
383 {
384  return (o == OREF_NULL ? d : o->requiredNonNegative(kind, p));
385 }
386 
387 inline size_t optionalPositive(RexxObject *o, size_t d, RexxString *kind, size_t p)
388 {
389  return (o == OREF_NULL ? d : o->requiredPositive(kind, p));
390 }
391 
392 /* The next routine is specifically for REQUESTing an ARRAY needed as a method*/
393 /* argument. This raises an error if the object cannot be converted to a */
394 /* single dimensional array item */
395 inline RexxArray *arrayArgument(RexxObject *object, RexxString *kind, size_t position)
396 {
397  if (object == OREF_NULL) /* missing argument? */
398  {
399  missingArgument(kind, position); /* raise an error */
400  }
401  /* force to array form */
402  RexxArray *array = object->requestArray();
403  /* not an array? */
404  if (array == TheNilObject || array->getDimension() != 1)
405  {
406  /* raise an error */
407  // reportException(Error_Execution_noarray, object);
408  // jlf: don't impact Error_Execution_noarray with kind, because used in several places where kind has no meaning
409  // jlf: instead, use Error_Invalid_argument_noarray (where I added a 3rd parameter: object)
410  // jlf: drawback, some test cases may fail because of this change, will see...
411  // jlf: about new_integer, few risks to create a new instance, so no need to protect it against GC
413  }
414  return array;
415 }
416 
417 
418 inline RexxArray * arrayArgument(RexxObject *object, RexxString *kind, RexxString *name)
419 {
420  if (object == OREF_NULL) /* missing argument? */
421  {
423  }
424 
425  /* force to array form */
426  RexxArray *array = object->requestArray();
427  /* not an array? */
428  if (array == TheNilObject || array->getDimension() != 1)
429  {
430  /* raise an error */
431  reportException(Error_Invalid_argument_noarray, kind, name, object);
432  }
433  return array;
434 }
435 
436 
437 /* The next routine is specifically for REQUESTing a STRING needed as a method*/
438 /* argument. This raises an error if the object cannot be converted to a */
439 /* string value. */
440 inline void classArgument(RexxObject *object, RexxClass *clazz, RexxString *kind, RexxString *name)
441 {
442  if (object == OREF_NULL) /* missing argument? */
443  {
445  }
446 
447  if (!object->isInstanceOf(clazz))
448  {
450  }
451 }
452 
453 
454 /* The next macro is specifically for REQUESTing an ARRAY, since there are */
455 /* six primitive classes that can produce array equivalents. It will trap on */
456 /* OREF_NULL. */
457 inline RexxArray * REQUEST_ARRAY(RexxObject *obj) { return ((obj)->requestArray()); }
458 
459 /* The next macro is specifically for REQUESTing an INTEGER, */
461 
462 
463 // Returns true if at least one positional argument is a RexxText
464 // The named arguments are not scanned
465 inline bool hasRexxTextArguments(RexxObject **arguments, size_t argcount, size_t named_argcount)
466 {
467  for (size_t i=0; i < argcount; i++)
468  {
469  RexxObject *arg = arguments[i];
470  if (arg != OREF_NULL && isOfClass(RexxText, arg)) return true;
471  }
472  return false;
473 }
474 
475 
476 /**
477  * Handy function for situations where a NULL results needs
478  * translation into .nil.
479  *
480  * @param o The result value.
481  *
482  * @return Either the result object, or TheNilObject.
483  */
484 inline RexxObject *resultOrNil(RexxInternalObject *o) { return o != OREF_NULL ? (RexxObject *)o : TheNilObject; } // ooRexx5
485 
486 
487 /**
488  * Handy method for transforming a boolean value into Rexx method
489  * boolean return values (i.e., .true or .false).
490  *
491  * @param v The boolean value.
492  *
493  * @return Either TheTrueObject or TheFalseObject, depending on
494  * the argument value.
495  */
496 inline RexxObject *booleanObject(bool v) { return v ? TheTrueObject : TheFalseObject; } // ooRexx5
497 
498 
499 /******************************************************************************/
500 /* Named argument helpers */
501 /******************************************************************************/
502 
504 {
506  {
507  this->name = name;
508  this->nameLength = name ? strlen(name) : 0;
509  this->value = value;
510  this->assigned = false;
511  }
512 
513  const char *name; // name of the named argument
514  size_t nameLength;
515  RexxObject *value; // default value or OREF_NULL
516  bool assigned; // true if a value has been assigned
517 };
518 
520 {
521  public:
523  {
524  // count=0 is accepted
525  this->namedArguments = new NamedArgument[count];
526  if (this->namedArguments == NULL) throw std::invalid_argument( "NamedArguments: memory error" );
527  }
528 
530  {
531  delete[] this->namedArguments;
532  this->namedArguments = NULL;
533  }
534 
535  NamedArgument &operator[](size_t index)
536  {
537  if (this->namedArguments == NULL) throw std::invalid_argument( "NamedArguments: this instance has been deleted" );
538  if (index >= this->count) throw std::invalid_argument( "NamedArguments: invalid index" );
539  return this->namedArguments[index];
540  }
541 
542  // Resides in UseStrictInstruction.cpp.
543  // Match namedArglist (name1, value1, name2, value2, ...) with the declared namedArguments
544  void match(RexxObject **namedArglist, size_t namedArgCount, bool strict, bool extraAllowed, size_t minimumRequired=0);
545 
546  // name: name of the argument passed by the caller, to search in expectedNamedArguments. Can be null.
547  // value: value of the argument passed by the caller, to store in expectedNamedArguments if name is found. Can be null.
548  // strict: raise error if true and name not null and name not found.
549  bool match(RexxString *name, RexxObject *value, bool strict = true, size_t from = 0, bool parse_time = false);
550  bool match(const char *name, size_t nameLength, RexxObject *value, bool strict = true, size_t from = 0, bool parse_time = false);
551 
552  const size_t count;
553 
554  private:
555  bool checkNameMatching(const char *name, size_t nameLength, size_t i, bool parse_time);
556 
558 };
559 
560 
561 /******************************************************************************/
562 /* Typed method invocation macros */
563 /******************************************************************************/
564 
565 inline RexxObject * callOperatorMethod(RexxObject *object, size_t methodOffset, RexxObject *argument) {
566  /* get the entry point */
567  PCPPM cppEntry = object->behaviour->getOperatorMethod(methodOffset);
568  /* go issue the method */
569  return (object->*((PCPPM1)cppEntry))(argument);
570 }
571 
572 #endif
void reportException(wholenumber_t error)
void missingArgument(RexxString *kind, size_t argumentPosition)
RexxInteger * new_integer(wholenumber_t v)
RexxObject *(RexxObject::* PCPPM1)(RexxObject *)
RexxObject *(RexxObject::* PCPPM)()
const int POSITIVE
Definition: RexxCore.h:271
RexxObject * resultOrNil(RexxInternalObject *o)
Definition: RexxCore.h:484
const size_t A_COUNT
Definition: RexxCore.h:262
bool isInteger(RexxObject *o)
Definition: RexxCore.h:282
bool isStem(RexxObject *o)
Definition: RexxCore.h:286
codepoint_t optionalPadArgument(RexxObject *o, codepoint_t d, size_t p)
Definition: RexxCore.h:370
EXTERNMEM RexxMemory memoryObject
Definition: RexxCore.h:151
RexxObject * booleanObject(bool v)
Definition: RexxCore.h:496
#define OREF_NULL
Definition: RexxCore.h:61
const int ARG_FIVE
Definition: RexxCore.h:87
RexxString * stringArgument(RexxObject *object, RexxString *kind, size_t position)
Definition: RexxCore.h:315
const int ARG_NINE
Definition: RexxCore.h:91
const int ARG_SIX
Definition: RexxCore.h:88
RexxArray * REQUEST_ARRAY(RexxObject *obj)
Definition: RexxCore.h:457
const int ARG_FOUR
Definition: RexxCore.h:86
const int ARG_TEN
Definition: RexxCore.h:92
const int WHOLE
Definition: RexxCore.h:273
bool isNumberString(RexxObject *o)
Definition: RexxCore.h:283
wholenumber_t RexxErrorCodes
Definition: RexxCore.h:65
RexxString * REQUEST_STRING(RexxObject *object)
Definition: RexxCore.h:295
bool isPolymorphicString(RexxObject *o)
Definition: RexxCore.h:284
const int MAX_SYMBOL_LENGTH
Definition: RexxCore.h:77
#define EXTERNMEM
Definition: RexxCore.h:131
size_t lengthArgument(RexxObject *o, size_t p)
const int ARG_THREE
Definition: RexxCore.h:85
const int ARG_EIGHT
Definition: RexxCore.h:90
size_t optionalPositive(RexxObject *o, size_t d, RexxString *kind, size_t p)
Definition: RexxCore.h:387
bool isString(RexxObject *o)
Definition: RexxCore.h:281
#define TheTrueObject
Definition: RexxCore.h:196
const int ARG_TWO
Definition: RexxCore.h:84
bool isMethod(RexxObject *o)
Definition: RexxCore.h:288
#define isOfClass(t, r)
Definition: RexxCore.h:224
const int ARG_SEVEN
Definition: RexxCore.h:89
size_t optionalNonNegative(RexxObject *o, size_t d, RexxString *kind, size_t p)
Definition: RexxCore.h:382
codepoint_t padArgument(RexxObject *o, size_t p)
bool hasRexxTextArguments(RexxObject **arguments, size_t argcount, size_t named_argcount)
Definition: RexxCore.h:465
size_t optionalLengthArgument(RexxObject *o, size_t d, size_t p)
Definition: RexxCore.h:355
char optionalOptionArgument(RexxObject *o, char d, size_t p)
Definition: RexxCore.h:377
#define TheNilObject
Definition: RexxCore.h:191
const int RC_OK
Definition: RexxCore.h:268
size_t optionalPositionArgument(RexxObject *o, size_t d, size_t p)
Definition: RexxCore.h:363
const int MAX_ERROR_NUMBER
Definition: RexxCore.h:76
void classArgument(RexxObject *object, RexxClass *clazz, RexxString *kind, RexxString *name)
Definition: RexxCore.h:440
bool isActivation(RexxObject *o)
Definition: RexxCore.h:287
#define TheFalseObject
Definition: RexxCore.h:195
size_t positionArgument(RexxObject *o, size_t p)
RexxObject * callOperatorMethod(RexxObject *object, size_t methodOffset, RexxObject *argument)
Definition: RexxCore.h:565
const int ARG_ONE
Definition: RexxCore.h:83
const int RC_LOGIC_ERROR
Definition: RexxCore.h:269
RexxArray * arrayArgument(RexxObject *object, RexxString *kind, size_t position)
Definition: RexxCore.h:395
RexxString * optionalStringArgument(RexxObject *o, RexxString *d, RexxString *kind, size_t p)
Definition: RexxCore.h:340
char optionArgument(RexxObject *o, size_t p)
const int NONNEGATIVE
Definition: RexxCore.h:272
void requiredArgument(RexxObject *object, RexxString *kind, size_t position)
Definition: RexxCore.h:303
bool isArray(RexxObject *o)
Definition: RexxCore.h:285
RexxInteger * REQUEST_INTEGER(RexxObject *obj)
Definition: RexxCore.h:460
#define Error_Invalid_argument_noarray
#define Error_Invalid_argument_noarg
#define Error_Invalid_argument_noclass
NamedArgument * namedArguments
Definition: RexxCore.h:557
const size_t count
Definition: RexxCore.h:552
void match(RexxObject **namedArglist, size_t namedArgCount, bool strict, bool extraAllowed, size_t minimumRequired=0)
bool checkNameMatching(const char *name, size_t nameLength, size_t i, bool parse_time)
NamedArguments(size_t count)
Definition: RexxCore.h:522
NamedArgument & operator[](size_t index)
Definition: RexxCore.h:535
static const size_t ARGUMENT_DIGITS
Definition: Numerics.hpp:68
size_t getDimension()
Definition: ArrayClass.cpp:693
PCPPM getOperatorMethod(size_t index)
RexxString * getId()
Definition: ClassClass.cpp:284
RexxBehaviour * behaviour
stringsize_t requiredPositive(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
stringsize_t requiredNonNegative(RexxString *kind, size_t position, size_t precision=Numerics::ARGUMENT_DIGITS)
RexxInteger * requestInteger(size_t)
RexxArray * requestArray()
RexxString * requestString()
bool isInstanceOf(RexxClass *)
ssize_t codepoint_t
Definition: rexx.h:232
ssize_t wholenumber_t
Definition: rexx.h:230
bool assigned
Definition: RexxCore.h:516
NamedArgument(const char *name=NULL, RexxObject *value=OREF_NULL)
Definition: RexxCore.h:505
const char * name
Definition: RexxCore.h:513
size_t nameLength
Definition: RexxCore.h:514
RexxObject * value
Definition: RexxCore.h:515