From: <bi...@us...> - 2014-07-26 23:55:35
|
Revision: 10332 http://sourceforge.net/p/oorexx/code-0/10332 Author: bigrixx Date: 2014-07-26 23:55:29 +0000 (Sat, 26 Jul 2014) Log Message: ----------- End of another good day Modified Paths: -------------- sandbox/rick/newsource/interpreter/behaviour/ClassTypeCodes.h sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviourNames.h sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviours.cpp sandbox/rick/newsource/interpreter/behaviour/PrimitiveClasses.xml sandbox/rick/newsource/interpreter/behaviour/VirtualFunctionTable.cpp sandbox/rick/newsource/interpreter/classes/StackFrameClass.cpp sandbox/rick/newsource/interpreter/classes/StemClass.cpp sandbox/rick/newsource/interpreter/classes/StemClass.hpp sandbox/rick/newsource/interpreter/classes/StringClass.cpp sandbox/rick/newsource/interpreter/classes/StringClass.hpp sandbox/rick/newsource/interpreter/classes/StringClassMisc.cpp sandbox/rick/newsource/interpreter/classes/SupplierClass.cpp sandbox/rick/newsource/interpreter/classes/SupplierClass.hpp sandbox/rick/newsource/interpreter/classes/support/CompoundTableElement.cpp sandbox/rick/newsource/interpreter/classes/support/CompoundTableElement.hpp sandbox/rick/newsource/interpreter/classes/support/CompoundVariableTable.cpp sandbox/rick/newsource/interpreter/classes/support/CompoundVariableTable.hpp sandbox/rick/newsource/interpreter/classes/support/CompoundVariableTail.cpp sandbox/rick/newsource/interpreter/classes/support/HashCollection.cpp sandbox/rick/newsource/interpreter/classes/support/HashCollection.hpp sandbox/rick/newsource/interpreter/classes/support/HashContents.cpp sandbox/rick/newsource/interpreter/classes/support/HashContents.hpp sandbox/rick/newsource/interpreter/execution/RexxActivation.cpp sandbox/rick/newsource/interpreter/execution/RexxActivation.hpp sandbox/rick/newsource/interpreter/runtime/RexxCore.h Modified: sandbox/rick/newsource/interpreter/behaviour/ClassTypeCodes.h =================================================================== --- sandbox/rick/newsource/interpreter/behaviour/ClassTypeCodes.h 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/behaviour/ClassTypeCodes.h 2014-07-26 23:55:29 UTC (rev 10332) @@ -130,108 +130,110 @@ T_SmartBuffer = 68, T_IdentityHashContents = 69, T_EqualityHashContents = 70, - T_Variable = 71, - T_VariableDictionary = 72, - T_VariableTerm = 73, - T_CompoundVariableTerm = 74, - T_StemVariableTerm = 75, - T_DotVariableTerm = 76, - T_IndirectVariableTerm = 77, - T_FunctionCallTerm = 78, - T_MessageSendTerm = 79, - T_UnaryOperatorTerm = 80, - T_BinaryOperatorTerm = 81, - T_LogicalTerm = 82, - T_Instruction = 83, - T_AddressInstruction = 84, - T_AssignmentInstruction = 85, - T_CallInstruction = 86, - T_DynamicCallInstruction = 87, - T_CallOnInstruction = 88, - T_CommandInstruction = 89, - T_SimpleDoInstruction = 90, - T_DoForeverInstruction = 91, - T_DoOverInstruction = 92, - T_DoOverUntilInstruction = 93, - T_DoOverWhileInstruction = 94, - T_ControlledDoInstruction = 95, - T_ControlledDoUntilInstruction = 96, - T_ControlledDoWhileInstruction = 97, - T_DoWhileInstruction = 98, - T_DoUntilInstruction = 99, - T_DoCountInstruction = 100, - T_DoCountUntilInstruction = 101, - T_DoCountWhileInstruction = 102, - T_DropInstruction = 103, - T_ElseInstruction = 104, - T_EndInstruction = 105, - T_EndIfInstruction = 106, - T_ExitInstruction = 107, - T_ExposeInstruction = 108, - T_ForwardInstruction = 109, - T_GuardInstruction = 110, - T_IfInstruction = 111, - T_CaseWhenInstruction = 112, - T_InterpretInstruction = 113, - T_LabelInstruction = 114, - T_LeaveInstruction = 115, - T_MessageInstruction = 116, - T_NopInstruction = 117, - T_NumericInstruction = 118, - T_OptionsInstruction = 119, - T_OtherwiseInstruction = 120, - T_ParseInstruction = 121, - T_ProcedureInstruction = 122, - T_QueueInstruction = 123, - T_RaiseInstruction = 124, - T_ReplyInstruction = 125, - T_ReturnInstruction = 126, - T_SayInstruction = 127, - T_SelectInstruction = 128, - T_SelectCaseInstruction = 129, - T_SignalInstruction = 130, - T_DynamicSignalInstruction = 131, - T_SignalOnInstruction = 132, - T_ThenInstruction = 133, - T_TraceInstruction = 134, - T_UseInstruction = 135, - T_ClassDirective = 136, - T_LibraryDirective = 137, - T_RequiresDirective = 138, - T_CompoundElement = 139, - T_ParseTrigger = 140, - T_ProgramSource = 141, - T_ArrayProgramSource = 142, - T_BufferProgramSource = 143, - T_FileProgramSource = 144, - T_NumberArray = 145, + T_MultiValueContents = 71, + T_StringHashContents = 72, + T_Variable = 73, + T_VariableDictionary = 74, + T_VariableTerm = 75, + T_CompoundVariableTerm = 76, + T_StemVariableTerm = 77, + T_DotVariableTerm = 78, + T_IndirectVariableTerm = 79, + T_FunctionCallTerm = 80, + T_MessageSendTerm = 81, + T_UnaryOperatorTerm = 82, + T_BinaryOperatorTerm = 83, + T_LogicalTerm = 84, + T_Instruction = 85, + T_AddressInstruction = 86, + T_AssignmentInstruction = 87, + T_CallInstruction = 88, + T_DynamicCallInstruction = 89, + T_CallOnInstruction = 90, + T_CommandInstruction = 91, + T_SimpleDoInstruction = 92, + T_DoForeverInstruction = 93, + T_DoOverInstruction = 94, + T_DoOverUntilInstruction = 95, + T_DoOverWhileInstruction = 96, + T_ControlledDoInstruction = 97, + T_ControlledDoUntilInstruction = 98, + T_ControlledDoWhileInstruction = 99, + T_DoWhileInstruction = 100, + T_DoUntilInstruction = 101, + T_DoCountInstruction = 102, + T_DoCountUntilInstruction = 103, + T_DoCountWhileInstruction = 104, + T_DropInstruction = 105, + T_ElseInstruction = 106, + T_EndInstruction = 107, + T_EndIfInstruction = 108, + T_ExitInstruction = 109, + T_ExposeInstruction = 110, + T_ForwardInstruction = 111, + T_GuardInstruction = 112, + T_IfInstruction = 113, + T_CaseWhenInstruction = 114, + T_InterpretInstruction = 115, + T_LabelInstruction = 116, + T_LeaveInstruction = 117, + T_MessageInstruction = 118, + T_NopInstruction = 119, + T_NumericInstruction = 120, + T_OptionsInstruction = 121, + T_OtherwiseInstruction = 122, + T_ParseInstruction = 123, + T_ProcedureInstruction = 124, + T_QueueInstruction = 125, + T_RaiseInstruction = 126, + T_ReplyInstruction = 127, + T_ReturnInstruction = 128, + T_SayInstruction = 129, + T_SelectInstruction = 130, + T_SelectCaseInstruction = 131, + T_SignalInstruction = 132, + T_DynamicSignalInstruction = 133, + T_SignalOnInstruction = 134, + T_ThenInstruction = 135, + T_TraceInstruction = 136, + T_UseInstruction = 137, + T_ClassDirective = 138, + T_LibraryDirective = 139, + T_RequiresDirective = 140, + T_CompoundElement = 141, + T_ParseTrigger = 142, + T_ProgramSource = 143, + T_ArrayProgramSource = 144, + T_BufferProgramSource = 145, + T_FileProgramSource = 146, + T_NumberArray = 147, - T_Last_Internal_Class = 145, + T_Last_Internal_Class = 147, - T_First_Transient_Class = 146, + T_First_Transient_Class = 148, - T_Memory = 146, - T_InternalStack = 147, - T_LiveStack = 148, - T_PushThroughStack = 149, - T_Activity = 150, - T_Activation = 151, - T_NativeActivation = 152, - T_ActivationFrameBuffer = 153, - T_Envelope = 154, - T_LanguageParser = 155, - T_Clause = 156, - T_Token = 157, - T_DoBlock = 158, - T_InterpreterInstance = 159, - T_SecurityManager = 160, - T_CommandHandler = 161, - T_MapBucket = 162, - T_MapTable = 163, + T_Memory = 148, + T_InternalStack = 149, + T_LiveStack = 150, + T_PushThroughStack = 151, + T_Activity = 152, + T_Activation = 153, + T_NativeActivation = 154, + T_ActivationFrameBuffer = 155, + T_Envelope = 156, + T_LanguageParser = 157, + T_Clause = 158, + T_Token = 159, + T_DoBlock = 160, + T_InterpreterInstance = 161, + T_SecurityManager = 162, + T_CommandHandler = 163, + T_MapBucket = 164, + T_MapTable = 165, - T_Last_Transient_Class = 163, - T_Last_Primitive_Class = 163, - T_Last_Class_Type = 163, + T_Last_Transient_Class = 165, + T_Last_Primitive_Class = 165, + T_Last_Class_Type = 165, } ClassTypeCode; Modified: sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviourNames.h =================================================================== --- sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviourNames.h 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviourNames.h 2014-07-26 23:55:29 UTC (rev 10332) @@ -120,6 +120,8 @@ #define TheSmartBufferBehaviour (&RexxBehaviour::primitiveBehaviours[T_SmartBuffer]) #define TheIdentityHashContentsBehaviour (&RexxBehaviour::primitiveBehaviours[T_IdentityHashContents]) #define TheEqualityHashContentsBehaviour (&RexxBehaviour::primitiveBehaviours[T_EqualityHashContents]) +#define TheMultiValueContentsBehaviour (&RexxBehaviour::primitiveBehaviours[T_MultiValueContents]) +#define TheStringHashContentsBehaviour (&RexxBehaviour::primitiveBehaviours[T_StringHashContents]) #define TheVariableBehaviour (&RexxBehaviour::primitiveBehaviours[T_Variable]) #define TheVariableDictionaryBehaviour (&RexxBehaviour::primitiveBehaviours[T_VariableDictionary]) #define TheVariableTermBehaviour (&RexxBehaviour::primitiveBehaviours[T_VariableTerm]) Modified: sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviours.cpp =================================================================== --- sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviours.cpp 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/behaviour/PrimitiveBehaviours.cpp 2014-07-26 23:55:29 UTC (rev 10332) @@ -130,6 +130,8 @@ RexxBehaviour(T_SmartBuffer, (PCPPM *)RexxObject::operatorMethods), RexxBehaviour(T_IdentityHashContents, (PCPPM *)RexxObject::operatorMethods), RexxBehaviour(T_EqualityHashContents, (PCPPM *)RexxObject::operatorMethods), + RexxBehaviour(T_MultiValueContents, (PCPPM *)RexxObject::operatorMethods), + RexxBehaviour(T_StringHashContents, (PCPPM *)RexxObject::operatorMethods), RexxBehaviour(T_Variable, (PCPPM *)RexxObject::operatorMethods), RexxBehaviour(T_VariableDictionary, (PCPPM *)RexxObject::operatorMethods), RexxBehaviour(T_VariableTerm, (PCPPM *)RexxObject::operatorMethods), Modified: sandbox/rick/newsource/interpreter/behaviour/PrimitiveClasses.xml =================================================================== --- sandbox/rick/newsource/interpreter/behaviour/PrimitiveClasses.xml 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/behaviour/PrimitiveClasses.xml 2014-07-26 23:55:29 UTC (rev 10332) @@ -118,6 +118,8 @@ <Class id="SmartBuffer" class="SmartBuffer" include="SmartBuffer.hpp"/> <Class id="IdentityHashContents" class="IdentityHashContents" include="HashContents.hpp"/> <Class id="EqualityHashContents" class="EqualityHashContents" include="HashContents.hpp"/> +<Class id="MultiValueContents" class="MultiValueContents" include="HashContents.hpp"/> +<Class id="StringHashContents" class="StringHashContents" include="HashContents.hpp"/> <Class id="Variable" class="RexxVariable" include="RexxVariable.hpp"/> <Class id="VariableDictionary" class="RexxVariableDictionary" include="RexxVariableDictionary.hpp"/> Modified: sandbox/rick/newsource/interpreter/behaviour/VirtualFunctionTable.cpp =================================================================== --- sandbox/rick/newsource/interpreter/behaviour/VirtualFunctionTable.cpp 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/behaviour/VirtualFunctionTable.cpp 2014-07-26 23:55:29 UTC (rev 10332) @@ -52,7 +52,7 @@ #include "RexxCore.h" - + #include "ObjectClass.hpp" #include "ClassClass.hpp" #include "ArrayClass.hpp" @@ -186,502 +186,505 @@ void *objectLoc = objectBuffer; // instantiate an instance of each class into the buffer and // grab the resulting virtual function table - + objectPtr = new (objectLoc) RexxObject(RESTOREIMAGE); virtualFunctionTable[T_Object] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_ObjectClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_Class] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_ClassClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ArrayClass(RESTOREIMAGE); virtualFunctionTable[T_Array] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_ArrayClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) DirectoryClass(RESTOREIMAGE); virtualFunctionTable[T_Directory] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_DirectoryClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInteger(RESTOREIMAGE); virtualFunctionTable[T_Integer] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxIntegerClass(RESTOREIMAGE); virtualFunctionTable[T_IntegerClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ListClass(RESTOREIMAGE); virtualFunctionTable[T_List] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_ListClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxMessage(RESTOREIMAGE); virtualFunctionTable[T_Message] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_MessageClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) MethodClass(RESTOREIMAGE); virtualFunctionTable[T_Method] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_MethodClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxNumberString(RESTOREIMAGE); virtualFunctionTable[T_NumberString] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_NumberStringClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) QueueClass(RESTOREIMAGE); virtualFunctionTable[T_Queue] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_QueueClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxStem(RESTOREIMAGE); virtualFunctionTable[T_Stem] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_StemClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxString(RESTOREIMAGE); virtualFunctionTable[T_String] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_StringClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxSupplier(RESTOREIMAGE); virtualFunctionTable[T_Supplier] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_SupplierClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) TableClass(RESTOREIMAGE); virtualFunctionTable[T_Table] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_TableClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) StringTable(RESTOREIMAGE); virtualFunctionTable[T_StringTable] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_StringTableClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RelationClass(RESTOREIMAGE); virtualFunctionTable[T_Relation] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_RelationClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxMutableBuffer(RESTOREIMAGE); virtualFunctionTable[T_MutableBuffer] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_MutableBufferClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxPointer(RESTOREIMAGE); virtualFunctionTable[T_Pointer] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_PointerClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxBuffer(RESTOREIMAGE); virtualFunctionTable[T_Buffer] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_BufferClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) WeakReference(RESTOREIMAGE); virtualFunctionTable[T_WeakReference] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_WeakReferenceClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RoutineClass(RESTOREIMAGE); virtualFunctionTable[T_Routine] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_RoutineClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) PackageClass(RESTOREIMAGE); virtualFunctionTable[T_Package] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_PackageClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxContext(RESTOREIMAGE); virtualFunctionTable[T_RexxContext] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_RexxContextClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) IdentityTable(RESTOREIMAGE); virtualFunctionTable[T_IdentityTable] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_IdentityTableClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) StackFrameClass(RESTOREIMAGE); virtualFunctionTable[T_StackFrame] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_StackFrameClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) SetClass(RESTOREIMAGE); virtualFunctionTable[T_Set] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_SetClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) BagClass(RESTOREIMAGE); virtualFunctionTable[T_Bag] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClass(RESTOREIMAGE); virtualFunctionTable[T_BagClass] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxNilObject(RESTOREIMAGE); virtualFunctionTable[T_NilObject] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxBehaviour(RESTOREIMAGE); virtualFunctionTable[T_Behaviour] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) MethodDictionary(RESTOREIMAGE); virtualFunctionTable[T_MethodDictionary] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ScopeTable(RESTOREIMAGE); virtualFunctionTable[T_ScopeTable] = getVftPointer(objectLoc); - - objectPtr = new (objectLoc) RexxSource(RESTOREIMAGE); - virtualFunctionTable[T_RexxSource] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) LibraryPackage(RESTOREIMAGE); virtualFunctionTable[T_LibraryPackage] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxCode(RESTOREIMAGE); virtualFunctionTable[T_RexxCode] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) NativeMethod(RESTOREIMAGE); virtualFunctionTable[T_NativeMethod] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) NativeRoutine(RESTOREIMAGE); virtualFunctionTable[T_NativeRoutine] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RegisteredRoutine(RESTOREIMAGE); virtualFunctionTable[T_RegisteredRoutine] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) CPPCode(RESTOREIMAGE); virtualFunctionTable[T_CPPCode] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) AttributeGetterCode(RESTOREIMAGE); virtualFunctionTable[T_AttributeGetterCode] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) AttributeSetterCode(RESTOREIMAGE); virtualFunctionTable[T_AttributeSetterCode] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ConstantGetterCode(RESTOREIMAGE); virtualFunctionTable[T_ConstantGetterCode] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) AbstractCode(RESTOREIMAGE); virtualFunctionTable[T_AbstractCode] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) SmartBuffer(RESTOREIMAGE); virtualFunctionTable[T_SmartBuffer] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) IdentityHashContents(RESTOREIMAGE); virtualFunctionTable[T_IdentityHashContents] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) EqualityHashContents(RESTOREIMAGE); virtualFunctionTable[T_EqualityHashContents] = getVftPointer(objectLoc); - + + objectPtr = new (objectLoc) MultiValueContents(RESTOREIMAGE); + virtualFunctionTable[T_MultiValueContents] = getVftPointer(objectLoc); + + objectPtr = new (objectLoc) StringHashContents(RESTOREIMAGE); + virtualFunctionTable[T_StringHashContents] = getVftPointer(objectLoc); + objectPtr = new (objectLoc) RexxVariable(RESTOREIMAGE); virtualFunctionTable[T_Variable] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxVariableDictionary(RESTOREIMAGE); virtualFunctionTable[T_VariableDictionary] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxSimpleVariable(RESTOREIMAGE); virtualFunctionTable[T_VariableTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxCompoundVariable(RESTOREIMAGE); virtualFunctionTable[T_CompoundVariableTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxStemVariable(RESTOREIMAGE); virtualFunctionTable[T_StemVariableTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxDotVariable(RESTOREIMAGE); virtualFunctionTable[T_DotVariableTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxVariableReference(RESTOREIMAGE); virtualFunctionTable[T_IndirectVariableTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxExpressionFunction(RESTOREIMAGE); virtualFunctionTable[T_FunctionCallTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxExpressionMessage(RESTOREIMAGE); virtualFunctionTable[T_MessageSendTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxUnaryOperator(RESTOREIMAGE); virtualFunctionTable[T_UnaryOperatorTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxBinaryOperator(RESTOREIMAGE); virtualFunctionTable[T_BinaryOperatorTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxExpressionLogical(RESTOREIMAGE); virtualFunctionTable[T_LogicalTerm] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstruction(RESTOREIMAGE); virtualFunctionTable[T_Instruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionAddress(RESTOREIMAGE); virtualFunctionTable[T_AddressInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionAssignment(RESTOREIMAGE); virtualFunctionTable[T_AssignmentInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionCall(RESTOREIMAGE); virtualFunctionTable[T_CallInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDynamicCall(RESTOREIMAGE); virtualFunctionTable[T_DynamicCallInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionCallOn(RESTOREIMAGE); virtualFunctionTable[T_CallOnInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionCommand(RESTOREIMAGE); virtualFunctionTable[T_CommandInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionSimpleDo(RESTOREIMAGE); virtualFunctionTable[T_SimpleDoInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoForever(RESTOREIMAGE); virtualFunctionTable[T_DoForeverInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoOver(RESTOREIMAGE); virtualFunctionTable[T_DoOverInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoOverUntil(RESTOREIMAGE); virtualFunctionTable[T_DoOverUntilInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoOverWhile(RESTOREIMAGE); virtualFunctionTable[T_DoOverWhileInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionControlledDo(RESTOREIMAGE); virtualFunctionTable[T_ControlledDoInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionControlledDoUntil(RESTOREIMAGE); virtualFunctionTable[T_ControlledDoUntilInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionControlledDoWhile(RESTOREIMAGE); virtualFunctionTable[T_ControlledDoWhileInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoWhile(RESTOREIMAGE); virtualFunctionTable[T_DoWhileInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoUntil(RESTOREIMAGE); virtualFunctionTable[T_DoUntilInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoCount(RESTOREIMAGE); virtualFunctionTable[T_DoCountInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoCountUntil(RESTOREIMAGE); virtualFunctionTable[T_DoCountUntilInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDoCountWhile(RESTOREIMAGE); virtualFunctionTable[T_DoCountWhileInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDrop(RESTOREIMAGE); virtualFunctionTable[T_DropInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionElse(RESTOREIMAGE); virtualFunctionTable[T_ElseInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionEnd(RESTOREIMAGE); virtualFunctionTable[T_EndInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionEndIf(RESTOREIMAGE); virtualFunctionTable[T_EndIfInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionExit(RESTOREIMAGE); virtualFunctionTable[T_ExitInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionExpose(RESTOREIMAGE); virtualFunctionTable[T_ExposeInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionForward(RESTOREIMAGE); virtualFunctionTable[T_ForwardInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionGuard(RESTOREIMAGE); virtualFunctionTable[T_GuardInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionIf(RESTOREIMAGE); virtualFunctionTable[T_IfInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionCaseWhen(RESTOREIMAGE); virtualFunctionTable[T_CaseWhenInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionInterpret(RESTOREIMAGE); virtualFunctionTable[T_InterpretInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionLabel(RESTOREIMAGE); virtualFunctionTable[T_LabelInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionLeave(RESTOREIMAGE); virtualFunctionTable[T_LeaveInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionMessage(RESTOREIMAGE); virtualFunctionTable[T_MessageInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionNop(RESTOREIMAGE); virtualFunctionTable[T_NopInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionNumeric(RESTOREIMAGE); virtualFunctionTable[T_NumericInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionOptions(RESTOREIMAGE); virtualFunctionTable[T_OptionsInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionOtherwise(RESTOREIMAGE); virtualFunctionTable[T_OtherwiseInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionParse(RESTOREIMAGE); virtualFunctionTable[T_ParseInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionProcedure(RESTOREIMAGE); virtualFunctionTable[T_ProcedureInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionQueue(RESTOREIMAGE); virtualFunctionTable[T_QueueInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionRaise(RESTOREIMAGE); virtualFunctionTable[T_RaiseInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionReply(RESTOREIMAGE); virtualFunctionTable[T_ReplyInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionReturn(RESTOREIMAGE); virtualFunctionTable[T_ReturnInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionSay(RESTOREIMAGE); virtualFunctionTable[T_SayInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionSelect(RESTOREIMAGE); virtualFunctionTable[T_SelectInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionSelectCase(RESTOREIMAGE); virtualFunctionTable[T_SelectCaseInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionSignal(RESTOREIMAGE); virtualFunctionTable[T_SignalInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionDynamicSignal(RESTOREIMAGE); virtualFunctionTable[T_DynamicSignalInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionSignalOn(RESTOREIMAGE); virtualFunctionTable[T_SignalOnInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionThen(RESTOREIMAGE); virtualFunctionTable[T_ThenInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionTrace(RESTOREIMAGE); virtualFunctionTable[T_TraceInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxInstructionUseStrict(RESTOREIMAGE); virtualFunctionTable[T_UseInstruction] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ClassDirective(RESTOREIMAGE); virtualFunctionTable[T_ClassDirective] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) LibraryDirective(RESTOREIMAGE); virtualFunctionTable[T_LibraryDirective] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RequiresDirective(RESTOREIMAGE); virtualFunctionTable[T_RequiresDirective] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) CompoundTableElement(RESTOREIMAGE); virtualFunctionTable[T_CompoundElement] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxTrigger(RESTOREIMAGE); virtualFunctionTable[T_ParseTrigger] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ProgramSource(RESTOREIMAGE); virtualFunctionTable[T_ProgramSource] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ArrayProgramSource(RESTOREIMAGE); virtualFunctionTable[T_ArrayProgramSource] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) BufferProgramSource(RESTOREIMAGE); virtualFunctionTable[T_BufferProgramSource] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) FileProgramSource(RESTOREIMAGE); virtualFunctionTable[T_FileProgramSource] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) NumberArray(RESTOREIMAGE); virtualFunctionTable[T_NumberArray] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxObject(RESTOREIMAGE); virtualFunctionTable[T_Memory] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) InternalStack(RESTOREIMAGE); virtualFunctionTable[T_InternalStack] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) LiveStack(RESTOREIMAGE); virtualFunctionTable[T_LiveStack] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) PushThroughStack(RESTOREIMAGE); virtualFunctionTable[T_PushThroughStack] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) Activity(RESTOREIMAGE); virtualFunctionTable[T_Activity] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxActivation(RESTOREIMAGE); virtualFunctionTable[T_Activation] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) NativeActivation(RESTOREIMAGE); virtualFunctionTable[T_NativeActivation] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) ActivationFrameBuffer(RESTOREIMAGE); virtualFunctionTable[T_ActivationFrameBuffer] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) Envelope(RESTOREIMAGE); virtualFunctionTable[T_Envelope] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) LanguageParser(RESTOREIMAGE); virtualFunctionTable[T_LanguageParser] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxClause(RESTOREIMAGE); virtualFunctionTable[T_Clause] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxToken(RESTOREIMAGE); virtualFunctionTable[T_Token] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) RexxDoBlock(RESTOREIMAGE); virtualFunctionTable[T_DoBlock] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) InterpreterInstance(RESTOREIMAGE); virtualFunctionTable[T_InterpreterInstance] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) SecurityManager(RESTOREIMAGE); virtualFunctionTable[T_SecurityManager] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) CommandHandler(RESTOREIMAGE); virtualFunctionTable[T_CommandHandler] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) MapBucket(RESTOREIMAGE); virtualFunctionTable[T_MapBucket] = getVftPointer(objectLoc); - + objectPtr = new (objectLoc) MapTable(RESTOREIMAGE); virtualFunctionTable[T_MapTable] = getVftPointer(objectLoc); - + }; Modified: sandbox/rick/newsource/interpreter/classes/StackFrameClass.cpp =================================================================== --- sandbox/rick/newsource/interpreter/classes/StackFrameClass.cpp 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/classes/StackFrameClass.cpp 2014-07-26 23:55:29 UTC (rev 10332) @@ -43,6 +43,7 @@ /******************************************************************************/ #include "RexxCore.h" #include "StackFrameClass.hpp" +#include "MethodArguments.hpp" RexxClass *StackFrameClass::classInstance = OREF_NULL; // singleton class instance Modified: sandbox/rick/newsource/interpreter/classes/StemClass.cpp =================================================================== --- sandbox/rick/newsource/interpreter/classes/StemClass.cpp 2014-07-26 18:59:02 UTC (rev 10331) +++ sandbox/rick/newsource/interpreter/classes/StemClass.cpp 2014-07-26 23:55:29 UTC (rev 10332) @@ -210,9 +210,9 @@ * * @param _value The new value to set. */ -void StemClass::setValue(RexxObject *_value) +void StemClass::setValue(RexxInternalObject *newValue) { - setField(value, _value); // set the new value + setField(value, newValue); // set the new value dropped = false; // now have an explict value } @@ -233,7 +233,7 @@ * * @return The default stem value. */ -RexxObject *StemClass::getStemValue() +RexxInternalObject *StemClass::getStemValue() { return value; } @@ -253,7 +253,7 @@ msgname = stringArgument(msgname, ARG_ONE); arguments = arrayArgument(arguments, ARG_TWO); // send the message on to our current value object - return value->sendMessage(msgname, arguments); + return ((RexxObject *)value)->sendMessage(msgname, arguments); } @@ -268,7 +268,7 @@ * * @return The compound variable lookup value. */ -RexxObject *StemClass::bracket(RexxObject **tailElements, size_t argCount) +RexxInternalObject *StemClass::bracket(RexxObject **tailElements, size_t argCount) { // no arguments just returns the default value if (argCount == 0) @@ -277,7 +277,7 @@ } // create a searchable tail, and perform the lookup CompoundVariableTail resolved_tail(tailElements, argCount); - return evaluateCompoundVariableValue(OREF_NULL, stemName, &resolved_tail); + return evaluateCompoundVariableValue(OREF_NULL, stemName, resolved_tail); } @@ -299,7 +299,7 @@ // compose the tail element CompoundVariableTail resolved_tail(tailElements, argCount); // see if we have a compound - CompoundTableElement *compound = findCompoundVariable(&resolved_tail); + CompoundTableElement *compound = findCompoundVariable(resolved_tail); // if there's a variable there, and it has a real value, then // this is true. return booleanObject(compound != OREF_NULL && compound->getVariableValue() != OREF_NULL); @@ -316,26 +316,26 @@ * @return The removed object. If nothing was removed, this returns * .nil. */ -RexxObject *StemClass::remove(RexxObject **tailElements, size_t argCount) +RexxInternalObject *StemClass::remove(RexxObject **tailElements, size_t argCount) { // if asked to remove the default value, reset this back to the name if (argCount == 0) { // replace with the name and return the old value. - RexxObject *oldValue = value; + RexxInternalObject *oldValue = value; setField(value, getName()); return oldValue; } // compose the tail element CompoundVariableTail resolved_tail(tailElements, argCount); - CompoundTableElement *compound = findCompoundVariable(&resolved_tail); + CompoundTableElement *compound = findCompoundVariable(resolved_tail); // if there's a variable there, and it has a real value, then // we have something to remove if (compound != OREF_NULL && compound->getVariableValue() != OREF_NULL) { // get the value, which is the return value, and drop the variable. - RexxObject *oldValue = compound->getVariableValue(); + RexxInternalObject *oldValue = compound->getVariableValue(); compound->drop(); return oldValue; } @@ -373,7 +373,7 @@ if (compound != OREF_NULL && compound->getVariableValue() != OREF_NULL) { // get the value, which is the return value, and drop the variable. - RexxObject *oldValue = compound->getVariableValue(); + RexxInternalObject *oldValue = compound->getVariableValue(); compound->drop(); return oldValue; } @@ -388,7 +388,7 @@ * * @return The tail name for the match, or .nil if it was not found. */ -RexxInternalObject *StemClass::index(RexxInternalObject *target) +RexxObject *StemClass::index(RexxInternalObject *target) { CompoundTableElement *variable = findByValue(target); if (variable != OREF_NULL) @@ -423,7 +423,7 @@ * * @return Returns nothing. */ -RexxInternalObject *StemClass::bracketEqual(RexxObject **tailElements, size_t argCount) +RexxObject *StemClass::bracketEqual(RexxObject **tailElements, size_t argCount) { // no value to set? This is an error @@ -437,7 +437,7 @@ if (argCount == 1) { // stem value as default? don't allow this as it leads to recursion loops - if (isOfClass(Stem, new_value)) + if (isOfClass(Stem, newValue)) { reportException(Error_Execution_nostem); } @@ -447,13 +447,13 @@ // explicit value. tails.clear(); dropped = false; - return value; + return OREF_NULL; } // create a searchable tail from the array elements // and set the variable value CompoundVariableTail resolved_tail(tailElements + 1, argCount - 1); - variable = getCompoundVariable(&resolved_tail); + CompoundTableElement *variable = getCompoundVariable(resolved_tail); variable->set(newValue); return OREF_NULL; } @@ -602,29 +602,33 @@ } } // let the default value handle everything else - value->sendMessage(OREF_REQUEST, makeclass, result); + ((RexxObject *)value)->sendMessage(OREF_REQUEST, makeclass, result); return result; } -CompoundTableElement *StemClass::getCompoundVariable( - CompoundVariableTail &name) /* tail name */ -/******************************************************************************/ -/* Function: Get an item from the variable dictionary, adding a new empty */ -/* variable entry if it wasn't found. */ -/******************************************************************************/ +/** + * Get an item from the variable dictionary, adding a new empty + * variable entry if it wasn't found. + * + * @param name The target tail name. + * + * @return The variable object corresponding to the the variable entry. + */ +CompoundTableElement *StemClass::getCompoundVariable(CompoundVariableTail &name) { - /* get/create an entry in the table */ return tails.findEntry(name, true)->realVariable(); } -CompoundTableElement *StemClass::exposeCompoundVariable( - CompoundVariableTail &name) /* tail name */ -/******************************************************************************/ -/* Function: Get an item from the variable dictionary, adding a new empty */ -/* variable entry if it wasn't found. */ -/******************************************************************************/ +/** + * Perform an expose operation on a Compound variable. + * + * @param name The compound tail name. + * + * @return The corresponding table element. + */ +CompoundTableElement *StemClass::exposeCompoundVariable(CompoundVariableTail &name) { // first see if the compound variable already exists. If it does, then // it might represent an explicitly dropped varaible. We leave this along @@ -639,199 +643,182 @@ // we're creating a real variable. If the stem has an explicit value, // then we need to set that now. variable = tails.findEntry(name, true)->realVariable(); - /* if this variable does not have a value, we need to check the */ - /* stem for a default value and assign it. */ - if (variable->getVariableValue() == OREF_NULL) { - if (!dropped) { /* stem have a default value? */ - variable->set(value); /* get the stem's value explicitly */ + // if this variable does not have a value, we need to check the + // stem for a default value and assign it. + if (variable->getVariableValue() == OREF_NULL) + { + if (!dropped) + { + variable->set(value); } } return variable; } -CompoundTableElement *StemClass::findCompoundVariable( - CompoundVariableTail &name) /* tail name */ -/******************************************************************************/ -/* Function: Get an item from the variable dictionary, without creating a */ -/* new variable if it doesn't exist. */ -/******************************************************************************/ +/** + * Get an item from the variable dictionary, without creating a + * new variable if it doesn't exist. + * + * @param name The target tail name. + * + * @return the target table element, or OREF_NULL if the variable doesn't exist. + */ +CompoundTableElement *StemClass::findCompoundVariable(CompoundVariableTail &name) { - /* get, but don't create an entry in the table */ + // get, but don't create an entry in the table CompoundTableElement *variable = tails.findEntry(name); if (variable != OREF_NULL) { - return variable->realVariable();/* return the real target */ + return variable->realVariable(); } return OREF_NULL; } -void StemClass::dropCompoundVariable( - CompoundVariableTail &name) /* tail name */ -/******************************************************************************/ -/* Function: Mark a variable as dropped. */ -/******************************************************************************/ +/** + * Mark a variable as dropped. + * + * @param name The target compound name. + */ +void StemClass::dropCompoundVariable(CompoundVariableTail &name) { - RexxVariable *variable = getCompoundVariable(name);/* look up this tail element */ - variable->drop(); /* drop the variable entry */ + RexxVariable *variable = getCompoundVariable(name); + variable->drop(); } -CompoundTableElement *StemClass::nextVariable( - NativeActivation *activation) /* Hosting Native Act. */ -/******************************************************************************/ -/* Function: Return the "next" variable of a variable traversal */ -/******************************************************************************/ +/** + * Set a new variable value + * + * @param name The target name. + * @param newValue The new value to assign. + */ +void StemClass::setCompoundVariable(CompoundVariableTail &name, RexxInternalObject *newValue) { - RexxObject *_value; /* variable value */ - - /* get the last saved stem */ - CompoundTableElement *variable = activation->compoundElement(); - - while (variable != OREF_NULL) - { /* while we have more to process */ - /* get the value */ - _value = variable->getVariableValue(); - if (_value != OREF_NULL) - { /* not a dropped variable? */ - activation->setCompoundElement(tails.next(variable)); - return variable; /* give this one back */ - } - variable = tails.next(variable); /* step to the next table item */ - } - /* clear out the saved element */ - activation->setCompoundElement(OREF_NULL); - activation->setNextStem(OREF_NULL); - - return OREF_NULL; /* return end of table indicator */ -} - -void StemClass::setCompoundVariable( - CompoundVariableTail &name, /* tail name */ - RexxObject *_value) /* value to assign to variable name */ -/******************************************************************************/ -/* Function: Set a new variable value */ -/******************************************************************************/ -{ - /* see if we have an entry for this */ CompoundTableElement *variable = getCompoundVariable(name); - variable->set(_value); /* and perform the set */ + variable->set(newValue); } + +/** + * Return all indices as an array + * + * @return An array of the assigned tails. + */ ArrayClass *StemClass::tailArray() -/******************************************************************************/ -/* Function: Return all indices as an array */ -/******************************************************************************/ { - CompoundTableElement *variable; /* table variable entry */ - ArrayClass *array; /* returned array */ - size_t count; /* count of variables */ + ArrayClass *array = new_array(items()); - array = new_array(items()); /* get the array */ - count = 1; /* start at the beginning again */ - - variable = tails.first(); /* get the first variable */ + CompoundTableElement *variable = tails.first(); + // do a tree traversal while (variable != OREF_NULL) - { /* while more values to process */ - /* this a real variable? */ + { + // skip dropped variables, we only want the assigned values if (variable->getVariableValue() != OREF_NULL) { - /* add to our array */ - array->put(variable->getName(), count++); + array->append(variable->getName()); } - variable = tails.next(variable); /* go get the next one */ + variable = tails.next(variable); } - return array; /* return the array item */ + return array; } -RexxObject *StemClass::evaluateCompoundVariableValue( - RexxActivation *context, /* the evaluation context (can be NULL) */ - RexxString *stemVariableName, // the stem variable name this was evaluated from (used for noValue) - CompoundVariableTail &resolved_tail) /* the search tail */ -/******************************************************************************/ -/* Function: Retrieve a compound variable, returning the default value if the*/ -/* variable does not exist. This includes NOVALUE handling. */ -/******************************************************************************/ + +/** + * Retrieve a compound variable, returning the default value if the + * variable does not exist. This includes NOVALUE handling. + * + * @param context The current execution context. + * @param stemVariableName + * The name of the stem variable (needed to compose default value) + * @param resolved_tail + * The resolved tail. + * + * @return The variable value. + */ +RexxInternalObject *StemClass::evaluateCompoundVariableValue(RexxActivation *context, RexxString *stemVariableName, CompoundVariableTail &resolved_tail) { - CompoundTableElement *variable; /* the real variable */ - RexxObject *_value; /* final variable value */ - RexxString *tail_name; /* formatted tail name */ - - /* get the compound variable */ - variable = findCompoundVariable(resolved_tail); + CompoundTableElement *variable = findCompoundVariable(resolved_tail); + // if we do not have a variable, then we need to sort out what the + // variable value nees to be if (variable == OREF_NULL) - { /* variable does not exist? */ - if (!dropped) /* stem have a default value? */ + { + // if the stem has been explicitly assigned avalue, then + // just return the stem default. This does not raise the + // NOVALUE condition. + if (!dropped) { - _value = this->value; /* get the stems value */ + return value; } + // need to compose the value from the stem name. else - { /* need to use name */ - /* create a string version of the name */ - tail_name = resolved_tail->createCompoundName(stemVariableName); + { + // create a compound name from the stem variable name and the resolved tail + RexxString *tail_name = resolved_tail.createCompoundName(stemVariableName); // the tail_name is the fully resolved variable, used for NOVALUE reporting. // the defaultValue is the value that's returned as the expression result, // which is derived from the stem object. - RexxObject *defaultValue = resolved_tail->createCompoundName(stemName); - /* take care of any novalue situations */ - _value = handleNovalue(context, tail_name, defaultValue, variable); + RexxInternalObject *defaultValue = resolved_tail.createCompoundName(stemVariableName); + // take care of any novalue situations + return handleNovalue(context, tail_name, defaultValue, variable); } } else { - /* get the variable value */ - _value = variable->getVariableValue(); - if (_value == OREF_NULL) - { /* explicitly dropped variable? */ - /* create a string version of the name */ - tail_name = resolved_tail->createCompoundName(stemName); + // get the variable value. If there is no value, we've been + // explicitly dropped so we need to do the novalue bit. + RexxInternalObject *varValue = variable->getVariableValue(); + if (varValue == OREF_NULL) + { + + RexxString *tail_name = resolved_tail.createCompoundName(stemVariableName); // the tail_name is the fully resolved variable, used for NOVALUE reporting. // the defaultValue is the value that's returned as the expression result, // which is derived from the stem object. - RexxObject *defaultValue = resolved_tail->createCompoundName(stemName); - /* take care of any novalue situations */ - _value = handleNovalue(context, tail_name, defaultValue, variable); + RexxInternalObject *defaultValue = resolved_tail.createCompoundName(stemVariableName); + // take care of any novalue situations + return handleNovalue(context, tail_name, defaultValue, variable); } + return varValue; } - return _value; /* and finally return the value */ } -RexxObject *StemClass::getCompoundVariableValue( - CompoundVariableTail &resolved_tail) /* the search tail */ -/******************************************************************************/ -/* Function: Retrieve a compound variable, returning the default value if the*/ -/* variable does not exist. This does NOT raise NOVALUE conditions*/ -/******************************************************************************/ +/** + * Retrieve a compound variable, returning the default value if the + * variable does not exist. This does NOT raise NOVALUE conditions + * + * @param resolved_tail + * The resolved compound tail. + * + * @return The variable value, or OREF_NULL if the variable is not set. + */ +RexxInternalObject *StemClass::getCompoundVariableValue(CompoundVariableTail &resolved_tail) { - CompoundTableElement *variable; /* the real variable */ - RexxObject *_value; /* final variable value */ - - /* get the compound variable */ - variable = findCompoundVariable(resolved_tail); + CompoundTableElement *variable = findCompoundVariable(resolved_tail); if (variable == OREF_NULL) - { /* variable does not exist? */ - if (!dropped) /* stem have a default value? */ + { + if (!dropped) { - return this->value; /* get the stems value */ + return value; } else - { /* need to use name */ - /* create a string version of the name */ - return(RexxObject *)resolved_tail->createCompoundName(stemName); + { + // we create the value using the stem object name, not the + // name of any variable we are attached to. + return resolved_tail.createCompoundName(stemName); } } else { - /* get the variable value */ - _value = variable->getVariableValue(); - if (_value == OREF_NULL) - { /* explicitly dropped variable? */ - /* create a string version of the name */ - _value = (RexxObject *)resolved_tail->createCompoundName(stemName); + // have a variable, now see if this has a value assigned. + RexxInternalObject *varValue = variable->getVariableValue(); + if (varValue == OREF_NULL) + { + return resolved_tail.createCompoundName(stemName); } + return varValue; } - return _value; /* and finally return the value */ } @@ -847,7 +834,7 @@ * @return The variable value, or OREF_NULL if the variable does not * have an explicit value. */ -RexxObject *StemClass::getCompoundVariableRealValue(CompoundVariableTail &resolved_tail) +RexxInternalObject *StemClass::getCompoundVariableRealValue(CompoundVariableTail &resolved_tail) { // first resolve the compound variable. RexxVariable *variable = findCompoundVariable(resolved_tail); @@ -869,49 +856,54 @@ } - -RexxObject *StemClass::realCompoundVariableValue( - CompoundVariableTail &resolved_tail) /* the search tail */ -/******************************************************************************/ -/* Function: Retrieve a compound variable, returning the default value if the*/ -/* variable does not exist. This does not handle NOVALUEs. */ -/******************************************************************************/ +/** + * Retrieve a compound variable, returning the default value if the + * variable does not exist. This does not handle NOVALUEs. + * + * @param resolved_tail + * The resolved tail. + * + * @return The real assigned value (no default processing) + */ +RexxInternalObject *StemClass::realCompoundVariableValue(CompoundVariableTail &resolved_tail) { - CompoundTableElement *variable; /* the real variable */ - - /* get the compound variable */ - variable = findCompoundVariable(resolved_tail); + CompoundTableElement *variable = findCompoundVariable(resolved_tail); + // if no variable found, then its value is either an explictly set stem + // value or nothing. if (variable == OREF_NULL) - { /* variable does not exist? */ - if (!dropped) /* stem have a default value? */ + { + if (!dropped) { - return this->value; /* get the stems value */ + return value; } else - { ... [truncated message content] |