2

我一直在使用 Enterprise Architect 工具执行与逆向工程相关的项目。但是,当我用 C/C++ 语言执行逆向工程时,会出现未知错误。错误日志如下:

There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zDecode.cpp  on line 91.  Unexpected symbol: *   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zEncode.h  on line 36.  Unexpected symbol: * 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zHandler.h  on line 46.  Unexpected symbol: public   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zIn.h  on line 210.  Unexpected symbol: baseOffset   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zOut.h  on line 103.  Unexpected symbol: &   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zUpdate.h  on line 74.  Unexpected symbol: * 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Cab\CabBlockInStream.h  on line 37.  Unexpected symbol: void 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Cab\CabHandler.h  on line 22.  Unexpected symbol: private    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Chm\ChmHandler.h  on line 22.  Unexpected symbol: private    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Chm\ChmHeader.cpp  on line 14.  Unexpected symbol: { 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Chm\ChmIn.h  on line 208.  Unexpected symbol: PURE   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Com\ComHandler.h  on line 23.  Unexpected symbol: STDMETHOD  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CoderMixer2MT.h  on line 59.  Unexpected symbol: ISequentialInStream  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CoderMixer2ST.h  on line 43.  Unexpected symbol: GetInStream  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CoderMixerMT.h  on line 50.  Unexpected symbol: ISequentialInStream   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CrossThreadProgress.h  on line 34.  Unexpected symbol: const  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\DummyOutStream.h  on line 20.  Unexpected symbol: const   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\InStreamWithCRC.h  on line 19.  Unexpected symbol: void   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\OutStreamWithCRC.h  on line 22.  Unexpected symbol: const 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\OutStreamWithSha1.h  on line 22.  Unexpected symbol: const    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Hfs\HfsHandler.h  on line 22.  Unexpected symbol: }  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Iso\IsoHandler.h  on line 25.  Unexpected symbol: STDMETHOD  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Nsis\NsisDecode.h  on line 41.  Unexpected symbol: * 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Nsis\NsisHandler.h  on line 19.  Unexpected symbol: public   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Nsis\NsisIn.h  on line 136.  Unexpected symbol: *    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Rar\RarHandler.h  on line 19.  Unexpected symbol: public 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Rar\RarVolumeInStream.h  on line 26.  Unexpected symbol: void    
You may need to define a language macro.

检查错误日志,我认为大部分错误是由预处理器处理的代码产生的,例如“ #define”、“ #ifdef”等。

我该如何解决这个问题?Enterprise Architect 可以反向代码由预处理器处理吗?

我还有一个问题。

当文件在反转期间在某行中生成错误时,我发现 Enterprise Architect 在该文件中的该错误行之后不处理。

是否有一个函数可以连续处理该文件并跳过该错误行?

4

1 回答 1

1

首先,C 和 C++ 是两种完全不同的语言,EA 也是这样对待它们的。您似乎正在尝试导入 C++ 源代码,因此请确保您没有在“导入源目录”对话框中选择 C ​​作为源类型。

其次,语言宏在设置 - 预处理器宏中定义。同样,请确保选择正确的语言。

定义的预处理器宏在解析期间被 EA 跳过,而不是扩展(您只能指定宏名称,而不是右侧)。因此,如果您的代码包含很多聪明的宏,它们将不会包含在模型中。如果这是不可接受的,请通过预处理器运行代码,然后导入结果,现在将是无宏的。

相关帮助页面是软件工程 - 开发工具 - 其他设置 - 语言宏。

最后不,您不能告诉 EA 继续解析遇到问题的文件。它跳出并继续下一个。

于 2013-07-24T06:51:59.533 回答