uk.co.badgersinfoil.jactionscript.analysis
Class Operand

java.lang.Object
  |
  +--uk.co.badgersinfoil.jactionscript.analysis.Operand

public class Operand
extends java.lang.Object

Data on which Actions operate, either arguments poped of the emulated stack, or results pushed back onto it.

The value of an operand may not be known, as the analysis isn't able to determine the the result of actions in many cases. knownValue() should be checked before using the operand's value.

Actionscript's 'undefined' value may be a source of confusion, because 'undefined' is a concrete, knowm value, making it different from an Operand whose value is 'unknown'.


Nested Class Summary
static class Operand.ASType
           
 
Constructor Summary
Operand()
           
 
Method Summary
 Operand.ASType getType()
           
 java.lang.Object getValue()
           
 boolean knownType()
           
 boolean knownValue()
           
static Operand mkboolean()
           
static Operand mkboolean(boolean b)
           
static Operand mkboolean(java.lang.Boolean b)
           
static Operand mkdouble(java.lang.Double d)
           
static Operand mkfloat(float f)
           
static Operand mkfloat(java.lang.Float f)
           
static Operand mkinteger(int i)
           
static Operand mkinteger(java.lang.Integer i)
           
static Operand mknull()
           
static Operand mkstring(java.lang.String s)
           
static Operand mkundefined()
           
static Operand mkunderrun()
          Build a stack entry which is the result of poping from an empty stack.
static Operand mkunknown()
           
 void setType(Operand.ASType type)
           
 void setValue(java.lang.Object val)
           
 java.lang.String toString()
           
 void unsetType()
           
 void unsetValue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Operand

public Operand()
Method Detail

knownValue

public boolean knownValue()

knownType

public boolean knownType()

setValue

public void setValue(java.lang.Object val)

setType

public void setType(Operand.ASType type)

getValue

public java.lang.Object getValue()

getType

public Operand.ASType getType()

unsetValue

public void unsetValue()

unsetType

public void unsetType()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

mkundefined

public static Operand mkundefined()

mknull

public static Operand mknull()

mkunknown

public static Operand mkunknown()

mkunderrun

public static Operand mkunderrun()
Build a stack entry which is the result of poping from an empty stack. Currently a synonym for mkunknown().


mkstring

public static Operand mkstring(java.lang.String s)

mkinteger

public static Operand mkinteger(int i)

mkinteger

public static Operand mkinteger(java.lang.Integer i)

mkfloat

public static Operand mkfloat(float f)

mkfloat

public static Operand mkfloat(java.lang.Float f)

mkboolean

public static Operand mkboolean(boolean b)

mkboolean

public static Operand mkboolean(java.lang.Boolean b)

mkboolean

public static Operand mkboolean()

mkdouble

public static Operand mkdouble(java.lang.Double d)