0 Replies Latest reply on Jun 11, 2008 6:18 AM by (Paul_Reilly)

    [svn] 2040: Fixed some bugs and inconsistencies found by turning on AST generation

    Level 1
      Revision: 2040
      Author: preilly@adobe.com
      Date: 2008-06-11 07:18:14 -0700 (Wed, 11 Jun 2008)

      Log Message:
      -----------
      Fixed some bugs and inconsistencies found by turning on AST generation
      by default.

      tests Passed: checkintests, mxmlcunit ConditionalCompilation, mxunit E4XDataBinding

      Needs QA: YES

      Needs DOC: NO

      Bug fixes: SDK-15751, SDK-15752

      API Change: NO

      Reviewer: clucier

      Code-level description of changes:

      swfutils/src/java/flash/swf/tools/SyntaxTreeDumper.java

      Added dump().

      asc/src/java/macromedia/asc/parser/Parser.java

      Made config_namespaces public, so Flex AST generation can
      initialize it. Also added some asserts to catch the situation
      where config_namespaces is not initialized.

      compiler/src/java/flex2/compiler/as3/As3Compiler.java

      Removed some unnecessary fully qualification for
      macromedia.asc.util.Context and flex2.compiler.CompilerContext.

      compiler/src/java/flex2/compiler/as3/AbstractSyntaxTreeUtil.java

      Added new generateConstructor() variant with a generateSuperCall
      param. This allows InterfaceGenerator to be more consistent with
      the equivalent Velocity template.

      Modified generateContext() to take a "defines" param and to
      initialize config_vars with it.

      Modified parse() to initialize config_namespaces and to use
      parseDirectives() instead of parseProgram(). This should remove
      the need to throw away ConfigNamespaceDefinitionNode and
      UseDirectiveNode nodes, plus it should run slightly faster.

      Added parseConfigVars().

      compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension.java

      Added "defines" variable and modified constructor to initialize
      it.

      Modified ArrayElementWatcher's generateWatcher() and
      generateWatcherBottom() to only generate a watcher if child
      watchers will be written. The Velocity template has this
      optimization, but the AST generation equivalent was missing it.

      compiler/src/java/flex2/compiler/as3/binding/ArrayElementWatcher.java
      compiler/src/java/flex2/compiler/as3/binding/DataBindingFirstPassEvaluator.java
      compiler/src/java/flex2/compiler/as3/binding/Watcher.java

      Renamed getShouldWriteChildren() to shouldWriteChildren() to be
      more consistent with shouldWriteSelf().

      compiler/src/java/flex2/compiler/mxml/InterfaceGenerator.java

      Modified constructor to take a "defines" param and pass it into
      generateContext().

      Modified generateBindingManagementVars() to be more like
      ImplementationGenerator.generateBindingManagementVars() by using
      AbstractSyntaxTreeUtil.generateMxInternalQualifiedIdentifier() and
      AbstractSyntaxTreeUtil.generateVariable().

      compiler/src/java/flex2/compiler/mxml/AbstractGenerator.java

      Added generateMxInternalAttribute() from ImplementationGenerator,
      so InterfaceGenerator can use it, too.

      compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java

      Added ascConfiguration variable.

      Modified constructor to initialize ascConfiguration and pass it's
      defines into DataBindingExtension.

      compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java

      Added ascConfiguration variable.

      Modified generateImplementationAST() to pass the "defines" into
      ImplementationGenerator.

      compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java

      Modified constructor to take a "defines" param and pass it into
      generateContext().

      Removed generateMxInternalAttribute().

      Ticket Links:
      ------------
      http://bugs.adobe.com/jira/browse/SDK-15751
      http://bugs.adobe.com/jira/browse/SDK-15752

      Modified Paths:
      --------------
      flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/Parser.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/AbstractSyntaxTreeUtil.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/As3Compiler.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/ArrayElementWatcher.j ava
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension. java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingFirstPassE valuator.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/Watcher.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/AbstractGenerator.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationGenerator.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
      flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceGenerator.java
      flex/sdk/trunk/modules/swfutils/src/java/flash/swf/tools/SyntaxTreeDumper.java