pldi3
Interface Rp


public abstract interface Rp

Simple reverse polish interpreter.


Method Summary
 void add()
          pop the top two elements, add them and push the result
 void divide()
          pop the top two elements, divide the former second from top by the former top and push the result
 void load(int regno)
          Push the numbered register onto the stack
 void max()
          replace the top two elements by their maximum
 void min()
          replace the top two stack elements by their minimum
 void multiply()
          pop the top two elements, multiply them and push the result
 float popf()
          Pop the stack as a float
 int popi()
          Pop the stack as an integer
 void push(float f)
          Push a float onto the stack
 void push(int i)
          Push an integer onto the stack
 void sqrt()
          replace the top of stack by its square root
 void store(int regno)
          Pop the stack and store the result in the numbered register
 void subtract()
          pop the top two elements, subtract the former top from the former second from top and push the result
 

Method Detail

push

public void push(int i)
Push an integer onto the stack

push

public void push(float f)
Push a float onto the stack

popf

public float popf()
Pop the stack as a float

popi

public int popi()
Pop the stack as an integer

store

public void store(int regno)
Pop the stack and store the result in the numbered register

load

public void load(int regno)
Push the numbered register onto the stack

add

public void add()
pop the top two elements, add them and push the result

subtract

public void subtract()
pop the top two elements, subtract the former top from the former second from top and push the result

multiply

public void multiply()
pop the top two elements, multiply them and push the result

divide

public void divide()
pop the top two elements, divide the former second from top by the former top and push the result

min

public void min()
replace the top two stack elements by their minimum

sqrt

public void sqrt()
replace the top of stack by its square root

max

public void max()
replace the top two elements by their maximum



View My Stats