|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elang.smallcaps.SmallcapsActivation
Untamed: The state of one activation frame in a Smallcaps call stack.
XXX This is an incomplete, broken reference implementation -- fix me!
Field Summary | |
private static ClassDesc |
BooleanGuard
Needed from branching |
private static ClassDesc |
EListGuard
Needed for list-pattern matching. |
private byte[] |
myCode
|
private EvalContext |
myCtx
|
private SmallcapsHandler[] |
myHandlerStack
|
private int |
myHandlerTOS
|
private Object[] |
myOperandStack
|
private int |
myPC
|
private int |
myTOS
The top of the operand stack. |
Fields inherited from interface org.erights.e.elang.smallcaps.SmallcapsOps |
ADDR_FRAME, ADDR_FRAME_SLOT, ADDR_LITERAL, ADDR_LOCAL, ADDR_LOCAL_SLOT, ADDR_OUTER_SLOT, OP_ASSIGN, OP_BIND, OP_BIND_SLOT, OP_BRANCH, OP_CALL, OP_CALL_ONLY, OP_CDR_PATT, OP_CHAR, OP_DUP, OP_EJECTOR, OP_EJECTOR_ONLY, OP_END_HANDLER, OP_FALSE, OP_FLOAT64, OP_JUMP, OP_LIST_PATT, OP_NEG_INT, OP_NOUN, OP_NULL, OP_OBJECT, OP_POP, OP_RETURN, OP_ROT, OP_SCOPE, OP_SEND, OP_SEND_ONLY, OP_SLOT, OP_STRING, OP_SWAP, OP_TRUE, OP_TRY, OP_TWINE, OP_UNWIND, OP_WHOLE_NUM |
Constructor Summary | |
SmallcapsActivation(byte[] code,
int pc,
EvalContext ctx)
Enabled: |
Method Summary | |
Object |
eval()
Enabled: |
private void |
handle(Object problem)
Handle the problem using the top handler on the handler stack. |
private void |
handle(OneArgFunc optEjector,
Object problem)
Handle the problem using optEjector, if it's not null, or the top handler on the handler stack if optEjector is null. |
private OneArgFunc |
makeEjector(int label)
|
private OneArgFunc |
makeEjectorOnly(int label)
|
private Object |
pop()
|
private void |
popHandler()
|
private Object[] |
popN(int n)
|
private void |
push(Object operand)
|
private void |
pushHandler()
|
private void |
pushHandler(OneArgFunc ejector)
|
private void |
pushTryHandler(int label)
|
private char |
readChar()
|
private double |
readFloat64()
|
private int |
readLabel()
|
private String |
readUTF()
|
private int |
readWholeInt()
|
private BigInteger |
readWholeNum()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final ClassDesc EListGuard
private static final ClassDesc BooleanGuard
private final byte[] myCode
private int myPC
private final Object[] myOperandStack
private int myTOS
private final SmallcapsHandler[] myHandlerStack
private int myHandlerTOS
private final EvalContext myCtx
Constructor Detail |
public SmallcapsActivation(byte[] code, int pc, EvalContext ctx)
Method Detail |
private void push(Object operand)
private Object pop()
private Object[] popN(int n)
n
- How many to pop
private void handle(Object problem)
problem
- private void handle(OneArgFunc optEjector, Object problem)
optEjector may include user-defined behavior. If optEjector returns normally, then invoke the top handler on the handler stack to handle this inappropriate return.
optEjector
- problem
- private void popHandler()
private void pushHandler()
private void pushHandler(OneArgFunc ejector)
ejector
- private void pushTryHandler(int label)
label
- private OneArgFunc makeEjectorOnly(int label)
private OneArgFunc makeEjector(int label)
private BigInteger readWholeNum()
SmallcapsEncoderVisitor#writeWholeNum(BigInteger)
private int readWholeInt()
SmallcapsEncoderVisitor#writeWholeNum(int)
private int readLabel()
private String readUTF()
private char readChar()
private double readFloat64()
public Object eval()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |