Enterprise Architect (C++): Import Source Code with Custom Macro and Argument in Parantheses

女生的网名这么多〃 提交于 2019-12-11 04:05:09

问题


I want to reverse engineer models from source code with Enterprise Architect 11. The class definitions look like:

class MYCUSTOMMACRO(className) : public baseClass
{
    ...
}

Unfortunately, EA skips these classes, as the macro was not recognized. If I define a language macro in EA, MYCUSTOMMACRO(className) is skipped as a whole. This, again, produces a parsing error, as the class name is missing.

So, is there a way to extract the class name out of the macro and import the classes?

Thanks, Oliver


回答1:


You can get this to work by creating your own MDG technology file based off the following:

<MDG.Technology version="1.0"><Documentation id="0" name="Customer Code Module" version="1" notes="Allows using a Customer Macro as an identifier"/>
<CodeModules><CodeModule language="C++" notes=""><CodeOptions><CodeOption name="PrependGrammarDefinitions">
                    <![CDATA[
<identifier>            ::= "MYCUSTOMMACRO" "(" <> ")"      

]]>
</CodeOption>
</CodeOptions></CodeModule></CodeModules>
</MDG.Technology>

Save the code as an XML file i.e. prependgrammer.xml.

Once created you can activate it by the Extensions | MDG Technologies... dialog then hit the "Advanced..." button, then Add.

Now you can just import the C++ as per normal and it should pick up your "MYCUSTOMMACRO" defined class.

Hope this helps!



来源:https://stackoverflow.com/questions/31131308/enterprise-architect-c-import-source-code-with-custom-macro-and-argument-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!