public static void main(String[] args) throws FileNotFoundException {
new DumpExamplesMain(new File(args[0])).run();
}
public void run() throws FileNotFoundException {
StandardLibraryBuilder stdLib = new StandardLibraryBuilder();
for (Example example : Arrays.asList(
new Example(stdLib) {
@Override
public void createProgram(Controller controller) {}
},
new ArithmeticExample(stdLib),
new HelloWorldExample(stdLib),
new ControlFlowExample(stdLib))) {
Workspace workspace = new Workspace();
Controller controller = new Controller(workspace, new VertexCreatingVisitor());
stdLib.build(controller);
example.createProgram(controller);
for (SerializationFormat serializationFormat : Arrays.asList(DOT, TXT)) {
String outFileName = example.getClass().getName() + "."
+ serializationFormat.name().toLowerCase();