I.e., allow array ops with pointers (and conversely) pointer ops on arrays vis: print array[0] print *array print *pointer print pointer[0]
Dereferencing arrays with * requires word size, word size passed to ALU from expression evaluator. Commit: Implement *(array + index), Call add(), plusEquals() directly from expression evaluator. frysk-core/frysk/value/ChangeLog 2007-11-05 Teresa Thomas <tthomas@redhat.com> * TestValue.java: Update. * ArithmeticUnit.java (plusEqual): New. * ArithmeticType.java (add): Delete. (plusEqual): Delete. * Type.java (add): Delete. (plusEqual): Delete. * TestArray.java (testAdd): New test. * AddressUnit.java (AddressUnit(ArrayType, int wordSize)): New. (addArray): New. * ArrayType.java (getALU): Give wordSize to ALU. * FloatingPointType.java (getALU): Ditto. * IntegerType.java (getALU): Ditto. * PointerType.java (getALU): Ditto. * Type.java (getALU): Ditto. * TypeDecorator.java (add): Delete. (plusEqual): Delete. frysk-core/frysk/expr/ChangeLog 2007-11-05 Teresa Thomas <tthomas@redhat.com> * CExprEvaluator.g (PLUS): Use getALU. (PLUSEQUAL): Use getALU. * ScratchSymTab.java (getWordSize): Return bogus word size when no task attached.
Implement [] operator for pointers to string. frysk-core/frysk/value/ChangeLog 2007-11-05 Teresa Thomas <tthomas@redhat.com> * Type.java (index): Task memory added to parameter list. * PointerType.java (index): New. * TypeDecorator.java (index): Updated. * TestArray.java (testIndexOneD): Updated. (testIndexTwoD): Updated. * TestPointer.java (testCharPointerIndex): New test. * ArrayType.java (dereference): Comments added. frysk-core/frysk/expr/ChangeLog 2007-11-05 Teresa Thomas <tthomas@redhat.com> * CExprEvaluator.g (INDEX): Update.
Fixed.