diff options
author | Lev Walkin <vlm@lionet.info> | 2004-09-10 09:37:12 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2004-09-10 09:37:12 +0000 |
commit | b918973b7100311763a7e2d554fd5bbfdb0121b0 (patch) | |
tree | f86d1387e53a5c55055baa1f5e2ce3f4f62353ce /libasn1compiler/asn1c_C.c | |
parent | cc93b0f1c5fc5530ab9bdd4e747cd4da939b8a6a (diff) |
more explicit ANY support
Diffstat (limited to 'libasn1compiler/asn1c_C.c')
-rw-r--r-- | libasn1compiler/asn1c_C.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c index 8755c2a2..00b278b9 100644 --- a/libasn1compiler/asn1c_C.c +++ b/libasn1compiler/asn1c_C.c @@ -1200,10 +1200,21 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) { static int global_memb_unique; int save_target; arg_t tmp_arg; - struct asn1p_type_tag_s outmost_tag; + struct asn1p_type_tag_s outmost_tag_s; + struct asn1p_type_tag_s *outmost_tag; char *p; + if(asn1f_fetch_outmost_tag(arg->asn, + expr->module, expr, &outmost_tag_s, 1)) { + outmost_tag = 0; + } else { + outmost_tag = &outmost_tag_s; + } + OUT("{ "); + + if(outmost_tag && outmost_tag->tag_value == -1) + OUT("ATF_OPEN_TYPE | "); OUT("%s, ", expr->marker?"ATF_POINTER":"ATF_NOFLAGS"); if((expr->marker & EM_OPTIONAL) == EM_OPTIONAL) { asn1p_expr_t *tv; @@ -1229,12 +1240,15 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) { } INDENT(+1); if(C99_MODE) OUT(".tag = "); - if(asn1f_fetch_outmost_tag(arg->asn, - expr->module, expr, &outmost_tag, 0)) { - OUT("-1 /* Ambiguous tag (CHOICE|ANY?) */"); + if(outmost_tag) { + if(outmost_tag->tag_value == -1) + OUT("-1 /* Ambiguous tag (ANY?) */"); + else + _print_tag(arg, outmost_tag); } else { - _print_tag(arg, &outmost_tag); + OUT("-1 /* Ambiguous tag (CHOICE?) */"); } + OUT(",\n"); if(C99_MODE) OUT(".tag_mode = "); if(expr->tag.tag_class) { |