package org.oakgp.util;

import java.io.IOException;
import java.util.Scanner;

import org.oakgp.node.Node;
import org.oakgp.serialize.NodeReader;

public class Repl {
	public static void main(String[] args) throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			System.out.print("> ");
			String input = scanner.nextLine();
			Node expression = new NodeReader(input).readNode();
			Object result = expression.evaluate(null);
			System.out.println(result);
		}
	}
}

@@ -73,16 +73,102 @@
 anner;%0A%0A
+import org.oakgp.Assignments;%0Aimport org.oakgp.NodeSimplifier;%0Aimport org.oakgp.Type;%0A
 import o
@@ -225,16 +225,55 @@
 eReader;
+%0Aimport org.oakgp.serialize.NodeWriter;
 %0A%0Apublic
@@ -391,16 +391,81 @@
 em.in);%0A
+%09%09Assignments assignments = Assignments.createAssignments(2, 3);%0A
 %09%09while 
@@ -583,41 +583,274 @@
 nput
-).readNode();%0A%09%09%09Object result = 
+, Type.INTEGER, Type.INTEGER).readNode();%0A%09%09%09Node simplifiedResult = new NodeSimplifier().simplify(expression);%0A%09%09%09System.out.println(new NodeWriter().writeNode(expression));%0A%09%09%09System.out.println(new NodeWriter().writeNode(simplifiedResult));%0A%09%09%09System.out.println(
 expr
@@ -869,12 +869,20 @@
 ate(
-null
+assignments)
 );%0A%09
@@ -906,14 +906,46 @@
 tln(
-result
+simplifiedResult.evaluate(assignments)
 );%0A%09

print simplified version