AS3V

At the end of my FOTB session I wanted to show you my latest tool called AS3V. Time was short and there was a small glitch so I could not show it. But now I can explain what AS3V really is without having to rush.

AS3V is basically a tool that can check for syntactical correctness. It will do with your code what a compiler does but it keeps formatting metadata. That way it can generate an XML skeleton of your code and apply rules on the XML.

You can have a look at the first output AS3V produces here. The original source code is included in the comment at the top.

As you can see it will be possible to force coding standards for instance and to warn if code could be optimized. I hope that it will be possible to have a first version of a stable parser soon. ANTLR is still giving me a lot of trouble but it is the first time for me working with such a tool as well.

Related Posts

  • No related posts

14 Responses to “AS3V”


  1. 1 senocular

    That’s a whoooooole lot of XML for one simple class.

    Have you run it through the Flex framework yet? *covers eyes*

  2. 2 joa

    The XML can be optimized and it will be definitly :) But it is the whole parse tree on the other hand.

    I was running it over some classes of the Flex framework but it is just not done. I have to implement the island grammars first (RegExp, E4X, XML).

  3. 3 Nate Chatellier

    I really like the sound of it a lot and I could see a tool like this being something that my company would use quite often. But I agree with Sen, the amount of xml scares me. We have hundreds of classes totaling tens of thousands of lines of code, so the performance of it all would make it or break it for us. Either way, sounds like a great concept though. Thanks!

  4. 4 Danny Miller

    This has huge potential… huge…

    But yeah, the xml needs to be optimized… But why even do XML? Especially for large classes doing something more compact would be more applicable right?

    For example, a ByteArray compressed with ZLib…

  5. 5 joa

    There is a Java tool existing that works like this as well and it is quite good. I really like the idea of making custom rules using XPath. I will definitly optimize the XML. A lot of the CDATA structures will not be in there any ways. Currently I ignore(!) the formatting information — which is not what I want to do in the end but it helps me when writing the parser.

    So basically I will fold/optimize the XML if needed. But first of all some more work has to be done :)

  6. 6 Marcus Stade

    This is awesome stuff. I’ve been wanting something like this ever since I left the wonderful world of FxCop (any .NET guy probably knows what I’m talking about).

    Can this be extended to eclipse and flex builder so that we might have syntax formatting tools?

  7. 7 joa

    I was planning to make this a command line tool. I especially want to use this as an svn hook. If anyone wants to volunteer its up to you.

  8. 8 Nicolas

    Be careful Joa : I started writing a tool to validate AS2 syntax and typing a few years ago and following this path I ended up writing my own language ;)

  9. 9 joa

    Nicolas, I do not think that this was a bad path you went :) Actually I am really happy you did. But fortunately I do not have the time to do this ;)

    And maybe you want to optimize my grammar file a little bit … :)

  10. 10 Simon Gregory

    This looks really cool Joa, I’ll definitely be keeping an eye on how AS3V progresses - at the moment I use a rather optimistic ruby script to reformat code to match the Flex coding conventions.

  11. 11 Thijs

    When trying to build from source I’m getting this error:

    Buildfile: build.xml

    clean:

    properties:

    antlr:
    [echo] Generating parser and lexer using antlr-3.1.1.jar …
    [java] Exception in thread “main” java.lang.NoClassDefFoundError: org/antlr/Tool

    BUILD FAILED
    /Users/thijstriemstra/Sites/eclipse/as3v/java/build/build.xml:18: Java returned: 1

  12. 12 joa

    Thijs: Do you have ANTLR installed? There is a readme which describes how to set everything up. Or did you download ANTLR, created the build.properties and it failed?

  13. 13 Thijs

    Yeah I grabbed the .jar and created the build.properties as described in the readme but it then threw that error. This is on osx intel 10.5.5.

  1. 1 localToGlobal » Blog Archive » news review -> 41th week of 2008

Leave a Reply






Close
E-mail It