Class ASTPulseNode
java.lang.Object
|
+----SimpleNode
|
+----ASTPulseNode
- public class ASTPulseNode
- extends SimpleNode
A node on the parse tree that evaluates a pulse function
-
ASTPulseNode(int)
-
-
interpret()
- Interpret (evaluate) the two children of this node and replace the 2
values at the top of the stack with 1 if the absolute value of
the second is less than the first and 0 otherwise.
ASTPulseNode
public ASTPulseNode(int id)
interpret
public void interpret()
- Interpret (evaluate) the two children of this node and replace the 2
values at the top of the stack with 1 if the absolute value of
the second is less than the first and 0 otherwise. This gives
the pulse(x,y) = 1 if abs(x) < abs(y) and 0 otherwise.
- Overrides:
- interpret in class SimpleNode