UPDATE: This is ready for review. If you could review it ASAP, I
would like to get it checked in so people can start testing it.
---
Change 20070131-ptw-V by [EMAIL PROTECTED] on 2007-01-31
10:59:47 EST
in /Users/ptw/OpenLaszlo/trunk
Summary: binary libraries in 3.4
Bugs Fixed:
LPP-3438: 'Implement "binary libraries"'
Technical Reviewer: hminsky (pending)
QA Reviewer: max (pending)
Doc Reviewer: sallen (pending)
Documentation:
To create a binary library, you compile the library as:
lzc -c library.lzx
This creates a `library.lzo` file in the same directory. Any
program that includes the `library.lzx` will prefer the .lzo if
that is found. It is up to your build process to ensure that the
.lzo file is kept up to date.
Details:
Back-port of this feature to 3.4. As you can see, I hardly had to
change anything to get it to work in 3.4.
Detailed details:
[Changes ported from Legal's are marked with `-`, new changes are
marked with `+`]
- lzunit-test: Handle Flash 9 player
- lzx.rnc: New element <interface> can be used to extend schema,
script tag can take `when` and `type`.
- SimpleNode: don't bomb when adding children via set.
+ FileUtils: open .lzo files as GZIP.
+ ComparisonMap: maintain entry order.
- ReferenceCollector: Eliminate redundant constraints, properly
express contraints on global functions, sanitize names.
- Compiler: Unparse super calls
- Assembler: Correct assoc-oh in block out of range error message.
+ Compiler, CodeGenerator, ToplevelCompiler, SWFFile: Remove Krank
Kruft
- Compiler, CodeGenerator: back-port compressing/obfuscating
unparser, and other miscellaneous compiler improvements.
+ JavascriptCompressor: Adapted from Legal's JavascriptGenerator
+ CompilerError, CompilerImplementationError: Adapt to new
location string
+ Function: Permit overriding name, maintain source-location info.
- ScriptClass: Scaffolding for outputting an LZX class as a JS
class.
- LibraryCompiler: Load .lzo (binary) library if available.
- ClassCompiler: Split out actual generation of class code so it
can be overridden in a subclass.
- ViewCompiler, ResourceCompiler, FontCompiler,
CompilationEnvironment, Compiler: Permit compiling of <library>
without <canvas>
+ ToplevelCompiler: Compile interfaces, maintain auto-include
information
- InterfaceCompiler: Compiles an <interface>, updating the schema.
+ ViewSchema, AttributeSpec, ClassModel: Add toLZX method that
generates an <interface> from the schema.
+ SWFWriter: open to subclassing
- LibraryWriter: New compiler back-end, subclass of SWFWriter,
captures object-code and outputs it to a binary library.
- CompilationEnvironment: Store object file so back-ends can
relativize paths.
+ DataCompiler: If not compiling to canvas, defer compiling data.
+ NodeModel: Store methods in class model, use new location format
for functions, ensure generated method names are unique.
- ScriptElementCompiler: support `when='immediate'`
- Compiler, Main: New option '-c' permits compiling a <library>
to .lzo.
- Compiler: Add InterfaceCompiler.
+ ClassModel: Make comparable so classes can be sorted according
to superclass, add hasNodeModel to tell when a class has had code
generated for it, maintain class method specifications.
Tests:
smoketest
Files:
M test/smoke/lzunit-test.lzl
M WEB-INF/lps/schema/lzx.rnc
M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/
SimpleNode.java
M WEB-INF/lps/server/src/org/openlaszlo/utils/FileUtils.java
M WEB-INF/lps/server/src/org/openlaszlo/utils/ComparisonMap.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/ReferenceCollector.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/Assembler.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
A WEB-INF/lps/server/src/org/openlaszlo/sc/
JavascriptCompressor.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/CompilerError.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/Function.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/
CompilerImplementationError.java
A WEB-INF/lps/server/src/org/openlaszlo/sc/ScriptClass.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
LibraryCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
CanvasCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
ResourceCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
ToplevelCompiler.java
A WEB-INF/lps/server/src/org/openlaszlo/compiler/
InterfaceCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFFile.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/FontCompiler.java
A WEB-INF/lps/server/src/org/openlaszlo/compiler/LibraryWriter.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
CompilationEnvironment.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/DataCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
ScriptElementCompiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/AttributeSpec.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/Main.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070131-ptw-
V.tar