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