Changes for try/catch handling

This commit is contained in:
rogerl@netscape.com
1999-04-16 02:54:56 +00:00
parent 4d9b383818
commit 500afc1787
5 changed files with 120 additions and 10 deletions
+25 -4
View File
@@ -2,12 +2,33 @@
import java.util.Stack;
class JSStack {
Stack stack = new Stack();
void push(StackValue value)
int frameTop;
void newFrame(StackValue returnAddress)
{
stack.push(value);
stack.push(returnAddress);
stack.push(new StackValue(frameTop));
frameTop = stack.size();
}
StackValue popFrame()
{
stack.setSize(frameTop);
StackValue oldFrame = (StackValue)(stack.pop());
frameTop = oldFrame.i;
return (StackValue)stack.pop();
}
void push(StackValue v)
{
stack.push(v);
}
boolean isEmpty()
{
return stack.isEmpty();
}
StackValue pop()