On 1/18/13 4:21 AM, "Michael Schmalle" <apa...@teotigraphix.com> wrote:
> No, the Falcon compiler turns MXML AST into straight ABC instructions.
>
> This is why Alex had to do majic with the
> MXMLClassDirectiveProccessor. So right now, there is no working
> translation of MXML into a Class file.
>
> Also this has been brought up between Alex and Gordon that doing a
> straight conversion is not a good plan. There needs to be an
> intermediate "model" that can hold the MXML data structure AFTER the
> AST. (I guess)
I don't think that there needs to be an intermediate model. The main reason
for going from MXML to ABC was speed. One of the things Falcon will not
support is a true -keep-generated-actionscript option. That's one of the
reasons I am trying to alter MXML output so it generates more data and less
code so your need to see the output as AS is greatly reduced.
>
> This would mean using the model to traverse and emit, not the AST.
> Again, I am a very opinionated person and when I start to think about
> MXML and how to translate it, I will come up with what I think works
> using whatever means that requires, whether it's traversing the AST or
> creating and intermediate model.
>
I may be missing something, but I think the MXMLClassDirectiveProcessor is
walking the AST not some intermediate model. What it does is a bit tricky
because it is trying to flatten the tree into the data array and use the
same APIs (of passing around Contexts). I haven't looked at your walker
recently, but it might be simpler to implement in the walker/visitor
pattern.
--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui