frysk.value
Class TypeDecorator

java.lang.Object
  extended by frysk.value.Type
      extended by frysk.value.TypeDecorator
Direct Known Subclasses:
ConstType, PackedType, ReferenceType, RestrictType, SharedType, TypeDef, VolatileType

abstract class TypeDecorator
extends Type

Type decorator class, so that a base or composite type can be decorated with various attributes.


Field Summary
private  Type decorated
           
 
Constructor Summary
TypeDecorator(String name, Type decorated)
           
 
Method Summary
(package private)  void assign(Location location, Value value)
          Assign VALUE to LOCATION; possibly performing type-conversion.
 int getSize()
           
 Type getUltimateType()
          Return the ultimate type (ignoring any decorator and other attributes).
 Value index(Value var1, Value var2, ByteBuffer taskMem)
          Implements subscript operation for a pointer or array type.
 Value member(Value var1, String member)
          Implements dot operation on a composite type.
 Type pack(int bitSize, int bitOffset)
          Pack this TYPE into bigSize and bitOffset.
 Value slice(Value var1, Value var2, Value var3, ByteBuffer taskMem)
          Implements slice operation for a pointer or array type - slice the array from index I to index J.
(package private)  void toPrint(PrintWriter writer, Location location, ByteBuffer memory, Format format, int indent)
          Print Location as Type in user-readable form; use Format to print basic types.
 void toPrint(StringBuilder stringBuilder, int indent)
          A guess; sub classes should override.
 void toPrintBrief(StringBuilder stringBuilder, int indent)
          Print this Type, possibly briefly, 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, completeMember, dereference, getALU, getALU, getALU, getALU, getALU, getALU, getName, getSliceType, getType, toPrint, toPrint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

decorated

private Type decorated
Constructor Detail

TypeDecorator

TypeDecorator(String name,
              Type decorated)
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

getUltimateType

public Type getUltimateType()
Description copied from class: Type
Return the ultimate type (ignoring any decorator and other attributes).

Overrides:
getUltimateType in class Type

getSize

public int getSize()
Overrides:
getSize in class Type

toPrint

void toPrint(PrintWriter writer,
             Location location,
             ByteBuffer memory,
             Format format,
             int indent)
Description copied from class: Type
Print Location as Type in user-readable form; use Format to print basic types. If needed, and when memory is non-NULL, it can be used for dereferencing pointers. Indent before printing.

Specified by:
toPrint in class Type

toPrint

public void toPrint(StringBuilder stringBuilder,
                    int indent)
A guess; sub classes should override.

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

toPrintBrief

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

Overrides:
toPrintBrief in class Type
Parameters:
stringBuilder - TODO

assign

void assign(Location location,
            Value value)
Description copied from class: Type
Assign VALUE to LOCATION; possibly performing type-conversion.

Overrides:
assign in class Type

pack

public Type pack(int bitSize,
                 int bitOffset)
Description copied from class: Type
Pack this TYPE into bigSize and bitOffset.

Overrides:
pack in class Type

member

public Value member(Value var1,
                    String member)
Description copied from class: Type
Implements dot operation on a composite type.

Overrides:
member in class Type

index

public Value index(Value var1,
                   Value var2,
                   ByteBuffer taskMem)
Description copied from class: Type
Implements subscript operation for a pointer or array type.

Overrides:
index in class Type

slice

public Value slice(Value var1,
                   Value var2,
                   Value var3,
                   ByteBuffer taskMem)
Description copied from class: Type
Implements slice operation for a pointer or array type - slice the array from index I to index J.

Overrides:
slice in class Type