[SrcML] API redesign
Status: Beta
Brought to you by:
crashchaos
From: Dennis W. <den...@in...> - 2005-04-26 16:29:24
|
So, we have been talking about what changes to make to the API. After today, the most recent stat would be this I guess: Replacing elements of the DOM tree still is the main part of the "API". API elements will implement interfaces to provide functionality, so languages with different syntax and equal semantics can be handlen without much hassle. For example: SrcML currently has a loop tag which stands for all kinds of loops (while, for etc. language-independent ) - if I'm wrong here correct me please. So if to language share a similar "for" concept which contains a init part, a condition part and a "action" part, both will replace the DOMElements with their implementations (if neccessary) - with both implementing a special "for" interface which allows access to those 3 parts. An application therefore needn't care too much of what underlying language is used, as long as the semantics are equal. That means every supported language will have a "helper" class which provides the means to transform the DOM tree. (As a sidenote to Frank: thinking about this will also provide us the means to add things like refactoring - as we discussed yesterday, and this still seems to be able to support a pluggable structure as those interfaces are provided with SrcMl while the language plugins might be loaded). I think Frank is as eager as I am to know what other people think about this ? - Dennis |