Wow Scott!

What a cool project. I don't have a name for it, but I can tell you
that it will be extremely useful. Making Java value objects (POJOs)
out of AS 2 value classes is one really handy thing that I can think
of that I could use now. Or, how about being able to generate them for
a multitude of server side languages at once.

Anyway, please share the project. I will think more about a good name
in the meantime.

-Chris

On 5/22/06, Scott Hyndman <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I just whipped a new project that I'm using for our ActionStep GUI builder, 
> and I thought that I might release it if people were interested.
>
> This project looks at ActionScript 2.0 source files and translates them in to 
> a Java object model. It collects almost all information about the classes 
> including:
>
> 1. The type hierarchy (including implemented interfaces)
> 2. Javadoc comments on fields, methods, properties, classes and interfaces
> 3. The contents of methods
> 4. Inline values set on fields (public var foo:Number = 5 would record "5")
>
> The object model is very rich and easy to use. There are classes to represent 
> all major AS2.0 constructs, including methods, properties, interfaces, 
> classes, fields and javadoc documentation.
>
> There are some really interesting applications for an application like this. 
> As an example, I whipped up a Javadoc generator using Velocity 
> (http://jakarta.apache.org/velocity/), but that's just the beginning of how 
> this thing could be used.
>
> But you could even GENERATE code using this approach. For example, let's say 
> you wanted to implement a pre-condition parser, so that method arguments 
> could be checked with very little code. You might want to do this with a 
> Javadoc tag describing the various argument contraints, looking like this:
>
> /**
>  * @NotNull(arg0)
>  */
> public function foo(arg0:Object):Void {
> ...
> }
>
> You could generate the following:
>
> public function foo(arg0:Object):Void {
>   if (arg0 == null) {
>     trace("Error - arg0 cannot be null");
>     throw new Error("Error - arg0 cannot be null");
>   }
> ...
> }
>
> Pretty neat, huh?
>
> Anyways, it's pretty quick right now, and offers a very simple API for 
> parsing and generating anything from the parsed code. I'm profiling it to 
> bring the time down a little, but it is really quite reasonable, taking about 
> 2 seconds for the standard Flash classes and all of ActionStep (137 types).
>
> So let me know if you guys are interested. I think this could be a platform 
> to do lots of cool things with the language.
>
> Scott
>
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to