private String createRuntimeSource(RuntimeModel model, String baseClassName, boolean scriptInDocs) { if (scriptInDocs) { throw new RuntimeException("Do no know how to clean the block comments yet"); } SourceWriter writer = new SourceWriter(model); writer.setScript(stripComments(theScript)); writer.setBaseClassName(baseClassName); scriptModel.write(writer); return writer.getSource(); }
@Override public void exitScript(ScriptContext ctx) { StatementList stmts = getAsType(ctx.body(), StatementList.class); GlobalVars globals = initBlockContext == null ? new GlobalVars() : getAsType(initBlockContext, GlobalVars.class); GlobalScope globalScope = (GlobalScope) scopes.get(ctx); Set<String> sourceImages = globalScope.getByType(Symbol.Type.SOURCE_IMAGE); Set<String> destImages = globalScope.getByType(Symbol.Type.DEST_IMAGE); this.script = new Script(options, sourceImages, destImages, globals, stmts); set(ctx, this.script); }
@Override public void exitScript(ScriptContext ctx) { StatementList stmts = getAsType(ctx.body(), StatementList.class); GlobalVars globals = initBlockContext == null ? new GlobalVars() : getAsType(initBlockContext, GlobalVars.class); GlobalScope globalScope = (GlobalScope) scopes.get(ctx); Set<String> sourceImages = globalScope.getByType(Symbol.Type.SOURCE_IMAGE); Set<String> destImages = globalScope.getByType(Symbol.Type.DEST_IMAGE); this.script = new Script(options, sourceImages, destImages, globals, stmts); set(ctx, this.script); }
private String createRuntimeSource(RuntimeModel model, String baseClassName, boolean scriptInDocs) { if (scriptInDocs) { throw new RuntimeException("Do no know how to clean the block comments yet"); } SourceWriter writer = new SourceWriter(model); writer.setScript(stripComments(theScript)); writer.setBaseClassName(baseClassName); scriptModel.write(writer); return writer.getSource(); }
script.write(writer);