commit 1943e5387593f25f8f6c8ea1cd0e932307822554
parent 411f89400de873dacd6ac5a61436ec718bed9ffb
Author: Tomas Hlavaty <tom@logand.com>
Date: Fri, 16 Dec 2011 00:44:21 +0100
2java pr_absolute to deal with non-local typedef
Diffstat:
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/unoidl2java.c b/unoidl2java.c
@@ -309,6 +309,19 @@ static void pr_relative(Any x) {
}
}
+static void pr_absolute(Any x) {
+ Any y = find(reverse(cdr(x), NIL), typedefs, equal);
+ if(!null(y)) { // non-local typedef
+ Any a = car(y); // (ServiceContextList iop corba star sun com)
+ Any d = cdr(y); // (sequence (relative ServiceContext))
+ rel_package = cons(cdr(a), rel_package);
+ pp(d);
+ rel_package = cdr(rel_package);
+ return;
+ }
+ pp_list(cdr(x), ".");
+}
+
static void pr_property(Any x) {
Any name = cadr(x);
Any type = caddr(x);
@@ -349,7 +362,7 @@ static void pp(Any x) {
//case OUT:
//case INOUT: pr_arg(x); break;
case RELATIVE: pr_relative(x); break;
- case ABSOLUTE: pp_list(cdr(x), "."); break;
+ case ABSOLUTE: pr_absolute(x); break;
case CONSTANTS: pr_constants(x); break;
case CONST: pr_const(x); break;
case SEQUENCE: pp(cadr(x)); pr("[]"); break;