Building Parsers with Java

sjm.examples.logic
Class ArithmeticAssembler

java.lang.Object
  |
  +--sjm.parse.Assembler
        |
        +--sjm.examples.logic.ArithmeticAssembler

public class ArithmeticAssembler
extends Assembler

This assembler pops two arithmetic operands, builds an ArithmeticOperator from them, and pushes it.


Field Summary
protected  char operator
          the character which represents an arithmetic operator
 
Constructor Summary
ArithmeticAssembler(char operator)
          Constructs an assembler that will stack an ArithmeticOperator with the specified operator.
 
Method Summary
 void workOn(Assembly a)
          Pop two arithmetic operands, build an ArithmeticOperator from them, and push it.
 
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
 

Field Detail

operator

protected char operator
the character which represents an arithmetic operator
Constructor Detail

ArithmeticAssembler

public ArithmeticAssembler(char operator)
Constructs an assembler that will stack an ArithmeticOperator with the specified operator.
Method Detail

workOn

public void workOn(Assembly a)
Pop two arithmetic operands, build an ArithmeticOperator from them, and push it.
Overrides:
workOn in class Assembler
Parameters:
Assembly - the assembly to work on

by Steve Metsker