summaryrefslogtreecommitdiff
path: root/Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java
diff options
context:
space:
mode:
authorGeonoTRON2000 <geono@thegt.org>2014-05-03 11:43:27 -0700
committerGeonoTRON2000 <geono@thegt.org>2014-05-03 11:43:27 -0700
commit7d73e5f3a8bb951d69724090461d7038957be2e4 (patch)
treeb521685625ebff0674bd3d7f2374da60ce0836c7 /Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java
parent18ef4f2b18d9a5d305c0c6df9902b6599cdaab5c (diff)
downloadshenanigans-7d73e5f3a8bb951d69724090461d7038957be2e4.tar.gz
Added serializability and a class to export example programs.
Diffstat (limited to 'Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java')
-rw-r--r--Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java b/Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java
index d898bd4..ec6b300 100644
--- a/Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java
+++ b/Shenanigans/src/org/archphantom/shenanigans/examples/AddIt.java
@@ -16,7 +16,7 @@ import org.archphantom.shenanigans.elements.variables.VarTable;
public class AddIt {
- public static void main (String[] args) {
+ public static Program buildExample () {
ArrayList<Expression> list = new ArrayList<Expression>();
ArrayList<String> argnames = new ArrayList<String>();
argnames.add("x");
@@ -34,10 +34,11 @@ public class AddIt {
Namespace main = new Namespace("main", group, new VarTable());
Hashtable<String, Namespace> namespaces = new Hashtable<String, Namespace>();
namespaces.put("main", main);
- Program p = new Program(namespaces);
- System.out.println("Running...");
- p.run();
- System.out.println("Ran...");
+ return new Program(namespaces);
+ }
+
+ public static void main (String[] args) {
+ buildExample().run();
}
}