CodeGen处理Synergy方法目录
CodeGen處理Synergy方法目錄
如果Synergy應用程序開發環境包括使用Synergy/DE xfServerPlus,則可以基于Synergy方法目錄中包含的元數據生成代碼。要啟用此功能,必須將方法目錄導出到XML文件,然后使用-smc和-interface命令行選項(可選)。
處理單個接口
要處理單個接口,必須同時使用-smc和-interface選項。例如:
codegen -smc C:\my\files\smc.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>
總結
以上是生活随笔為你收集整理的CodeGen处理Synergy方法目录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CodeGen用户定义的扩展令牌
- 下一篇: CodeGen结构循环回路