From dave at badgers-in-foil.co.uk Tue Nov 11 23:59:47 2008 From: dave at badgers-in-foil.co.uk (David Holroyd) Date: Tue, 11 Nov 2008 23:59:47 +0000 Subject: [metaas-dev] Is Metaas a full ActionScript parser? In-Reply-To: References: Message-ID: <20081111235947.GA29667@badgers-in-foil.co.uk> Hi there, On Tue, Nov 11, 2008 at 06:29:09AM +0000, metaas-dev-bounces at lists.badgers-in-foil.co.uk wrote: > From: Daniel Jackson > To: metaas-dev at lists.badgers-in-foil.co.uk > Subject: Is Metaas a full ActionScript parser? > > Hi guys, > > I'm interested in using Metaas to parse and inspect ActionScript code so I can calculate some software metrics. I've looked through the web site, and haven't seen the answer to my question yet. > > Are there any language features it can't handle? Things that haven't been implemented yet, or have known bugs? > > Thanks a lot, > Dan Jackson > > PS: For the bonus round, does anyone know of a similar project for MXML? No, metaas is a little way from handling all of the AS3 syntax unfortunatly, and there are even areas handled by the parser that aren't adequately exposed by the the public 'DOM' API yes. If you have a nice big corpus of .as files, it shouldn't be too many lines of code required to attempt to parse every single file, and see what errors you get. I remember, for example, that the metaas grammer currently has semicolons be mandatory -- in real ActionScript3 they can of course be omitted in many circumstances. I would suggest only using mataas as part of a completely generic code analysys tool you're willing to hack on the ANTLR grammer to add missing bits. My own use of it has primarily been in code-generation scenarios where I can avoid making use of syntax mataas doesn't quite do yet :) [Might be worth digging within the now-freely-available source for the flex SDK and seeing if the parser can be extracted from that -- I've yet to investigte myself.] ta, dave -- http://david.holroyd.me.uk/