CodeGen处理Synergy方法目录

CodeGen处理Synergy方法目录

如果Synergy应用程序开发环境包括使用Synergy/DE xfServerPlus,则可以基于Synergy方法目录中包含的元数据生成代码。要启用此功能,必须将方法目录导出到XML文件,然后使用-smc和-interface命令行选项(可选)。             

处理单个接口             

要处理单个接口,必须同时使用-smc和-interface选项。例如:

codegen -smc C:myfilessmc.xml -interface MyInterface -t template –r

在模板文件中,可以使用方法循环来迭代作为被处理接口成员的方法,在方法循环中,可以使用方法循环扩展标记和方法循环表达式标记。

<METHOD_LOOP>

 

;Method loop code and tokens goes here

 

</METHOD_LOOP>

如果一个方法有参数,则可以使用参数循环迭代这些参数,并且在参数循环中可以使用参数循环扩展标记和参数循环表达式标记。

<METHOD_LOOP>

 

;Method loop code and tokens goes here

 

<PARAMETER_LOOP>

 

;Parameter loop code and tokens goes here

 

</PARMAETER_LOOP>

 

;Method loop code and tokens goes here

 

</METHOD_LOOP>

Processing All Interfaces

如果希望一次处理方法目录中定义的所有接口,请单独使用-smc选项,并在模板文件中使用接口循环。在接口循环内部,可以使用接口循环扩展标记和接口循环表达式标记。接口循环可以包含方法循环和参数循环:

<INTERFACE_LOOP>

 

;Interface loop code and tokens goes here

   

<METHOD_LOOP>

 

;Method loop code and tokens goes here

 

<PARAMETER_LOOP>

 

;Parameter loop code and tokens goes here

 

</PARMAETER_LOOP>

 

;Method loop code and tokens goes here

 

</METHOD_LOOP>

 

;Interface loop code and tokens goes here

 

</INTERFACE_LOOP>

人工智能芯片与自动驾驶
原文地址:https://www.cnblogs.com/wujianming-110117/p/14136685.html