metaas announced: ActionScript DOM in Java
David Holroyd announced metaas on the OSFlash mailing list today and it looks very exciting indeed.
metaas is an ActionScript parser/code generator written in Java that, "provides Java applications with a 'Document Object Model' for ActionScript 3 code." David states in his email that the primary purpose of metaas is as a code generator but what excites me most are its potential uses in pre-processing/post-processing of ActionScript code, documentation generation, etc. Having an ActionScript-aware DOM in Java could also be useful for ActionScript editors like the open source ASDT project.
From the documentation, here's a snippet that demonstrates how to parse an ActionScript file:
[java]FileInputStream in = new FileInputStream("Test.as"); InputStreamReader reader = new InputStreamReader(in); ActionScriptFactory fact = new ActionScriptFactory(); ActionScriptParser parser = fact.newParser(); ASCompilationUnit unit = parser.parse(reader);
ASPackage pkg = unit.getPackage(); ASType type = pkg.getType(); List methods = type.getMethods(); for (Iterator i=methods.iterator(); i.hasNext(); ) { ASMethod meth = (ASMethod)i.next(); System.out.println(meth.getName()); }[/java]
Learn more about metaas on the metaas homepage.
Comments
by spender on 2006-12-17 22:50:59
by Daniel on 2008-06-10 16:22:50
by Javaman on 2008-04-03 13:46:19
by Sean on 2008-06-17 15:54:40
by giuseppe on 2008-05-19 10:18:18
by jacks on 2008-06-11 11:36:59