From: <fwi...@us...> - 2008-03-31 17:56:27
|
Revision: 4259 http://jython.svn.sourceforge.net/jython/?rev=4259&view=rev Author: fwierzbicki Date: 2008-03-31 10:56:24 -0700 (Mon, 31 Mar 2008) Log Message: ----------- added initial compile method body. Modified Paths: -------------- branches/py25/src/org/python/newcompiler/Module.java Property Changed: ---------------- branches/py25/newcompiler/org/python/bytecode/ branches/py25/src/org/python/newcompiler/ Property changes on: branches/py25/newcompiler/org/python/bytecode ___________________________________________________________________ Name: svn:ignore + .BytecodeVisitor.java.swp Property changes on: branches/py25/src/org/python/newcompiler ___________________________________________________________________ Name: svn:ignore + .Module.java.swp Modified: branches/py25/src/org/python/newcompiler/Module.java =================================================================== --- branches/py25/src/org/python/newcompiler/Module.java 2008-03-29 21:25:00 UTC (rev 4258) +++ branches/py25/src/org/python/newcompiler/Module.java 2008-03-31 17:56:24 UTC (rev 4259) @@ -1,13 +1,23 @@ package org.python.newcompiler; -import java.io.ByteArrayOutputStream; +import org.python.newcompiler.ast.AstToBytecode; import org.python.antlr.ast.modType; import org.python.core.CompilerFlags; +import java.io.ByteArrayOutputStream; + public class Module { - public static void compile(modType node, ByteArrayOutputStream ofp, String string, String filename, boolean b, boolean b0, boolean b1, CompilerFlags compilerFlags) { - throw new UnsupportedOperationException("Not yet implemented"); + public static void compile(modType tree, ByteArrayOutputStream ostream, + String name, String filename, + boolean linenumbers, boolean printResults, + boolean setFile, CompilerFlags cflags) { + try { + tree.accept(new AstToBytecode(new Bundle(), name)); + } catch (Exception e) { + //FIXME: I don't like that AstToBytecode throws Exception... + throw new RuntimeException(e); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |