frysk.value
Class ArrayType

java.lang.Object
  extended by frysk.value.Type
      extended by frysk.value.ArrayType

public class ArrayType
extends Type

Type for an array.


Constructor Summary
ArrayType(Type type, int size, ArrayList dimensions)
          Create an ArrayType XXX: dimensions needs to be a set of ranges; this upper bound is sooooo confusing.
 
Method Summary
 boolean completeMember(String incomplete, List candidates)
          Complete the type's member; return false if nothing completed.
 Value dereference(Value var1, ByteBuffer taskMem)
          Dereference operation on array type.
 ArithmeticUnit getALU(int wordSize)
           
 ArithmeticUnit getALU(IntegerType type, int wordSize)
           
 ArithmeticUnit getALU(PointerType type, int wordSize)
           
 ArithmeticUnit getALU(Type type, int wordSize)
           
 Type getSliceType()
          Get the type of slice.
 Type getType()
          Return the element type for array or pointer type.
 Value index(Value v, Value idx, ByteBuffer taskMem)
          Index Operation on array V and index IDX.
 Value slice(Value v, Value i, Value j, ByteBuffer taskMem)
          Slice returns a slice of an array.
 void toPrint(StringBuilder stringBuilder, int indent)
          Print this Type after indenting INDENT spaces.
 String toString()
          For debugging and tracing; just dump the Type's name.
 
Methods inherited from class frysk.value.Type
addressOf, completeFollowSym, getALU, getALU, getName, getSize, getUltimateType, member, pack, toPrint, toPrintBrief
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayType

public ArrayType(Type type,
                 int size,
                 ArrayList dimensions)
Create an ArrayType XXX: dimensions needs to be a set of ranges; this upper bound is sooooo confusing.

Parameters:
typep - - Type of each array element
dimensions - - ArrayList of dimension upper bounds.
Method Detail

toString

public String toString()
Description copied from class: Type
For debugging and tracing; just dump the Type's name.

Overrides:
toString in class Type

getType

public Type getType()
Description copied from class: Type
Return the element type for array or pointer type.

Overrides:
getType in class Type

index

public Value index(Value v,
                   Value idx,
                   ByteBuffer taskMem)
Index Operation on array V and index IDX.

Overrides:
index in class Type
Parameters:
taskMem - - unused here.

slice

public Value slice(Value v,
                   Value i,
                   Value j,
                   ByteBuffer taskMem)
Slice returns a slice of an array. For example: SLICE[1:2] on {9, 8, 7, 6} returns {8, 7} SLICE[1:2] on { {11, 11}, {0, 0}, {9, 9} } returns { {0, 0}, {9, 9} } Note: j should be greater than i.

Overrides:
slice in class Type

getSliceType

public Type getSliceType()
Description copied from class: Type
Get the type of slice.

Overrides:
getSliceType in class Type

dereference

public Value dereference(Value var1,
                         ByteBuffer taskMem)
Dereference operation on array type.

Overrides:
dereference in class Type

toPrint

public void toPrint(StringBuilder stringBuilder,
                    int indent)
Description copied from class: Type
Print this Type after indenting INDENT spaces.

Specified by:
toPrint in class Type
Parameters:
stringBuilder - TODO

getALU

public ArithmeticUnit getALU(Type type,
                             int wordSize)
Overrides:
getALU in class Type

getALU

public ArithmeticUnit getALU(IntegerType type,
                             int wordSize)
Overrides:
getALU in class Type

getALU

public ArithmeticUnit getALU(PointerType type,
                             int wordSize)
Overrides:
getALU in class Type

getALU

public ArithmeticUnit getALU(int wordSize)
Overrides:
getALU in class Type

completeMember

public boolean completeMember(String incomplete,
                              List candidates)
Description copied from class: Type
Complete the type's member; return false if nothing completed.

Overrides:
completeMember in class Type