Fwd: Re: [SrcML] a little bug
Status: Beta
Brought to you by:
crashchaos
From: Frank R. <fra...@un...> - 2005-09-11 18:25:20
|
----- Forwarded message from Icaro <ic...@gm...> ----- Date: Sun, 11 Sep 2005 14:40:41 +0200 From: Icaro <ic...@gm...> Subject: Re: [SrcML] a little bug This is just my case. I am writing, for my degree thesis, a fine grained Configuration Management System that can operate on methods level and not on file. IMHO what distinguishes SrcML from other projects like Jezix or JavaML is proper the fact that it doesn't focus on a specific programming language (at least in the intentions). For which would surely be preferable in my case (the CMS) an abstract approach to the different types of sources. [...] Python was only a proposal suited for my needs. Perhaps it would be simpler to write a parser for a more Java-like language. Is there a guide, a tutorial or something else, that describe how to add a parser to SrcML? http://icaro.blogspot.com ----- End forwarded message ----- This is indeed one of the (supposed) strengths of SrcML. One of the ideas we had for interesting applications was a patch to CVS/subversion to allow for actually diff not line-based, but semantic based by storing SrcML only. It would also allow you whole new queries like 'when was this method changed the last time'.. well there are uncountable possibilities. As for python we have not decided that this has to be the next language. Only that said student wanted to do a parser for it. Basically we'd like to restrict it to OO languages right now, because if you include _all_ languages there is no more common denominator at all. With OO languages you have at least several things like classes, methods, variables.. in common (with slight - queryable - differences such as multiple inheritence, support for interfaces etc). There is no explicit description for how to add a parser to SrcML, as each parser is contained in its own plugin. This gives the developer of the parser a huge amount of freedom. So all that's required is one class which is a subclass of de.srcml.parser.ParserPlugin. Input can be generally retrieved through de.srcml.util.Input and output (a string containing the parsed SrcML document) should go to de.srcml.util.Output. That's all there is to it except if you want to get a little fancier and support incremental parsing for smaller constructs. There are a few methods for that defined in the ParserPlugin class which you can overwrite to support that (but it's not required, as the default implementation will throw an UnsupportedOperationException). -- Raiser, Frank Student @ University of Ulm (www.uni-ulm.de) Truth is a good dog; but always beware of barking too close to the heels of an error, lest you get your brains kicked out. (Samuel T Coleridge) |