Building Parsers with Java

sjm.examples.sling
Class NegativeAssembler

java.lang.Object
  |
  +--sjm.parse.Assembler
        |
        +--sjm.examples.sling.NegativeAssembler

public class NegativeAssembler
extends Assembler

Pop the assembly, and push a new function that multiplies this function by -1.


Constructor Summary
NegativeAssembler()
           
 
Method Summary
 void workOn(Assembly a)
          Push the point (-1, -1), and ask an Arithmetic "times" object to work on the assembly.
 
Methods inherited from class sjm.parse.Assembler
elementsAbove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NegativeAssembler

public NegativeAssembler()
Method Detail

workOn

public void workOn(Assembly a)
Push the point (-1, -1), and ask an Arithmetic "times" object to work on the assembly. The arithmetic function will pop the point and will pop whatever function was on top of the stack previously. The arithmetic function will then form a multiplication function from these elements and push this new function.
Overrides:
workOn in class Assembler
Parameters:
Assembly - the assembly to work on

by Steve Metsker