Ejemplo n.º 1
0
 /**
  * Pops two terms, constructs an Evaluation from these terms, and pushes it.
  *
  * @param Assembly the assembly to work on
  */
 public void workOn(Assembly a) {
   Term second = (Term) a.pop();
   Term first = (Term) a.pop();
   a.push(new Evaluation(first, second));
 }
Ejemplo n.º 2
0
 /** Demonstrate that this utility class does not loop. */
 public static void main(String args[]) {
   IParser e = new MidiParser().expression();
   Assembly out = e.bestMatch(new TokenAssembly("111 - (11 - 1)"));
   System.out.println(out.pop());
 }