Enterprise Architect(C ++):在Parantheses中导入具有自定义宏和参数的源代码 [英] Enterprise Architect (C++): Import Source Code with Custom Macro and Argument in Parantheses
问题描述
我想使用Enterprise Architect 11从源代码反向工程模型。类定义如下:
I want to reverse engineer models from source code with Enterprise Architect 11. The class definitions look like:
class MYCUSTOMMACRO(className) : public baseClass
{
...
}
不幸的是,EA跳过这些类,因为宏无法识别。如果我在EA中定义一个语言宏, MYCUSTOMMACRO(className)
作为一个整体被跳过。这会再次产生一个解析错误,因为类名丢失。
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?
感谢您,
Oliver
Thanks, Oliver
推荐答案
通过基于以下内容创建您自己的MDG技术文件来实现此功能:
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>
将代码另存为XML文件,即prependgrammer.xml。
Save the code as an XML file i.e. prependgrammer.xml.
创建后,您可以通过扩展程序|来激活它MDG Technologies ...对话框,然后点击高级...按钮,然后添加。
Once created you can activate it by the Extensions | MDG Technologies... dialog then hit the "Advanced..." button, then Add.
现在你可以按照正常导入C ++,你的MYCUSTOMMACRO定义类。
Now you can just import the C++ as per normal and it should pick up your "MYCUSTOMMACRO" defined class.
希望这有助于!
这篇关于Enterprise Architect(C ++):在Parantheses中导入具有自定义宏和参数的源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!