XppML is an add-on to Microsoft Dynamics AX2012 R3 which allows you to XMLize your X++ source.
Making your source code understandable opens it up to:
-
machine learning
-
automated code reviews
finding faulty code patterns beyond any standard BP checks
-
automated code manipulation / rewrite(s).
e.g: automatically split RunBase classes into three classes adhering to MVC pattern.
The standard XREF AX tool is useful to locate places where a particular object has been referenced, but it adds nothing toward making the source code machine understandable nor does it allow any particular sub-context of how the code has been used / constructed. The vast majority of BP checks do not extend beyond the particular method being checked.
Line | X++ | XppML |
---|---|---|
1 | public void modifiedField(FieldId _fieldId) | <source><preamble><kw>public</kw><kw>void</kw><def><method>modifiedField</method>(<el><decl><type domain="edt">FieldId</type><var domain="edt" type="FieldId">_fieldId</var></decl></el>)</def></preamble> |
2 | { | {<bl> |
3 | super(_fieldId); | <st><call><method name="modifiedField" table="Common"><kw>super</kw></method>(<el><var domain="edt" type="FieldId">_fieldId</var></el>)</call></st>; |
4 | } | </bl>}</source> |
Explanation of tags: XppML tags
The resulting xml documents are saved into an xml-aware database
Query | XPath |
---|---|
Find if statements without {} | //st[kw="if" and not(bl)] |
Find methods returning void having only one parameter | /source/preamble[kw[.="void"] and count(def/el)=1] |
When supplied, what is the 3rd parameter in all error(...) calls? | //call[method[.="error" and @domain="class" and @type="Global"]]/el[3] |
More examples here