From 7d73e5f3a8bb951d69724090461d7038957be2e4 Mon Sep 17 00:00:00 2001 From: GeonoTRON2000 Date: Sat, 3 May 2014 11:43:27 -0700 Subject: Added serializability and a class to export example programs. --- .../src/org/archphantom/shenanigans/examples/ShiftIt.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Shenanigans/src/org/archphantom/shenanigans/examples/ShiftIt.java') diff --git a/Shenanigans/src/org/archphantom/shenanigans/examples/ShiftIt.java b/Shenanigans/src/org/archphantom/shenanigans/examples/ShiftIt.java index 1d56397..783dd9f 100644 --- a/Shenanigans/src/org/archphantom/shenanigans/examples/ShiftIt.java +++ b/Shenanigans/src/org/archphantom/shenanigans/examples/ShiftIt.java @@ -25,7 +25,7 @@ import org.archphantom.shenanigans.elements.variables.VarTable; public class ShiftIt { - public static void main (String[] args) { + public static Program buildExample () { ArrayList list = new ArrayList(); ArrayList argnames = new ArrayList(); argnames.add("a"); @@ -52,8 +52,11 @@ public class ShiftIt { Namespace main = new Namespace("main", group, new VarTable()); Hashtable namespaces = new Hashtable(); namespaces.put("main", main); - Program p = new Program(namespaces); - p.run(); + return new Program(namespaces); + } + + public static void main (String[] args) { + buildExample().run(); } } -- cgit v1.2.3