I'm looking into using XText to make an extenstion DSL to a language that I use daily and has some obvious shortcomings (AS3, through FlashBuilder).
I have a grammar and code generation system working, where the below declaration generates a value class, with constructor, class level vars and getters etc.
class Person (name: String, age: int)
This is fine, but I would like the have the types defined in the flash player library and also the types that I define in users projects available in my extension DSL. In the code above both String
and int
come from the native flash library.
I presume that Flash Builder uses the EMF core internally to represent both any included libs (swcs) and any types I define in my projects. If this is the case, my question is:
How can I access the EMF model of FLash Builder?
If there is no EMF model then I presume I would have to parse the library.swc myself and the source code of my projects.
Is the Xtend language intended to preform these sort of native filesystem tasks?
Thanks
Let us asume the Flash Builder comes with an EMF based metamodel. then the "thing" you have to do is to implement a IResourceServiceProvider. I have blogged on doing the very same stuff for uml models: http://christiandietrich.wordpress.com/2011/07/17/xtext-2-0-and-uml/
and no: xtend is a modern style programming language that compiles to Java and has nice Templating support.