问题
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