Building Parsers with Java

sjm.examples.logic
Class ListAssembler

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

public class ListAssembler
extends Assembler

Pops the terms of a list from an assembly's stack, builds the list, and pushes it.


Constructor Summary
ListAssembler()
           
 
Method Summary
 void workOn(Assembly a)
          Pops the terms of a list from an assembly's stack, builds the list, and pushes 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
 

Constructor Detail

ListAssembler

public ListAssembler()
Method Detail

workOn

public void workOn(Assembly a)
Pops the terms of a list from an assembly's stack, builds the list, and pushes it.

This method expects a series of terms to lie on top of a stack, with an open bracket token lying beneath. If there is no '[' marker, this class will throw an EmptistackException.

Overrides:
workOn in class Assembler
Parameters:
Assembly - the assembly to work on

by Steve Metsker