From 5605e04d894af5fa82d2dfe02280909d99d6e289 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Thu, 11 Jun 2015 10:00:44 +0200 Subject: [PATCH] ... --- src/gen_throw_pEp_exception.ysl2 | 2 +- src/pEp.yml2 | 2 +- src/types_java.ysl2 | 16 +++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gen_throw_pEp_exception.ysl2 b/src/gen_throw_pEp_exception.ysl2 index 3515342..1ad6d7e 100644 --- a/src/gen_throw_pEp_exception.ysl2 +++ b/src/gen_throw_pEp_exception.ysl2 @@ -35,7 +35,7 @@ tstylesheet { const char *ex_name; switch (status) { - `` apply "enum/*[text()!=0]", 4, mode=case + `` apply "exception/*[text()!=0]", 4, mode=case default: assert(0); ex_name = "Exception"; diff --git a/src/pEp.yml2 b/src/pEp.yml2 index 80a2f9c..bbec828 100644 --- a/src/pEp.yml2 +++ b/src/pEp.yml2 @@ -4,7 +4,7 @@ decl interface @name; decl method @name; namespace pEp { - enum pEp_status { + exception pEp_status { pEp_status_ok > 0 pEp_init_cannot_load_gpgme > 0x0110 diff --git a/src/types_java.ysl2 b/src/types_java.ysl2 index d98fada..c78485b 100644 --- a/src/types_java.ysl2 +++ b/src/types_java.ysl2 @@ -4,14 +4,16 @@ function "toJava" { param "type"; choose { - when "string" > String - when "stringlist" > String[] - when "message" > MimeMessage - when "pEp-identity" > Identity - when "identity_list" > Identity[] - when "timestamp" > Date - when "pEp_enc_format" > MimeMessage.EncFormat + when "$type='stringlist'" > String[] + when "$type='string'" > String + when "$type='message'" > MimeMessage + when "$type='pEp-identity'" > Identity + when "$type='identity-list'" > Identity[] + when "$type='timestamp'" > Date + when "$type='pEp-enc-format'" > MimeMessage.EncFormat otherwise call "CamelCase" with "text", "$type"; } } +define operator "†([$@]?[a-zA-Z0-9_]+)" as call "toJava" with "type", "%1"; +