CodeGen处理Synergy方法目录
CodeGen處理Synergy方法目錄
如果Synergy應用程序開發(fā)環(huán)境包括使用Synergy/DE xfServerPlus,則可以基于Synergy方法目錄中包含的元數(shù)據(jù)生成代碼。要啟用此功能,必須將方法目錄導出到XML文件,然后使用-smc和-interface命令行選項(可選)。
處理單個接口
要處理單個接口,必須同時使用-smc和-interface選項。例如:
codegen -smc C:\my\files\smc.xml -interface MyInterface -t template –r
在模板文件中,可以使用方法循環(huán)來迭代作為被處理接口成員的方法,在方法循環(huán)中,可以使用方法循環(huán)擴展標記和方法循環(huán)表達式標記。
<METHOD_LOOP>
;Method loop code and tokens goes here
</METHOD_LOOP>
如果一個方法有參數(shù),則可以使用參數(shù)循環(huán)迭代這些參數(shù),并且在參數(shù)循環(huán)中可以使用參數(shù)循環(huán)擴展標記和參數(shù)循環(huán)表達式標記。
<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選項,并在模板文件中使用接口循環(huán)。在接口循環(huán)內部,可以使用接口循環(huán)擴展標記和接口循環(huán)表達式標記。接口循環(huán)可以包含方法循環(huán)和參數(shù)循環(huán):
<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>
總結
以上是生活随笔為你收集整理的CodeGen处理Synergy方法目录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CodeGen用户定义的扩展令牌
- 下一篇: CodeGen结构循环回路