frysk.value
Class ArithmeticType

java.lang.Object
  extended by frysk.value.Type
      extended by frysk.value.ArithmeticType
Direct Known Subclasses:
FloatingPointType, IntegerType

public abstract class ArithmeticType
extends Type

Type for a arithmetic.


Field Summary
private  ByteOrder order
           
 
Constructor Summary
protected ArithmeticType(String name, ByteOrder order, int size)
           
 
Method Summary
 Value assign(Value var1, Value var2)
           
(package private) abstract  BigFloatingPoint bigFloatingPointValue(Location location)
          Return the arthmetic type converted to a BigFloatingPoint, this may involve truncation and/or rounding.
(package private) abstract  BigInteger bigIntegerValue(Location location)
          Return the arthmetic type converted to a BigInteger, this may involve truncation and/or rounding.
(package private)  Value createValue(BigFloatingPoint val)
          Create a new Value of THIS Type, initialized to VAL.
(package private)  Value createValue(BigInteger val)
          Create a new Value of THIS Type, initialized to VAL.
 Value createValue(double val)
          Create a new Value of THIS Type, initialized to VAL.
 Value createValue(float val)
          Create a new Value of THIS Type, initialized to VAL.
 Value createValue(long val)
          Create a new Value of THIS type, initialized to the long VAL.
(package private) abstract  BigFloatingPoint getBigFloatingPoint(Location location)
          Return the entire location, interpreting the raw bytes as a floating-point value.
(package private) abstract  BigInteger getBigInteger(Location location)
          Return the entire location, interpreting it as a big integer.
 ByteOrder order()
           
(package private) abstract  void putBigFloatingPoint(Location location, BigFloatingPoint val)
          Re-write the entire location with the big floating point value.
(package private) abstract  void putBigInteger(Location location, BigInteger val)
          Re-write the entire location with the big integer value.
 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, assign, completeFollowSym, completeMember, dereference, getALU, getALU, getALU, getALU, getALU, getALU, getName, getSize, getSliceType, getType, getUltimateType, index, member, pack, slice, toPrint, toPrint, toPrint, toPrintBrief
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

order

private final ByteOrder order
Constructor Detail

ArithmeticType

protected ArithmeticType(String name,
                         ByteOrder order,
                         int size)
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

order

public ByteOrder order()

assign

public Value assign(Value var1,
                    Value var2)

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

createValue

public Value createValue(float val)
Create a new Value of THIS Type, initialized to VAL. This is a convenience method for creating a simple arithmetic type from a constant. In general code should be creating a Value using a Type and a Location.


createValue

public Value createValue(double val)
Create a new Value of THIS Type, initialized to VAL. This is a convenience method for creating a simple arithmetic type from a constant. In general code should be creating a Value using a Type and a Location.


createValue

Value createValue(BigInteger val)
Create a new Value of THIS Type, initialized to VAL.


createValue

Value createValue(BigFloatingPoint val)
Create a new Value of THIS Type, initialized to VAL.


createValue

public Value createValue(long val)
Create a new Value of THIS type, initialized to the long VAL. This is a convenience method for creating a simple arithmetic type from a constant. In general code should be creating a Value using a Type and a Location.


getBigInteger

abstract BigInteger getBigInteger(Location location)
Return the entire location, interpreting it as a big integer. This does not do type-conversion. The underlying type determines if the the value is signed or unsigned.


getBigFloatingPoint

abstract BigFloatingPoint getBigFloatingPoint(Location location)
Return the entire location, interpreting the raw bytes as a floating-point value.


bigFloatingPointValue

abstract BigFloatingPoint bigFloatingPointValue(Location location)
Return the arthmetic type converted to a BigFloatingPoint, this may involve truncation and/or rounding.


putBigInteger

abstract void putBigInteger(Location location,
                            BigInteger val)
Re-write the entire location with the big integer value. This does not do type conversion. The underlying type determines if the value should be zero or sign extended.


putBigFloatingPoint

abstract void putBigFloatingPoint(Location location,
                                  BigFloatingPoint val)
Re-write the entire location with the big floating point value. This does not do type conversion. The underlying type determines if the value should be zero or sign extended.


bigIntegerValue

abstract BigInteger bigIntegerValue(Location location)
Return the arthmetic type converted to a BigInteger, this may involve truncation and/or rounding.