|
@ -17,8 +17,7 @@ tstylesheet { |
|
|
|
|
|
|
|
|
final public class «$cname» extends AbstractEngine implements EngineInterface { |
|
|
final public class «$cname» extends AbstractEngine implements EngineInterface { |
|
|
public «$cname»() throws pEpException { } |
|
|
public «$cname»() throws pEpException { } |
|
|
|
|
|
`` apply "method" |
|
|
`` apply "method", mode=plain |
|
|
|
|
|
`` apply "basic" |
|
|
`` apply "basic" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -42,8 +41,8 @@ tstylesheet { |
|
|
const "jtype" call "toJava" with "type", "@type"; |
|
|
const "jtype" call "toJava" with "type", "@type"; |
|
|
|
|
|
|
|
|
|| |
|
|
|| |
|
|
private native «$itype» _«@name»(`apply "parm/*", mode=basic_iparm`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// CodeGen "basic" |
|
|
public «$jtype» «@name»(`apply "parm/*", mode=basic_parm`) { |
|
|
public «$jtype» «@name»(`apply "parm/*", mode=basic_parm`) { |
|
|
|| |
|
|
|| |
|
|
apply "parm/*", mode=basic_parm_set; |
|
|
apply "parm/*", mode=basic_parm_set; |
|
@ -71,13 +70,12 @@ tstylesheet { |
|
|
|| |
|
|
|| |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private native «$itype» _«@name»(`apply "parm/*", mode=basic_iparm`); |
|
|
|| |
|
|
|| |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template "basic" mode=java_interface { |
|
|
template "basic" mode=java_interface { |
|
|
const "itype" call "toIntermediate" with "type", "@type"; |
|
|
|
|
|
const "jtype" call "toJava" with "type", "@type"; |
|
|
const "jtype" call "toJava" with "type", "@type"; |
|
|
|
|
|
|
|
|
|| |
|
|
|| |
|
|
public «$jtype» «@name»(`apply "parm/*", mode=basic_parm`); |
|
|
public «$jtype» «@name»(`apply "parm/*", mode=basic_parm`); |
|
|
|| |
|
|
|| |
|
@ -173,12 +171,18 @@ tstylesheet { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template "method", mode=plain { |
|
|
template "method" { |
|
|
const "singlereturn", "count(parm/creates|parm/returns|parm/inout[../int]) = 1"; |
|
|
const "singlereturn", "count(parm/creates|parm/returns|parm/inout[../int]) = 1"; |
|
|
const "multireturn", "count(parm/creates|parm/returns|parm/inout[../int]) > 1"; |
|
|
const "multireturn", "count(parm/creates|parm/returns|parm/inout[../int]) > 1"; |
|
|
|
|
|
|
|
|
|
|
|
|| |
|
|
|
|
|
|
|
|
|
|
|
//CodeGen "method" |
|
|
|
|
|
|| |
|
|
|
|
|
|
|
|
if "$multireturn" { |
|
|
if "$multireturn" { |
|
|
|| |
|
|
|| |
|
|
|
|
|
//CodeGen "mutlireturn" - class for return type |
|
|
private class _«@name»_Return { |
|
|
private class _«@name»_Return { |
|
|
`` apply "parm[creates|returns|inout[../int]]", 1, mode=intermediate with "public", 1; |
|
|
`` apply "parm[creates|returns|inout[../int]]", 1, mode=intermediate with "public", 1; |
|
|
} |
|
|
} |
|
@ -187,10 +191,6 @@ tstylesheet { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|| |
|
|
|| |
|
|
private native `call "returnInter"` _«@name»( |
|
|
|
|
|
`` apply "parm[in|inout]", 2, mode=intermediate |
|
|
|
|
|
) throws pEpException; |
|
|
|
|
|
|
|
|
|
|
|
public `call "returnJava"` «@name»( |
|
|
public `call "returnJava"` «@name»( |
|
|
`` apply "parm[in|inout]", 2, mode=java |
|
|
`` apply "parm[in|inout]", 2, mode=java |
|
|
) throws pEpException |
|
|
) throws pEpException |
|
@ -199,12 +199,11 @@ tstylesheet { |
|
|
|
|
|
|
|
|
apply "parm", mode=convertIn; |
|
|
apply "parm", mode=convertIn; |
|
|
|
|
|
|
|
|
if "$singlereturn" choose { |
|
|
if "$singlereturn" { |
|
|
|
|
|
choose { |
|
|
// TODO factorize type conversion with multireturn and gen_java_message.java |
|
|
|
|
|
|
|
|
|
|
|
when "count(parm[returns][stringlist|string|sstring]) > 0" |
|
|
when "count(parm[returns][stringlist|string|sstring]) > 0" |
|
|
|> return Utils.toUTF16(_«@name»(`apply "parm[in]", mode=call;`)); |
|
|
|> return Utils.toUTF16(_«@name»(`apply "parm[in]", mode=call;`)); |
|
|
|
|
|
|
|
|
when "count(parm[returns]/stringpairlist) > 0" |
|
|
when "count(parm[returns]/stringpairlist) > 0" |
|
|
|| |
|
|
|| |
|
|
ArrayList<Pair<byte[], byte[]>> glist = _«@name»(`apply "parm[in]", mode=call;`); |
|
|
ArrayList<Pair<byte[], byte[]>> glist = _«@name»(`apply "parm[in]", mode=call;`); |
|
@ -220,6 +219,7 @@ tstylesheet { |
|
|
|
|
|
|
|
|
when "count(parm[returns]/identity) > 0" |
|
|
when "count(parm[returns]/identity) > 0" |
|
|
|> return new Identity(_«@name»(`apply "parm[in]", mode=call;`)); |
|
|
|> return new Identity(_«@name»(`apply "parm[in]", mode=call;`)); |
|
|
|
|
|
|
|
|
when "count(parm[returns]/identitylist) > 0" |
|
|
when "count(parm[returns]/identitylist) > 0" |
|
|
|| |
|
|
|| |
|
|
Vector<_Identity> glist = _«@name»(`apply "parm[in]", mode=call;`); |
|
|
Vector<_Identity> glist = _«@name»(`apply "parm[in]", mode=call;`); |
|
@ -232,32 +232,36 @@ tstylesheet { |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
|
|| |
|
|
|| |
|
|
|
|
|
|
|
|
otherwise |
|
|
otherwise |
|
|
|> return _«@name»(`apply "parm[in]", mode=call;`); |
|
|
|> return _«@name»(`apply "parm[in]", mode=call;`); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if "$multireturn" |
|
|
if "$multireturn" { |
|
|
|| |
|
|
|| |
|
|
_«@name»_Return _result = _«@name»(`apply "parm[in|inout]", mode=call;`); |
|
|
_«@name»_Return _result = _«@name»(`apply "parm[in|inout]", mode=call;`); |
|
|
«@name»_Return result = new «@name»_Return(); |
|
|
«@name»_Return result = new «@name»_Return(); |
|
|
`` apply "parm[creates|returns|inout[../int]]", mode=convertOut; |
|
|
`` apply "parm[creates|returns|inout[../int]]", mode=convertOut; |
|
|
return result; |
|
|
return result; |
|
|
|| |
|
|
|| |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if "not($singlereturn) and not($multireturn)" |
|
|
if "not($singlereturn) and not($multireturn)" { |
|
|
|| |
|
|
|| |
|
|
_«@name»(`apply "parm[in]", mode=call;`); |
|
|
_«@name»(`apply "parm[in]", mode=call;`); |
|
|
|| |
|
|
|| |
|
|
|
|
|
} |
|
|
|| |
|
|
|| |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private native `call "returnInter"` _«@name»( |
|
|
|
|
|
`` apply "parm[in|inout]", 2, mode=intermediate |
|
|
|
|
|
) throws pEpException; |
|
|
|| |
|
|
|| |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template "method", mode=java_interface { |
|
|
template "method", mode=java_interface { |
|
|
const "singlereturn", "count(parm/creates|parm/returns|parm/inout[../int]) = 1"; |
|
|
|
|
|
const "multireturn", "count(parm/creates|parm/returns|parm/inout[../int]) > 1"; |
|
|
|
|
|
|
|
|
|
|
|
|| |
|
|
|| |
|
|
public `call "returnJava"` «@name»( |
|
|
public `call "returnJava"` «@name»( |
|
|
`` apply "parm[in|inout]", 2, mode=java |
|
|
`` apply "parm[in|inout]", 2, mode=java |
|
|