Change 20091112-ptw-v by [email protected] on 2009-11-12 15:47:12 EST
in /Users/ptw/OpenLaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Allow forward references to superclasses in LZX
Bugs Fixed: LPP-7745 Allow forward references to superclass when declaring a
class in LZX
Technical Reviewer: hminksy (pending)
QA Reviewer: max (pending)
Overview:
The LZX compiler already walks the code twice, to accumulate the
class declarations so it can adjust the schema to accept the new
tags the class declarations create. We just need to defer some of
the work that builds the class model until the classes can be
sorted according to their dependency order.
Most of the large additions/deletions in this changeset consist of
just moving the class modelling from ViewSchema and ClassCompiler
into ClassModel so it can be deferred until all the class
definitions are known.
Details:
ClassCompiler: Move all model-building to ClassModel. All
ClassCompiler does now add the class to the schema in
updateSchema, and call the ClassModel compiler in compile.
ViewCompiler, NodeModel: Update for renamed ClassModel members.
ViewSchema_Test: Comment out obsolete tests.
ViewSchema: Distinguish between needing the full class model and
just the unresolved model. The unresolved model is sufficient for
syntax-checking class declarations, the resolved model is only
needed to check instantiations. Move model-building to
ClassModel. Add an interface to ensure all class models are
resolved (before you compile). After loading schema, ensure the
schema models are resolved.
Compiler: After updating the root schema, resolve all classes
before starting the compile pass.
ClassModel: Break out modelling that requires superclasses and
mixins to be modelled into a separate resolve phase which is
invoked by the schema compiler only after all the class
declarations have been added to the schema.
Tests:
Smokecheck on all platforms. Test case from the bug.
Files:
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/ViewSchema_Test.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/Compiler.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20091112-ptw-v.tar
_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews