Author: dda
Date: 2008-02-05 07:50:55 -0800 (Tue, 05 Feb 2008)
New Revision: 7961
Added:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
Log:
Change 20080205-dda-C by [EMAIL PROTECTED] on 2008-02-05 10:35:45 EST
in /Users/dda/laszlo/src/svn/openlaszlo/branches/devildog
for http://svn.openlaszlo.org/openlaszlo/branches/devildog
Summary: Split SWF9Generator in preparation for mixin work
New Features:
Bugs Fixed: LPP-5266 (partial)
Technical Reviewer: ptw (pending)
QA Reviewer: hminsky (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
No functional changes!
SWF9Generator was too big, now split into SWF9Generator.java containing
the node visitor, and SWF9External, containing everything to do with
emitting code for the external compiler, compiling it, etc.
Added javadoc for most methods and classes.
A couple name changes:
flexCompile -> compileTranslationUnits
writeOutputFile -> writeFile (as the file is also input for the compiler)
ExternalGeneratorError* -> ExternalCompilerError*
Removed an unused function and an unused method arg.
Tests:
Henry's hello app
smoketest, lzpix, weather for both SWF8 and DHTML.
Added:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
Property changes on:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
===================================================================
---
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
2008-02-05 15:45:07 UTC (rev 7960)
+++
openlaszlo/branches/devildog/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
2008-02-05 15:50:55 UTC (rev 7961)
@@ -40,21 +40,18 @@
*/
public static final boolean DEBUG_OUTPUT = true;
- // TODO: [2007-12-12 dda] make USE_COMPILER_DEBUG_FLAG a compiler option.
- /**
- * When set, use the debug flag for the compiler
- */
- public static final boolean USE_COMPILER_DEBUG_FLAG = true;
-
/** The user 'main' class, which extends LFCApplication */
public final static String MAIN_APP_CLASSNAME = "LzApplication";
/** The LFC 'main' class, which extends nothing */
public final static String MAIN_LIB_CLASSNAME = "LFCApplication";
- /** Number of errors shown before truncating */
- static public final int MAX_ERRORS_SHOWN = 50;
+ /** The first part of a every emitted javascript file */
+ public static final String DEFAULT_FILE_PREAMBLE = "package {\n";
+ /** The final part of a every emitted javascript file */
+ public static final String DEFAULT_FILE_EPILOG = "}\n";
+
/**
* Saved program node, to show during debugging
*/
@@ -150,6 +147,12 @@
return node;
}
+ /**
+ * Intercept JavascriptGenerator version.
+ * SWF9 does super calls 'normally' just by keeping the super keyword.
+ * Other runtimes transform super into a runtime calculation of the
+ * proper class to use.
+ */
public SimpleNode visitSuperCallExpression(SimpleNode node, boolean
isReferenced, SimpleNode[] children) {
for (int i = 0, len = children.length ; i < len; i++) {
children[i] = visitStatement(children[i]);
@@ -270,66 +273,18 @@
}
}
- // Get the bytes in a file
- public byte[] getBytes(String filename)
- throws IOException
- {
- File f = new File(filename);
- long len = f.length();
-
- // Passing around byte arrays has limitations.
- if (len > Integer.MAX_VALUE)
- throw new IOException(filename + ": output too large");
-
- byte[] result = new byte[(int)len];
- int pos = 0;
-
- FileInputStream fis = null;
- try {
- fis = new FileInputStream(filename);
- while (pos < len) {
- int nbytes = fis.read(result, pos, (int)len - pos);
- if (nbytes < 0) {
- // premature end of file. File.length() lied or the
- // length of the file changed out from under us.
- // Either way, we cannot trust it.
- throw new IOException(filename + ": file size discrepency byte " +
- pos + "/" + len);
- }
- pos += nbytes;
- }
- // Sanity check, make sure file hasn't been appended to
- if (fis.read() != -1)
- throw new IOException(filename + ": file growing during read at byte "
+
- pos);
- }
- finally {
- closeit(fis);
- }
- return result;
- }
-
- public void show(InputStream is, String name)
- throws IOException
- {
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
- String line;
- int count=0;
- while ((line = reader.readLine()) != null) {
- if (count == 0)
- System.out.println(name);
- System.out.println(line);
- count++;
- }
- reader.close();
- }
-
+ /** Global variable seen by the generator.
+ * Global definitions must go into their own output file.
+ */
public static class GlobalVariable {
String name;
String type;
String initializer;
}
+ /** If a global has already been seen, make sure
+ * that we don't have a conflict of initialization values.
+ */
private String checkGlobalValue(String valueName, String curval, String
newval, String emsg) {
if (curval != null && newval != null && !curval.equals(newval))
throw new CompilerError(valueName + ": variable declared twice with " +
@@ -341,6 +296,9 @@
return newval;
}
+ /**
+ * Add this global variable to our private list.
+ */
private void addGlobalVar(String name, String type, String initializer)
{
GlobalVariable glovar = (GlobalVariable)programVars.get(name);
@@ -357,504 +315,9 @@
}
}
- private File tempdir = null;
- public File getCompilationTempDir()
- {
- if (tempdir == null) {
-
- // TODO: [2007-11-20 dda] Need some provisions for file
- // cleanup on error, and on success too.
-
- try {
- String tmpdirstr = System.getProperty("java.io.tmpdir");
- String swf9tmpdirstr = tmpdirstr + File.separator + "lzswf9";
- (new File(swf9tmpdirstr)).mkdirs();
-
- File f = File.createTempFile("lzgen", "", new File(swf9tmpdirstr));
- if (!f.delete())
- throw new CompilerError("getCompilationTempDir: temp file does not
exist");
- if (!f.mkdir())
- throw new CompilerError("getCompilationTempDir: cannot make
tempdir");
- tempdir = f;
- }
- catch (IOException ioe) {
- throw new CompilerError("getCompilationTempDir: cannot get temp
directory: " + ioe);
- }
-
- }
- return tempdir;
- }
-
- public void closeit(InputStream is)
- {
- try {
- if (is != null)
- is.close();
- }
- catch (IOException ioe) {
- // don't rethrow, we can live with an error during cleanup
- // TODO: [2007-11-20 dda] log this
- System.err.println("Exception closing: " + ioe);
- }
- }
-
- public void closeit(OutputStream os)
- {
- try {
- if (os != null)
- os.close();
- }
- catch (IOException ioe) {
- // don't rethrow, we can live with an error during cleanup
- // TODO: [2007-11-20 dda] log this
- System.err.println("Exception closing: " + ioe);
- }
- }
-
- public static class OutputCollector extends Thread {
-
- private Exception exception = null;
- private InputStream is;
-
- // we don't expect this to be terribly big, can fit in memory
- StringBuffer sb = new StringBuffer();
-
- public OutputCollector(InputStream is) {
- this.is = is;
- }
-
- public void run() {
- try {
- BufferedReader reader = new BufferedReader(new InputStreamReader(is));
- String line;
- while ((line = reader.readLine()) != null) {
- sb.append(line + "\n");
- collect(line);
- }
- reader.close();
- }
- catch (Exception ex) {
- exception = ex;
- }
- }
-
- public String getOutput() {
- return sb.toString();
- }
- public Exception getException() {
- return exception;
- }
- public void collect(String str) {
- // this version does no more analysis with the output
- }
- }
-
- public static class ExternalGeneratorError {
- private int origlinenum = -1;
- private int linenum;
- private int colnum;
- private String error;
- private String code = "";
- private String cleanedCode = "";
- private String orig = "";
- private TranslationUnit tunit;
-
- ExternalGeneratorError() {
- this(null, -1, -1, "", "");
- }
-
- ExternalGeneratorError(TranslationUnit tunit, int linenum, int colnum,
String error, String orig) {
- this.tunit = tunit;
- this.linenum = linenum;
- this.colnum = colnum;
- this.error = error;
- }
-
- public String toString() {
- String tunitstr = (tunit == null) ? "unknown" : tunit.getName();
- return "External error: " + tunitstr + ": " + linenum + ": " +
- colnum + ": " + error + ": for line:\n" + code;
- }
-
- public int getLineNumber() {
- return linenum;
- }
-
- // returns just the compiler error: e.g.
- // Error: variable 'x' undefined
- public String getErrorString() {
- return error;
- }
-
- // returns the complete the compiler error: e.g.
- // Error: variable 'x' undefined
- // result = x + 4;
- // ^
- public String originalErrorString() {
- return orig + "\n" + code;
- }
-
- // returns the complete the compiler error,
- // but without the positional 'caret', and
- // an indication of where the code starts,
- // other than just a newline. This is
- // meant to be read in the browser.
- // Error: variable 'x' undefined, in line: result = x + 4;
- // Compare this with originalErrorString().
- public String cleanedErrorString() {
- String result = orig.trim();
- if (result.endsWith("."))
- result = result.substring(0, orig.length() - 1);
- result += ", in line: " + cleanedCode;
- return result;
- }
-
- public void addCodeLine(String str) {
- if (code.length() > 0) {
- code += "\n";
- }
- code += str;
-
- // In cleanedCode, don't keep lines with just spaces and caret (^)
- if (!str.matches("^[ ^]*$")) {
- if (cleanedCode.length() > 0) {
- cleanedCode += "\n";
- }
- cleanedCode += str;
- }
- }
-
- public String getCode() {
- return code;
- }
-
- public String getCleanedCode() {
- return cleanedCode;
- }
-
- public TranslationUnit getTranslationUnit() {
- return tunit;
- }
-
- }
-
- public static int safeInt(String s)
- {
- try {
- return Integer.parseInt(s);
- }
- catch (NumberFormatException nfe) {
- // should be 'impossible' as the pattern matcher should only
- // give us valid numbers.
- throw new CompilerError("Bad linenumber translation: " + s);
- }
- }
-
- public static class ExternalGeneratorErrorCollector extends OutputCollector {
-
- private String inputFilename;
- private Pattern errPattern;
- private List errors = new ArrayList();
- private ExternalGeneratorError lastError = null;
- private TranslationUnit[] tunits;
- private String tempdir;
-
- // we don't expect this to be terribly big, can fit in memory
- StringBuffer sb = new StringBuffer();
-
-
- public ExternalGeneratorErrorCollector(InputStream is, List tunits, String
tempdir) {
- super(is);
- this.inputFilename = inputFilename;
- this.tunits = (TranslationUnit[])tunits.toArray(new TranslationUnit[0]);
- this.tempdir = tempdir;
-
- // Expect errors to look like File.as(48): col: 1 Error: some message
-
- String pat = "([^.]+)\\.as\\(([0-9]+)\\): *col: *([0-9]*) *(.*)";
- errPattern = Pattern.compile(pat);
- //System.out.println("Using error pattern: " + pat);
- }
-
- public TranslationUnit locateTranslationUnit(String nm)
- {
- // remove temporary directory from path
- int pos;
- if ((pos = nm.indexOf(tempdir)) >= 0) {
- nm = nm.substring(pos + tempdir.length());
- while (nm.length() > 0 && nm.charAt(0) == '/')
- nm = nm.substring(1);
- }
-
- for (int i=0; i<tunits.length; i++) {
- if (nm.equals(tunits[i].getName()))
- return tunits[i];
- }
- return null;
- }
-
- public void collect(String str) {
-
- // We expect errors from this compiler to start with the file name.
- // anything else is just showing us the contents of the line.
-
- Matcher matcher = errPattern.matcher(str);
- if (matcher.find()) {
- String classnm = matcher.group(1);
- String linenumstr = matcher.group(2);
- String colstr = matcher.group(3);
- TranslationUnit tunit = locateTranslationUnit(classnm);
- lastError = new ExternalGeneratorError(tunit, safeInt(linenumstr),
- safeInt(colstr),
- matcher.group(4),
- str);
- errors.add(lastError);
- }
- else {
- if (lastError == null) {
- System.err.println("Stray error string from external compiler: " +
str);
- // Capture it in an error message not tied to a particular line
- lastError = new ExternalGeneratorError();
- }
- lastError.addCodeLine(str);
- }
- }
-
- public List getErrors() {
- return errors;
- }
- }
-
- public static boolean useUnixQuoting() {
- String osname = System.getProperty("os.name");
- return !osname.startsWith("Windows");
- }
-
- /**
- * Return a more nicely formatted command line.
- * On UNIX systems, we change '$' to \$' so the
- * output line can be cut and pasted into a shell.
+ /** Implements CodeGenerator.
+ * Call the unparser to separate the program into translation units.
*/
- public String prettyCommand(List cmd)
- {
- String cmdstr = "";
- for (Iterator iter = cmd.iterator(); iter.hasNext(); ) {
- if (cmdstr.length() > 0)
- cmdstr += " ";
-
- String arg = (String)iter.next();
- if (useUnixQuoting()) {
-
- // goodness, both $ and \ are special characters for regex.
- arg = arg.replaceAll("[$]", "\\\\\\$");
- if (arg.indexOf(' ') >= 0) {
- arg = "\"" + arg + "\"";
- }
- }
- cmdstr += arg;
- }
- return cmdstr;
- }
-
- public void execCompileCommand(List cmd, String dir, List tunits,
- String outfileName)
- throws IOException // TODO: [2007-11-20 dda] clean up, why catch
only some exceptions?
- {
- String[] cmdstr = (String[])cmd.toArray(new String[0]);
- String prettycmd = prettyCommand(cmd);
- System.err.println("Executing compiuler: (cd " + dir + "; " + prettycmd +
")");
- String bigErrorString = "";
- int bigErrorCount = 0;
-
- if (DEBUG_OUTPUT) {
- String buildsh = "#!/bin/sh\n";
- buildsh += "cd " + dir + "\n";
- buildsh += prettycmd + "\n";
- emitFile(tempdir + File.separator + "build.sh", buildsh);
- }
-
- Process proc = Runtime.getRuntime().exec(cmdstr, null, new File(dir));
- try {
- OutputStream os = proc.getOutputStream();
- OutputCollector outcollect = new OutputCollector(proc.getInputStream());
- ExternalGeneratorErrorCollector errcollect = new
ExternalGeneratorErrorCollector(proc.getErrorStream(), tunits, dir);
- os.close();
- outcollect.start();
- errcollect.start();
- int exitval = proc.waitFor();
- outcollect.join();
- errcollect.join();
-
- if (outcollect.getException() != null) {
- System.err.println("Error collecting compiler output: " +
outcollect.getException());
- // TODO: [2007-11-20 dda] log this
- }
- String compilerOutput = outcollect.getOutput();
- if (compilerOutput.length() > 0) {
- System.err.println("compiler output:\n" + compilerOutput);
- }
-
- if (errcollect.getException() != null) {
- System.err.println("Error collecting compiler output: " +
errcollect.getException());
- // TODO: [2007-11-20 dda] log this
- }
- List errs = errcollect.getErrors();
- if (errs.size() > 0) {
- System.err.println("ERRORS: ");
- for (Iterator iter = errs.iterator(); iter.hasNext(); ) {
- ExternalGeneratorError err = (ExternalGeneratorError)iter.next();
- TranslationUnit tunit = err.getTranslationUnit();
- String srcLineStr;
- int srcLine;
-
- // actualSrcLine is the name/linenumber of the actual files
- // used in compilation, not the original sources.
- String actualSrcFile = null;
- if (tunit == null) {
- actualSrcFile = "(unknown)";
- }
- else {
- actualSrcFile = tunit.getSourceFileName();
- if (actualSrcFile == null)
- actualSrcFile = "(" + tunit.getName() + ")";
- }
- String actualSrcLine = actualSrcFile + ": " + err.getLineNumber();
- if (tunit == null ||
- ((srcLine = tunit.originalLineNumber(err.getLineNumber())) <=
0)) {
- srcLineStr = "[" + actualSrcLine + "]";
- }
- else {
- // For now, we also show the actual source file/line
- srcLineStr = String.valueOf(srcLine) +
- " [" + actualSrcLine + "]";
- }
- String errorSummary = srcLineStr +
- ": " + err.getErrorString() +
- "\n " + err.originalErrorString();
- System.err.println("Compiler error: at " + srcLineStr + ": " +
- err.getErrorString() + "\n " +
- err.originalErrorString());
- bigErrorCount++;
- if (bigErrorCount < MAX_ERRORS_SHOWN) {
- bigErrorString += srcLineStr + ": " +
- err.getErrorString() + "\n " +
- err.cleanedErrorString();
- }
- else if (bigErrorCount == 50) {
- bigErrorString += ".... more than " + MAX_ERRORS_SHOWN +
- " errors, additional errors not shown.\n";
- }
- }
- }
-
- if (exitval != 0) {
- System.err.println("FAIL: compiler returned " + exitval);
- }
- }
- catch (InterruptedException ie) {
- throw new CompilerError("Interrupted compiler");
- }
- System.err.println("Done executing compiler");
- if (!new File(outfileName).exists()) {
- System.err.println("Intermediate file " + outfileName + ": does not
exist");
- // TODO: [2008-1-17 dda] remove this transitional code in a couple months
- if (((String)cmd.get(0)).indexOf("mxmlc") >= 0) {
- throw new CompilerError("Errors from compiler - change
compiler.swf9.lib.builder property in lps.properties to use compc rather than
mxmlc?");
- }
- if (bigErrorString.length() > 0) {
- throw new CompilerError(bigErrorString);
- }
- else {
- throw new CompilerError("Errors from compiler, output file not
created");
- }
- }
- }
-
- public static String getLPSPathname(String propname) {
- String path = LPS.getProperty(propname);
- if (path == null)
- throw new CompilerError("missing \"" + propname + "\" property in LPS
properties file");
- if (!(new File(path)).isAbsolute()) {
- path = LPS.getLFCDirectory() + File.separator + path;
- }
- return path;
- }
-
- public static boolean getLPSBoolean(String propname, boolean defaultValue) {
- String valueString = LPS.getProperty(propname);
- if (valueString == null)
- return defaultValue;
-
- return Boolean.getBoolean(valueString);
- }
-
- public static String getLFCLibrary() {
- return LPS.getLFCDirectory() + File.separator + "LFC9.swc";
- }
-
- public byte[] flexCompile(List tunits, String tempdir, String apptype)
- throws IOException
- {
- boolean buildSharedLibrary =
options.getBoolean(Compiler.BUILD_SHARED_LIBRARY);
- assert (apptype != null && !buildSharedLibrary) : "application class type
never set";
-
- String builderCmd;
- String outfilebase;
-
- if (buildSharedLibrary) {
- outfilebase = "app.swc";
- builderCmd = getLPSPathname("compiler.swf9.lib.builder");
- }
- else {
- outfilebase = "app.swf";
- builderCmd = getLPSPathname("compiler.swf9.app.builder");
- }
- String outfilename = tempdir + File.separator + outfilebase;
- boolean swf9Warnings = getLPSBoolean("compiler.swf9.warnings", true);
-
- List cmd = new ArrayList();
- cmd.add(builderCmd);
- if (!swf9Warnings) {
- cmd.add("-compiler.show-actionscript-warnings=false");
- }
-
- cmd.add("-compiler.source-path+=.");
- if (USE_COMPILER_DEBUG_FLAG) {
- cmd.add("-debug=true");
- }
- cmd.add("-output");
- cmd.add(outfilebase);
-
- if (!buildSharedLibrary) {
- cmd.add("-default-size");
- cmd.add(options.get(Compiler.CANVAS_WIDTH, "800"));
- cmd.add(options.get(Compiler.CANVAS_HEIGHT));
- cmd.add("-library-path+=" + getLFCLibrary());
- }
- else {
- // must be last before list of classes to follow.
- cmd.add("-include-classes");
- }
-
- for (Iterator iter = tunits.iterator(); iter.hasNext(); ) {
- TranslationUnit tunit = (TranslationUnit)iter.next();
-
- // For the application, we just list the main .as file
- // For a library, we list all the classes.
- if (!buildSharedLibrary) {
- if (tunit.isMainTranslationUnit()) {
- cmd.add(tunit.getName()+".as");
- }
- }
- else {
- cmd.add(tunit.getName());
- }
- }
-
- execCompileCommand(cmd, tempdir, tunits, outfilename);
- return getBytes(outfilename);
- }
-
public List makeTranslationUnits(SimpleNode translatedNode, boolean
compress, boolean obfuscate)
{
boolean buildSharedLibrary =
options.getBoolean(Compiler.BUILD_SHARED_LIBRARY);
@@ -864,110 +327,19 @@
return (new SWF9ParseTreePrinter(compress, obfuscate, mainClass,
buildSharedLibrary)).makeTranslationUnits(translatedNode);
}
- public void writeOutputFile(TranslationUnit tunit, String pre, String post) {
- String name = tunit.getName();
- String body = tunit.getContents();
- String infilename = tempdir + File.separator + name + ".as";
- tunit.setSourceFileName(infilename);
-
- if (options.getBoolean(Compiler.PROGRESS)) {
- System.err.println("Creating: " + infilename);
- }
-
- FileOutputStream fos = null;
-
- try {
- fos = new FileOutputStream(infilename);
- fos.write(pre.getBytes());
- fos.write(body.getBytes());
- fos.write(post.getBytes());
- fos.close();
- }
- catch (IOException ioe) {
- System.err.println("Exception in postprocessing, file=" + infilename +
": " + ioe);
- throw new CompilerError("Exception creating files for external
compilation: " + ioe);
- }
- finally {
- closeit(fos);
- }
- }
-
- public static final String DEFAULT_FILE_PREAMBLE = "package {\n";
- public static final String DEFAULT_FILE_EPILOG = "}\n";
-
- // This is used for debugging only, so errors are ignored.
- public interface TextEmitter {
- void emit(Writer writer)
- throws IOException;
- }
-
- public static void emitFile(String filename, TextEmitter tw) {
- FileWriter writer = null;
- try {
- File f = new File(filename);
- f.delete();
- writer = new FileWriter(f);
- tw.emit(writer);
- writer.close();
- writer = null;
- }
- catch (IOException ioe) {
- System.err.println("Cannot write to " + filename);
- if (writer != null) {
- try {
- writer.close();
- }
- catch (IOException ioe2) {
- // ignored.
- }
- }
- }
- }
-
- public static void emitFile(String filename, final String txt) {
- emitFile(filename, new TextEmitter() {
- public void emit(Writer writer)
- throws IOException {
- writer.write(txt);
- }
- });
- }
-
- public static void emitFile(String filename, final SimpleNode node) {
- emitFile(filename, new TextEmitter() {
- public void emit(Writer writer)
- throws IOException {
- nodeFileDump(writer, "", node);
- }
- });
- }
-
- public static void nodeFileDump(Writer writer, String prefix, SimpleNode
node)
- throws IOException
- {
- writer.write(node.toString(prefix) + "\n");
- SimpleNode[] children = node.getChildren();
- if (children != null) {
- for (int i = 0; i < children.length; ++i) {
- SimpleNode n = (SimpleNode)children[i];
- if (n != null) {
- nodeFileDump(writer, prefix + " ", n);
- }
- }
- }
- }
-
+ /** Implements CodeGenerator.
+ * Push each TranslationUnit into a file and call the compiler.
+ */
public byte[] postProcess(List tunits)
{
- String tempdir = getCompilationTempDir().getPath();
boolean hasErrors = false;
- String apptype = null;
boolean buildSharedLibrary =
options.getBoolean(Compiler.BUILD_SHARED_LIBRARY);
+ SWF9External ex = new SWF9External(options);
if (DEBUG_OUTPUT) {
- emitFile(tempdir + File.separator + "source.txt", savedSource);
- emitFile(tempdir + File.separator + "program.txt", (new
SWF9ParseTreePrinter()).text(savedProgram));
- emitFile(tempdir + File.separator + "progdump.txt", savedProgram);
+ ex.emitFile("source.txt", savedSource);
+ ex.emitFile("program.txt", (new
SWF9ParseTreePrinter()).text(savedProgram));
+ ex.emitFile("progdump.txt", savedProgram);
}
for (Iterator iter = tunits.iterator(); iter.hasNext(); ) {
@@ -976,7 +348,7 @@
String preamble = DEFAULT_FILE_PREAMBLE;
String epilog = DEFAULT_FILE_EPILOG;
- writeOutputFile(tunit, preamble, epilog);
+ ex.writeFile(tunit, preamble, epilog);
}
// For each global variable defined in programVars,
@@ -1005,12 +377,12 @@
for (Iterator iter = glotunits.iterator(); iter.hasNext(); ) {
TranslationUnit tunit = (TranslationUnit)iter.next();
- writeOutputFile(tunit, DEFAULT_FILE_PREAMBLE, DEFAULT_FILE_EPILOG);
+ ex.writeFile(tunit, DEFAULT_FILE_PREAMBLE, DEFAULT_FILE_EPILOG);
tunits.add(tunit);
}
try {
- return flexCompile(tunits, tempdir, apptype);
+ return ex.compileTranslationUnits(tunits, buildSharedLibrary);
}
catch (IOException ioe) {
throw new CompilerError("Error running external compiler: " + ioe);
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins