On Sun, Mar 11, 2007 at 07:21:19PM +0100, Martin Wood-Mitrovski wrote:
> I dont know how far advanced is the AS3 grammar that David Holroyd is
> working on for his meta-as project
>
> http://www.badgers-in-foil.co.uk/projects/metaas/
The parser handles some of the fancy new stuff in AS3, like,
- Regular expression literals
- E4X XML literals
However, it doesn't handle embedded actionscript expressions within
E4X yet (pathological example: <{escape("tag{name}")}/> would break it).
The grammar fails to account for statements being allowed within package
and class bodies too,
package foo {
class Bar {
loadResources();
}
}
and this is surprisingly difficult to fix in the current grammar without
making it ambiguous.
I've also disabled 'virtual' semicolons in the grammar, because of the
ambiguity warnings they cause ANTLR to generate.
There are probably lots of other issues but the statements-in-class-
bodies thing is the main one that prevents parsing of all the example
code which comes along with Flex2, as I recall.
> Or if the AS3 model it generates is suitable for developing dev tools.
> Maybe he can tell us, or maybe you can investigate :)
I don't really know what an IDE needs of a model that would make it
suitable :)
Behind the high-level DOM interface that metaas provides, there is also
a lower-level 'Abstract Syntax Tree' produced by the parser. If the DOM
isn't directly useful (and maybe it is) then possibly the internal parser
/ AST code could be directly reused? Maybe these should exist as a
separate project..?
ta,
dave
--
http://david.holroyd.me.uk/
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org