aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--libasn1compiler/asn1c_C.c139
-rw-r--r--libasn1compiler/asn1c_misc.c92
-rw-r--r--libasn1compiler/asn1c_misc.h2
-rw-r--r--libasn1compiler/asn1c_out.h3
-rw-r--r--libasn1compiler/asn1c_save.c8
-rw-r--r--libasn1compiler/asn1compiler.c27
-rw-r--r--libasn1fix/asn1fix.c158
-rw-r--r--libasn1fix/asn1fix_class.c8
-rw-r--r--libasn1fix/asn1fix_class.h8
-rw-r--r--libasn1fix/asn1fix_constr.c3
-rw-r--r--libasn1fix/asn1fix_constraint.c3
-rw-r--r--libasn1fix/asn1fix_cws.c2
-rw-r--r--libasn1fix/asn1fix_dereft.c3
-rw-r--r--libasn1fix/asn1fix_export.c5
-rw-r--r--libasn1fix/asn1fix_export.h2
-rw-r--r--libasn1fix/asn1fix_integer.c3
-rw-r--r--libasn1fix/asn1fix_internal.h2
-rw-r--r--libasn1fix/asn1fix_misc.c11
-rw-r--r--libasn1fix/asn1fix_param.c431
-rw-r--r--libasn1fix/asn1fix_param.h8
-rw-r--r--libasn1fix/asn1fix_retrieve.c45
-rw-r--r--libasn1fix/asn1fix_retrieve.h1
-rw-r--r--libasn1fix/asn1fix_tags.c2
-rw-r--r--libasn1parser/asn1p_constr.c80
-rw-r--r--libasn1parser/asn1p_constr.h4
-rw-r--r--libasn1parser/asn1p_expr.c121
-rw-r--r--libasn1parser/asn1p_expr.h28
-rw-r--r--libasn1parser/asn1p_l.c32
-rw-r--r--libasn1parser/asn1p_param.c6
-rw-r--r--libasn1parser/asn1p_param.h14
-rw-r--r--libasn1parser/asn1p_value.c12
-rw-r--r--libasn1parser/asn1p_value.h7
-rw-r--r--libasn1parser/asn1p_y.c7226
-rw-r--r--libasn1parser/asn1p_y.h358
-rw-r--r--libasn1parser/asn1p_y.y49
-rw-r--r--libasn1parser/asn1parser.c9
-rw-r--r--libasn1parser/asn1parser.h2
-rw-r--r--libasn1print/asn1print.c44
-rw-r--r--tests/104-param-1-OK.asn121
-rw-r--r--tests/104-param-1-OK.asn1.-EFprint-class-matrix17
-rw-r--r--tests/104-param-1-OK.asn1.-P198
-rw-r--r--tests/105-param-2-OK.asn121
-rw-r--r--tests/105-param-2-OK.asn1.-P451
-rw-r--r--tests/106-param-constr-OK.asn120
-rw-r--r--tests/106-param-constr-OK.asn1.-P222
-rw-r--r--tests/19-param-OK.asn1.-EF8
-rw-r--r--tests/19-param-OK.asn1.-P171
-rw-r--r--tests/58-param-OK.asn1.-EF5
-rw-r--r--tests/84-param-tags-OK.asn1.-EF16
-rw-r--r--tests/84-param-tags-OK.asn1.-P377
51 files changed, 5333 insertions, 5155 deletions
diff --git a/ChangeLog b/ChangeLog
index 0bafe940..c9358e57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
-0.9.21: 2006-Mar-14
+0.9.21: 2006-Mar-20
* skeletons/standard-modules directory is now used for standard types.
* Fixed class field access problem (Test case 98)
(Severity: medim; Security impact: none)
* Refactored Information Object Classes parsing.
+ * Refactored Parameterization support.
0.9.20: 2006-Mar-06
diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c
index 8bce9028..f887adf3 100644
--- a/libasn1compiler/asn1c_C.c
+++ b/libasn1compiler/asn1c_C.c
@@ -85,9 +85,8 @@ static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode
} while(0)
/* MKID_safe() without checking for reserved keywords */
-#define MKID(id) ((id)?asn1c_make_identifier(0, (id), 0):"Member")
-#define MKID_safe(id) ((id)?asn1c_make_identifier(AMI_CHECK_RESERVED, \
- (id), 0):"Member")
+#define MKID(expr) (asn1c_make_identifier(0, expr, 0))
+#define MKID_safe(expr) (asn1c_make_identifier(AMI_CHECK_RESERVED, expr, 0))
int
asn1c_lang_C_type_REAL(arg_t *arg) {
@@ -140,7 +139,7 @@ asn1c_lang_C_type_common_INTEGER(arg_t *arg) {
case A1TC_UNIVERVAL:
OUT("\t");
out_name_chain(arg, ONC_noflags);
- OUT("_%s", MKID(v->Identifier));
+ OUT("_%s", MKID(v));
OUT("\t= %" PRIdASN "%s\n",
v->value->value.v_integer,
(eidx+1 < el_count) ? "," : "");
@@ -178,7 +177,7 @@ asn1c_lang_C_type_common_INTEGER(arg_t *arg) {
REDIR(OT_STAT_DEFS);
OUT("static asn_INTEGER_enum_map_t asn_MAP_%s_value2enum_%d[] = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
qsort(v2e, el_count, sizeof(v2e[0]), compar_enumMap_byValue);
for(eidx = 0; eidx < el_count; eidx++) {
v2e[eidx].idx = eidx;
@@ -192,7 +191,7 @@ asn1c_lang_C_type_common_INTEGER(arg_t *arg) {
OUT("};\n");
OUT("static unsigned int asn_MAP_%s_enum2value_%d[] = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
qsort(v2e, el_count, sizeof(v2e[0]), compar_enumMap_byName);
for(eidx = 0; eidx < el_count; eidx++) {
OUT("\t%d%s\t/* %s(%" PRIdASN ") */\n",
@@ -205,15 +204,15 @@ asn1c_lang_C_type_common_INTEGER(arg_t *arg) {
OUT("};\n");
OUT("static asn_INTEGER_specifics_t asn_SPC_%s_specs_%d = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENT(+1);
OUT("asn_MAP_%s_value2enum_%d,\t"
"/* \"tag\" => N; sorted by tag */\n",
- MKID(expr->Identifier),
+ MKID(expr),
expr->_type_unique_index);
OUT("asn_MAP_%s_enum2value_%d,\t"
"/* N => \"tag\"; sorted by N */\n",
- MKID(expr->Identifier),
+ MKID(expr),
expr->_type_unique_index);
OUT("%d,\t/* Number of elements in the maps */\n",
el_count);
@@ -255,7 +254,7 @@ asn1c_lang_C_type_BIT_STRING(arg_t *arg) {
}
OUT("\t");
out_name_chain(arg, ONC_noflags);
- OUT("_%s", MKID(v->Identifier));
+ OUT("_%s", MKID(v));
OUT("\t= %" PRIdASN "%s\n",
v->value->value.v_integer,
(eidx < el_count) ? "," : "");
@@ -283,7 +282,7 @@ asn1c_lang_C_type_SEQUENCE(arg_t *arg) {
OUT(" {\n");
} else {
OUT("typedef struct %s {\n",
- MKID_safe(expr->Identifier));
+ MKID_safe(expr));
}
TQ_FOR(v, &(expr->members), next) {
@@ -299,8 +298,8 @@ asn1c_lang_C_type_SEQUENCE(arg_t *arg) {
OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"",
expr->_anonymous_type ? "" :
arg->embed
- ? MKID_safe(expr->Identifier)
- : MKID(expr->Identifier),
+ ? MKID_safe(expr)
+ : MKID(expr),
arg->embed ? "" : "_t");
return asn1c_lang_C_type_SEQUENCE_def(arg);
@@ -344,7 +343,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
if(emit_members_PER_constraints(arg))
return -1;
OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
elements = 0;
roms_count = 0;
@@ -369,7 +368,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
int comma = 0;
comp_mode = 0;
OUT("static int asn_MAP_%s_oms_%d[] = {",
- MKID(expr->Identifier),
+ MKID(expr),
expr->_type_unique_index);
TQ_FOR(v, &(expr->members), next) {
if(v->expr_type == A1TC_EXTENSIBLE) {
@@ -426,7 +425,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
emit_tag2member_map(arg, tag2el, tag2el_count, 0);
OUT("static asn_SEQUENCE_specifics_t asn_SPC_%s_specs_%d = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENT(+1);
OUT("sizeof(struct ");
out_name_chain(arg, ONC_avoid_keywords); OUT("),\n");
@@ -435,7 +434,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
if(tag2el_count) {
OUT("asn_MAP_%s_tag2el_%d,\n",
- MKID(expr->Identifier),
+ MKID(expr),
expr->_type_unique_index);
OUT("%d,\t/* Count of tags in the map */\n", tag2el_count);
} else {
@@ -444,7 +443,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
}
if(roms_count + aoms_count) {
OUT("asn_MAP_%s_oms_%d,\t/* Optional members */\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
OUT("%d, %d,\t/* Root/Additions */\n", roms_count, aoms_count);
} else {
OUT("0, 0, 0,\t/* Optional elements (not needed) */\n");
@@ -492,7 +491,7 @@ asn1c_lang_C_type_SET(arg_t *arg) {
INDENTED(
out_name_chain(arg, ONC_noflags);
OUT("_PR_");
- id = MKID(v->Identifier);
+ id = MKID(v);
OUT("%s,\t/* Member %s is present */\n",
id, id)
);
@@ -508,7 +507,7 @@ asn1c_lang_C_type_SET(arg_t *arg) {
OUT(" {\n");
} else {
OUT("typedef struct %s {\n",
- MKID_safe(expr->Identifier));
+ MKID_safe(expr));
}
TQ_FOR(v, &(expr->members), next) {
@@ -521,7 +520,7 @@ asn1c_lang_C_type_SET(arg_t *arg) {
}
INDENTED(
- id = MKID(expr->Identifier);
+ id = MKID(expr);
OUT("\n");
OUT("/* Presence bitmask: ASN_SET_ISPRESENT(p%s, %s_PR_x) */\n",
id, id);
@@ -531,7 +530,7 @@ asn1c_lang_C_type_SET(arg_t *arg) {
PCTX_DEF;
OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"",
- expr->_anonymous_type ? "" : MKID_safe(expr->Identifier),
+ expr->_anonymous_type ? "" : MKID_safe(expr),
arg->embed ? "" : "_t");
return asn1c_lang_C_type_SET_def(arg);
@@ -584,7 +583,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
if(emit_members_PER_constraints(arg))
return -1;
OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
elements = 0;
INDENTED(TQ_FOR(v, &(expr->members), next) {
@@ -616,8 +615,8 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
* Emit a map of mandatory elements.
*/
OUT("static uint8_t asn_MAP_%s_mmap_%d",
- MKID(expr->Identifier), expr->_type_unique_index);
- p = MKID_safe(expr->Identifier);
+ MKID(expr), expr->_type_unique_index);
+ p = MKID_safe(expr);
OUT("[(%d + (8 * sizeof(unsigned int)) - 1) / 8]", elements);
OUT(" = {\n");
INDENTED(
@@ -644,7 +643,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
OUT("};\n");
OUT("static asn_SET_specifics_t asn_SPC_%s_specs_%d = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENTED(
OUT("sizeof(struct ");
out_name_chain(arg, ONC_avoid_keywords);
@@ -655,7 +654,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
OUT("offsetof(struct ");
out_name_chain(arg, ONC_avoid_keywords);
OUT(", _presence_map),\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
OUT("asn_MAP_%s_tag2el_%d,\n", p, expr->_type_unique_index);
OUT("%d,\t/* Count of tags in the map */\n", tag2el_count);
if(tag2el_cxer)
@@ -696,7 +695,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
out_name_chain(arg, ONC_avoid_keywords);
OUT(" {\n");
} else {
- OUT("typedef struct %s {\n", MKID_safe(expr->Identifier));
+ OUT("typedef struct %s {\n", MKID_safe(expr));
}
INDENT(+1);
@@ -728,7 +727,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
if(0)
tmp_memb.Identifier = strdup(
asn1c_make_identifier(0,
- expr->Identifier, "Member", 0));
+ expr, "Member", 0));
assert(tmp_memb.Identifier);
}
tmp.default_cb(&tmp);
@@ -749,7 +748,7 @@ asn1c_lang_C_type_SEx_OF(arg_t *arg) {
PCTX_DEF;
OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"",
- expr->_anonymous_type ? "" : MKID_safe(expr->Identifier),
+ expr->_anonymous_type ? "" : MKID_safe(expr),
arg->embed ? "" : "_t");
/*
@@ -786,7 +785,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
if(emit_members_PER_constraints(arg))
return -1;
OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENT(+1);
v = TQ_FIRST(&(expr->members));
if(!v->Identifier) {
@@ -806,7 +805,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count);
OUT("static asn_SET_OF_specifics_t asn_SPC_%s_specs_%d = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENTED(
OUT("sizeof(struct ");
out_name_chain(arg, ONC_avoid_keywords);
@@ -857,7 +856,7 @@ asn1c_lang_C_type_CHOICE(arg_t *arg) {
}
out_name_chain(arg, ONC_noflags);
OUT("_PR_");
- id = MKID(v->Identifier);
+ id = MKID(v);
OUT("%s,\n", id, id);
}
);
@@ -868,7 +867,7 @@ asn1c_lang_C_type_CHOICE(arg_t *arg) {
if(arg->embed) {
OUT("struct "); out_name_chain(arg, ONC_avoid_keywords); OUT(" {\n");
} else {
- OUT("typedef struct %s {\n", MKID_safe(expr->Identifier));
+ OUT("typedef struct %s {\n", MKID_safe(expr));
}
INDENTED(
@@ -891,8 +890,8 @@ asn1c_lang_C_type_CHOICE(arg_t *arg) {
OUT("} %s%s%s", (expr->marker.flags & EM_INDIRECT)?"*":"",
expr->_anonymous_type ? "" :
arg->embed
- ? MKID_safe(expr->Identifier)
- : MKID(expr->Identifier),
+ ? MKID_safe(expr)
+ : MKID(expr),
arg->embed ? "" : "_t");
return asn1c_lang_C_type_CHOICE_def(arg);
@@ -932,7 +931,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
if(emit_members_PER_constraints(arg))
return -1;
OUT("static asn_TYPE_member_t asn_MBR_%s_%d[] = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
elements = 0;
INDENTED(TQ_FOR(v, &(expr->members), next) {
@@ -952,7 +951,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
cmap = compute_canonical_members_order(arg, elements);
if(cmap) {
OUT("static int asn_MAP_%s_cmap_%d[] = {",
- MKID(expr->Identifier),
+ MKID(expr),
expr->_type_unique_index);
for(i = 0; i < elements; i++) {
if(i) OUT(",");
@@ -980,7 +979,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
emit_tag2member_map(arg, tag2el, tag2el_count, 0);
OUT("static asn_CHOICE_specifics_t asn_SPC_%s_specs_%d = {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENTED(
OUT("sizeof(struct ");
out_name_chain(arg, ONC_avoid_keywords);
@@ -995,11 +994,11 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
out_name_chain(arg, ONC_avoid_keywords);
OUT(" *)0)->present),\n");
OUT("asn_MAP_%s_tag2el_%d,\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
OUT("%d,\t/* Count of tags in the map */\n", tag2el_count);
if(C99_MODE) OUT(".canonical_order = ");
if(cmap) OUT("asn_MAP_%s_cmap_%d,\t/* Canonically sorted */\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
else OUT("0,\n");
if(C99_MODE) OUT(".ext_start = ");
OUT("%d\t/* Extensions start */\n",
@@ -1029,7 +1028,7 @@ asn1c_lang_C_type_REFERENCE(arg_t *arg) {
int ret;
extract = asn1f_class_access_ex(arg->asn, arg->expr->module,
- arg->expr, ref);
+ arg->expr, arg->expr->rhs_pspecs, ref);
if(extract == NULL)
return -1;
@@ -1092,7 +1091,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("%s", asn1c_type_name(arg, arg->expr, tnfmt));
if(!expr->_anonymous_type) {
OUT("%s", (expr->marker.flags&EM_INDIRECT)?"\t*":"\t ");
- OUT("%s", MKID_safe(expr->Identifier));
+ OUT("%s", MKID_safe(expr));
if((expr->marker.flags & (EM_DEFAULT & ~EM_INDIRECT))
== (EM_DEFAULT & ~EM_INDIRECT))
OUT("\t/* DEFAULT %s */",
@@ -1112,7 +1111,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
asn1c_type_name(arg, arg->expr, TNF_CTYPE));
OUT("%s%s_t",
(expr->marker.flags & EM_INDIRECT)?"*":" ",
- MKID(expr->Identifier));
+ MKID(expr));
}
if((expr->expr_type == ASN_BASIC_ENUMERATED)
@@ -1141,7 +1140,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
type_name = asn1c_type_name(arg, expr, TNF_SAFE);
OUT("/* This type is equivalent to %s */\n", type_name);
if(HIDE_INNER_DEFS) OUT("/* ");
- OUT("#define\tasn_DEF_%s\t", MKID(expr->Identifier));
+ OUT("#define\tasn_DEF_%s\t", MKID(expr));
type_name = asn1c_type_name(arg, expr, TNF_SAFE);
OUT("asn_DEF_%s", type_name);
if(HIDE_INNER_DEFS)
@@ -1170,7 +1169,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
* Constraint checking.
*/
if(!(arg->flags & A1C_NO_CONSTRAINTS)) {
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("int\n");
OUT("%s", p);
@@ -1208,7 +1207,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT(" */\n");
OUT("static void\n");
OUT("%s_%d_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {\n",
- MKID(expr->Identifier), expr->_type_unique_index);
+ MKID(expr), expr->_type_unique_index);
INDENT(+1);
{
asn1p_expr_t *terminal = asn1f_find_terminal_type_ex(arg->asn, expr);
@@ -1248,7 +1247,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("}\n");
OUT("\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("void\n");
OUT("%s", p);
@@ -1263,7 +1262,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("}\n");
OUT("\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("int\n");
OUT("%s", p);
@@ -1278,7 +1277,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("}\n");
OUT("\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("asn_dec_rval_t\n");
OUT("%s", p);
@@ -1293,7 +1292,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("}\n");
OUT("\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("asn_enc_rval_t\n");
OUT("%s", p);
@@ -1309,7 +1308,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("}\n");
OUT("\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("asn_dec_rval_t\n");
OUT("%s", p);
@@ -1324,7 +1323,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("}\n");
OUT("\n");
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("asn_enc_rval_t\n");
OUT("%s", p);
@@ -1341,7 +1340,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("\n");
if(arg->flags & A1C_GEN_PER) {
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) OUT("static ");
OUT("asn_dec_rval_t\n");
OUT("%s", p);
@@ -1359,7 +1358,7 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
REDIR(OT_FUNC_DECLS);
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(HIDE_INNER_DEFS) {
OUT("/* extern asn_TYPE_descriptor_t asn_DEF_%s_%d;"
"\t// (Use -fall-defs-global to expose) */\n",
@@ -1620,7 +1619,7 @@ emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count, const char *
if(!tag2el_count) return 0; /* No top level tags */
OUT("static asn_TYPE_tag2member_t asn_MAP_%s_tag2el%s_%d[] = {\n",
- MKID(expr->Identifier), opt_modifier?opt_modifier:"",
+ MKID(expr), opt_modifier?opt_modifier:"",
expr->_type_unique_index);
for(i = 0; i < tag2el_count; i++) {
OUT(" { ");
@@ -1685,7 +1684,7 @@ emit_tags_vectors(arg_t *arg, asn1p_expr_t *expr, int *tags_count_r, int *all_ta
#define EMIT_TAGS_TABLE(name, tags, tags_count) do { \
OUT("static ber_tlv_tag_t asn_DEF_%s%s_tags_%d[] = {\n",\
- MKID(expr->Identifier), name, \
+ MKID(expr), name, \
expr->_type_unique_index); \
INDENT(+1); \
/* Print the array of collected tags */ \
@@ -1917,7 +1916,7 @@ emit_members_PER_constraints(arg_t *arg) {
|| v->expr_type == ASN_CONSTR_CHOICE) {
OUT("static asn_per_constraints_t "
"asn_PER_memb_%s_constr_%d = {\n",
- MKID(v->Identifier), v->_type_unique_index);
+ MKID(v), v->_type_unique_index);
if(emit_single_member_PER_constraints(arg, v))
return -1;
OUT("};\n");
@@ -2027,7 +2026,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
OUT(", ");
if(arg->expr->expr_type == ASN_CONSTR_CHOICE
&& (!UNNAMED_UNIONS)) OUT("choice.");
- OUT("%s),\n", MKID_safe(expr->Identifier));
+ OUT("%s),\n", MKID_safe(expr));
}
INDENT(+1);
if(C99_MODE) OUT(".tag = ");
@@ -2060,7 +2059,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
if(C99_MODE) OUT(".type = ");
OUT("&asn_DEF_");
if(complex_contents) {
- OUT("%s", MKID(expr->Identifier));
+ OUT("%s", MKID(expr));
if(!(arg->flags & A1C_ALL_DEFS_GLOBAL))
OUT("_%d", expr->_type_unique_index);
} else {
@@ -2072,7 +2071,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
if(arg->flags & A1C_NO_CONSTRAINTS) {
OUT("0,\t/* No check because of -fno-constraints */\n");
} else {
- char *id = MKID(expr->Identifier);
+ char *id = MKID(expr);
if(expr->_anonymous_type
&& !strcmp(expr->Identifier, "Member"))
id = asn1c_type_name(arg, expr, TNF_SAFE);
@@ -2088,7 +2087,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
|| expr->expr_type == ASN_BASIC_ENUMERATED
|| expr->expr_type == ASN_CONSTR_CHOICE) {
OUT("&asn_PER_memb_%s_constr_%d,\n",
- MKID(expr->Identifier),
+ MKID(expr),
expr->_type_unique_index);
} else {
OUT("0,\t/* No PER visible constraints */\n");
@@ -2124,7 +2123,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
if(expr->_anonymous_type && !strcmp(expr->Identifier, "Member"))
p = asn1c_type_name(arg, expr, TNF_SAFE);
else
- p = MKID(expr->Identifier);
+ p = MKID(expr);
OUT("static int\n");
OUT("memb_%s_constraint_%d(asn_TYPE_descriptor_t *td, const void *sptr,\n", p, arg->expr->_type_unique_index);
INDENT(+1);
@@ -2150,7 +2149,7 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
static int
emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_count, int all_tags_count, int elements_count, enum etd_spec spec) {
int using_type_name = 0;
- char *p = MKID(expr->Identifier);
+ char *p = MKID(expr);
if((arg->flags & A1C_GEN_PER)
&& (expr->constraints
@@ -2174,7 +2173,9 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_
if(expr->_anonymous_type) {
p = ASN_EXPR_TYPE2STR(expr->expr_type);
OUT("\"%s\",\n", p?p:"");
- OUT("\"%s\",\n", MKID(p?p:""));
+ OUT("\"%s\",\n",
+ p ? asn1c_make_identifier(AMI_CHECK_RESERVED,
+ 0, p, 0) : "");
} else {
OUT("\"%s\",\n", expr->Identifier);
OUT("\"%s\",\n", expr->Identifier);
@@ -2184,7 +2185,7 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_
using_type_name = 1;
p = asn1c_type_name(arg, arg->expr, TNF_SAFE);
} else {
- p = MKID(expr->Identifier);
+ p = MKID(expr);
}
#define FUNCREF(foo) do { \
@@ -2212,7 +2213,7 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_
OUT("0,\t/* Use generic outmost tag fetcher */\n");
}
- p = MKID(expr->Identifier);
+ p = MKID(expr);
if(tags_count) {
OUT("asn_DEF_%s_tags_%d,\n",
p, expr->_type_unique_index);
@@ -2341,9 +2342,9 @@ out_name_chain(arg_t *arg, enum onc_flags onc_flags) {
}
if(onc_flags & ONC_avoid_keywords)
- id = MKID_safe(expr->Identifier);
+ id = MKID_safe(expr);
else
- id = MKID(expr->Identifier);
+ id = MKID(expr);
OUT("%s", id);
return 0;
diff --git a/libasn1compiler/asn1c_misc.c b/libasn1compiler/asn1c_misc.c
index 8805347b..f96b3896 100644
--- a/libasn1compiler/asn1c_misc.c
+++ b/libasn1compiler/asn1c_misc.c
@@ -33,27 +33,40 @@ reserved_keyword(const char *str) {
* Convert unsafe characters to underscores.
*/
char *
-asn1c_make_identifier(enum ami_flags_e flags, char *arg1, ...) {
+asn1c_make_identifier(enum ami_flags_e flags, asn1p_expr_t *expr, ...) {
static char *storage;
static int storage_size;
int nodelimiter = 0;
va_list ap;
char *str;
char *nextstr;
+ char *first = 0;
+ char *second = 0;
size_t size;
char *p;
- if(arg1 == NULL)
- return NULL;
+ if(expr) {
+ /*
+ * Estimate the necessary storage size
+ */
+ if(expr->Identifier == NULL)
+ return "Member";
+ size = strlen(expr->Identifier);
+ if(expr->spec_index != -1) {
+ static char buf[32];
+ second = buf;
+ size += 1 + snprintf(buf, sizeof buf, "%dP%d",
+ expr->_lineno, expr->spec_index);
+ }
+ } else {
+ size = -1;
+ }
- /*
- * Estimate the necessary storage size
- */
- size = strlen(arg1);
- va_start(ap, arg1);
+ va_start(ap, expr);
while((str = va_arg(ap, char *)))
size += 1 + strlen(str);
va_end(ap);
+ if(size == -1) return NULL;
/*
* Make sure we have this amount of storage.
@@ -72,12 +85,23 @@ asn1c_make_identifier(enum ami_flags_e flags, char *arg1, ...) {
/*
* Fill-in the storage.
*/
- va_start(ap, arg1);
- str = arg1;
+ va_start(ap, expr);
p = storage;
- for(str = arg1; str; str = nextstr) {
+ nextstr = "";
+ for(p = storage, str = 0; str || nextstr; str = nextstr) {
int subst_made = 0;
- nextstr = va_arg(ap, char *);
+ nextstr = second ? second : va_arg(ap, char *);
+
+ if(str == 0) {
+ if(expr) {
+ str = expr->Identifier;
+ first = str;
+ second = 0;
+ } else {
+ first = nextstr;
+ continue;
+ }
+ }
if(str[0] == ' ' && str[1] == '\0') {
*p++ = ' ';
@@ -85,7 +109,7 @@ asn1c_make_identifier(enum ami_flags_e flags, char *arg1, ...) {
continue;
}
- if(str != arg1 && !nodelimiter)
+ if(str != first && !nodelimiter)
*p++ = '_'; /* Delimiter between tokens */
nodelimiter = 0;
@@ -94,7 +118,7 @@ asn1c_make_identifier(enum ami_flags_e flags, char *arg1, ...) {
* with C/C++ language keywords.
*/
if((flags & AMI_CHECK_RESERVED)
- && str == arg1 && !nextstr && reserved_keyword(str)) {
+ && str == first && !nextstr && reserved_keyword(str)) {
*p++ = toupper(*str++);
/* Fall through */
}
@@ -123,7 +147,9 @@ asn1c_make_identifier(enum ami_flags_e flags, char *arg1, ...) {
char *
asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
+ asn1p_expr_t *exprid = 0;
asn1p_expr_t *top_parent;
+ asn1p_expr_t *terminal;
char *typename;
/* Rewind to the topmost parent expression */
@@ -145,15 +171,15 @@ asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
* Resolve it and use instead.
*/
tmp.expr = asn1f_class_access_ex(arg->asn,
- arg->expr->module, arg->expr, expr->reference);
+ arg->expr->module, arg->expr, expr->rhs_pspecs, expr->reference);
if(!tmp.expr) return NULL;
return asn1c_type_name(&tmp, tmp.expr, _format);
}
+ terminal = asn1f_find_terminal_type_ex(arg->asn, expr);
+
if(_format == TNF_RSAFE) {
- asn1p_expr_t *terminal;
- terminal = asn1f_find_terminal_type_ex(arg->asn, expr);
if(terminal && terminal->expr_type & ASN_CONSTR_MASK) {
typename = terminal->Identifier;
}
@@ -165,29 +191,17 @@ asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
* switch to a recursion-safe type naming
* ("struct foo" instead of "foo_t").
*/
- asn1p_expr_t *terminal;
- terminal = asn1f_find_terminal_type_ex(arg->asn, expr);
if(terminal && terminal == top_parent) {
_format = TNF_RSAFE;
}
}
- break;
-#if 0
- case ASN_CONSTR_SEQUENCE_OF:
- case ASN_CONSTR_SET_OF:
- if(expr->Identifier) {
- typename = expr->Identifier;
- } else {
- asn1p_expr_t *child;
- child = TQ_FIRST(&(expr->members));
- typename = asn1c_type_name(arg, child, _format);
- if(typename)
- return typename;
- _format = TNF_SAFE;
- typename = child->Identifier;
+
+ if(terminal && terminal->spec_index != -1) {
+ exprid = terminal;
+ typename = 0;
}
+
break;
-#endif
case ASN_BASIC_INTEGER:
case ASN_BASIC_ENUMERATED:
case ASN_BASIC_REAL:
@@ -229,13 +243,15 @@ asn1c_type_name(arg_t *arg, asn1p_expr_t *expr, enum tnfmt _format) {
switch(_format) {
case TNF_UNMODIFIED:
case TNF_INCLUDE:
- return asn1c_make_identifier(AMI_MASK_ONLY_SPACES, typename, 0);
+ return asn1c_make_identifier(AMI_MASK_ONLY_SPACES,
+ 0, exprid ? exprid->Identifier : typename, 0);
case TNF_SAFE:
- return asn1c_make_identifier(0, typename, 0);
+ return asn1c_make_identifier(0, exprid, typename, 0);
case TNF_CTYPE: /* C type */
- return asn1c_make_identifier(0, typename, "t", 0);
+ return asn1c_make_identifier(0, exprid,
+ exprid?"t":typename, exprid?0:"t", 0);
case TNF_RSAFE: /* Recursion-safe type */
- return asn1c_make_identifier(AMI_CHECK_RESERVED,
+ return asn1c_make_identifier(AMI_CHECK_RESERVED, 0,
"struct", " ", typename, 0);
}
diff --git a/libasn1compiler/asn1c_misc.h b/libasn1compiler/asn1c_misc.h
index 8da261df..23693a0d 100644
--- a/libasn1compiler/asn1c_misc.h
+++ b/libasn1compiler/asn1c_misc.h
@@ -10,7 +10,7 @@ enum ami_flags_e {
AMI_MASK_ONLY_SPACES = 1, /* Mask only spaces, everything else's safe */
AMI_CHECK_RESERVED = 2, /* Check against reserved keywords */
};
-char *asn1c_make_identifier(enum ami_flags_e, char *arg1, ...);
+char *asn1c_make_identifier(enum ami_flags_e, asn1p_expr_t *expr, ...);
/*
* Return the type name of the specified expression.
diff --git a/libasn1compiler/asn1c_out.h b/libasn1compiler/asn1c_out.h
index 63732896..fb986cbf 100644
--- a/libasn1compiler/asn1c_out.h
+++ b/libasn1compiler/asn1c_out.h
@@ -102,8 +102,7 @@ int asn1c_compiled_output(arg_t *arg, const char *fmt, ...);
int saved_target = arg->target->target; \
REDIR(OT_FUNC_DECLS); \
OUT_NOINDENT("extern asn_TYPE_descriptor_t " \
- "asn_DEF_%s;\n", \
- MKID(expr->Identifier)); \
+ "asn_DEF_%s;\n", MKID(expr)); \
REDIR(saved_target); \
} while(0)
diff --git a/libasn1compiler/asn1c_save.c b/libasn1compiler/asn1c_save.c
index 226c2a8b..d54777f7 100644
--- a/libasn1compiler/asn1c_save.c
+++ b/libasn1compiler/asn1c_save.c
@@ -215,7 +215,7 @@ asn1c_save_streams(arg_t *arg, asn1c_fdeps_t *deps, int argc, int optc, char **a
generate_preamble(arg, fp_c, argc, optc, argv);
generate_preamble(arg, fp_h, argc, optc, argv);
- header_id = asn1c_make_identifier(0, expr->Identifier, NULL);
+ header_id = asn1c_make_identifier(0, expr, NULL);
fprintf(fp_h,
"#ifndef\t_%s_H_\n"
"#define\t_%s_H_\n"
@@ -477,8 +477,7 @@ generate_pdu_collection_file(arg_t *arg) {
continue;
fprintf(fp, "extern struct asn_TYPE_descriptor_s "
"asn_DEF_%s;\n",
- asn1c_make_identifier(0, arg->expr->Identifier,
- NULL));
+ asn1c_make_identifier(0, arg->expr, NULL));
}
}
@@ -496,8 +495,7 @@ generate_pdu_collection_file(arg_t *arg) {
arg->expr->module->ModuleName,
arg->expr->module->source_file_name);
fprintf(fp, "\t&asn_DEF_%s,\t\n",
- asn1c_make_identifier(0, arg->expr->Identifier,
- NULL));
+ asn1c_make_identifier(0, arg->expr, NULL));
}
}
diff --git a/libasn1compiler/asn1compiler.c b/libasn1compiler/asn1compiler.c
index 408db2f1..18b2c008 100644
--- a/libasn1compiler/asn1compiler.c
+++ b/libasn1compiler/asn1compiler.c
@@ -43,7 +43,7 @@ asn1_compile(asn1p_t *asn, const char *datadir, enum asn1c_flags flags,
ret = asn1c_compile_expr(arg);
if(ret) {
- FATAL("Cannot compile %s (%x:%x) at line %d",
+ FATAL("Cannot compile \"%s\" (%x:%x) at line %d",
arg->expr->Identifier,
arg->expr->expr_type,
arg->expr->meta_type,
@@ -82,10 +82,26 @@ asn1c_compile_expr(arg_t *arg) {
expr->Identifier,
expr->_lineno);
- ret = type_cb(arg);
-
- if(arg->target->destination[OT_TYPE_DECLS].indent_level == 0)
- OUT(";\n");
+ if(expr->lhs_params && expr->spec_index == -1) {
+ int i;
+ ret = 0;
+ DEBUG("Parameterized type %s at line %d: %s (%d)",
+ expr->Identifier, expr->_lineno,
+ expr->specializations.pspecs_count
+ ? "compiling" : "unused, skipping");
+ for(i = 0; i<expr->specializations.pspecs_count; i++) {
+ arg->expr = expr->specializations
+ .pspec[i].my_clone;
+ ret = asn1c_compile_expr(arg);
+ if(ret) break;
+ }
+ arg->expr = expr; /* Restore */
+ } else {
+ ret = type_cb(arg);
+ if(arg->target->destination[OT_TYPE_DECLS]
+ .indent_level == 0)
+ OUT(";\n");
+ }
} else {
ret = -1;
/*
@@ -94,7 +110,6 @@ asn1c_compile_expr(arg_t *arg) {
* certain expressions need not to be compiled at all.
*/
switch(expr->meta_type) {
- case AMT_PARAMTYPE:
case AMT_OBJECT:
case AMT_OBJECTCLASS:
case AMT_OBJECTFIELD:
diff --git a/libasn1fix/asn1fix.c b/libasn1fix/asn1fix.c
index d8cc863c..24ba7c8d 100644
--- a/libasn1fix/asn1fix.c
+++ b/libasn1fix/asn1fix.c
@@ -15,6 +15,7 @@ static int asn1f_resolve_constraints(arg_t *arg); /* For subtype constraints */
static int asn1f_check_constraints(arg_t *arg); /* For subtype constraints */
static int asn1f_check_duplicate(arg_t *arg);
static int asn1f_apply_unique_index(arg_t *arg);
+static int phase_1_1(arg_t *arg, int prm2);
arg_t a1f_replace_me_with_proper_interface_arg;
@@ -179,71 +180,21 @@ asn1f_fix_module__phase_1(arg_t *arg) {
*/
TQ_FOR(expr, &(arg->mod->members), next) {
arg->expr = expr;
-
- /* Check whether this type is a duplicate */
- ret = asn1f_check_duplicate(arg);
- RET2RVAL(ret, rvalue);
-
- if(expr->meta_type == AMT_PARAMTYPE)
- /* Do not process the parametrized type just yet */
- continue;
-
- DEBUG("=== Now processing \"%s\" (%d/0x%x) at line %d ===",
- expr->Identifier, expr->meta_type, expr->expr_type,
- expr->_lineno);
- assert(expr->meta_type != AMT_INVALID);
-
- /*
- * 2.1 Pre-process simple types (ENUMERATED, INTEGER, etc).
- */
- ret = asn1f_recurse_expr(arg, asn1f_fix_simple);
- RET2RVAL(ret, rvalue);
-
- /*
- * 2.5.4
- */
- ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_types);
+ ret = phase_1_1(arg, 0);
RET2RVAL(ret, rvalue);
-
- /*
- * Fix tagging of top-level types.
- */
- ret = asn1f_fix_constr_tag(arg, 1);
- RET2RVAL(ret, rvalue);
-
- /*
- * 2.[234] Process SEQUENCE/SET/CHOICE types.
- */
- ret = asn1f_recurse_expr(arg, asn1f_fix_constructed);
- RET2RVAL(ret, rvalue);
-
- /*
- * 2.5.5
- */
- ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_values);
- RET2RVAL(ret, rvalue);
-
- /*
- * Parse class objects and fill up the object class with data.
- */
- ret = asn1f_parse_class_object(arg);
- RET2RVAL(ret, rvalue);
-
- /*
- * Resolve references in constraints.
- */
- ret = asn1f_recurse_expr(arg, asn1f_resolve_constraints);
- RET2RVAL(ret, rvalue);
-
- /*
- * 6. INTEGER value processed at 2.5.4.
- */
-
/*
* Make sure everybody's behaving well.
*/
assert(arg->expr == expr);
}
+ TQ_FOR(expr, &(arg->mod->members), next) {
+ arg->expr = expr;
+ ret = phase_1_1(arg, 1);
+ RET2RVAL(ret, rvalue);
+ assert(arg->expr == expr);
+ }
+
+
/*
* 5. Automatic tagging
@@ -296,15 +247,8 @@ asn1f_fix_module__phase_2(arg_t *arg) {
int ret;
TQ_FOR(expr, &(arg->mod->members), next) {
- }
-
- TQ_FOR(expr, &(arg->mod->members), next) {
arg->expr = expr;
- if(expr->meta_type == AMT_PARAMTYPE)
- /* Do not process the parametrized types here */
- continue;
-
/*
* Dereference DEFAULT values.
*/
@@ -331,6 +275,88 @@ asn1f_fix_module__phase_2(arg_t *arg) {
}
static int
+phase_1_1(arg_t *arg, int prm2) {
+ asn1p_expr_t *expr = arg->expr;
+ int rvalue = 0;
+ int ret;
+
+ if(expr->lhs_params && expr->spec_index == -1) {
+ int i;
+ if(!prm2)
+ /* Do not process the parameterized type just yet */
+ return 0;
+ for(i = 0; i < expr->specializations.pspecs_count; i++) {
+ arg->expr = expr->specializations.pspec[i].my_clone;
+ ret = phase_1_1(arg, 0);
+ RET2RVAL(ret, rvalue);
+ }
+ arg->expr = expr; /* revert */
+ return rvalue;
+ } else if(prm2) {
+ return 0; /* Already done! */
+ }
+
+ /* Check whether this type is a duplicate */
+ if(!expr->lhs_params) {
+ ret = asn1f_check_duplicate(arg);
+ RET2RVAL(ret, rvalue);
+ }
+
+ DEBUG("=== Now processing \"%s\" (%d/0x%x) at line %d ===",
+ expr->Identifier, expr->meta_type, expr->expr_type,
+ expr->_lineno);
+ assert(expr->meta_type != AMT_INVALID);
+
+ /*
+ * 2.1 Pre-process simple types (ENUMERATED, INTEGER, etc).
+ */
+ ret = asn1f_recurse_expr(arg, asn1f_fix_simple);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * 2.5.4
+ */
+ ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_types);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * Fix tagging of top-level types.
+ */
+ ret = asn1f_fix_constr_tag(arg, 1);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * 2.[234] Process SEQUENCE/SET/CHOICE types.
+ */
+ ret = asn1f_recurse_expr(arg, asn1f_fix_constructed);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * 2.5.5
+ */
+ ret = asn1f_recurse_expr(arg, asn1f_fix_dereference_values);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * Parse class objects and fill up the object class with data.
+ */
+ ret = asn1f_parse_class_object(arg);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * Resolve references in constraints.
+ */
+ ret = asn1f_recurse_expr(arg, asn1f_resolve_constraints);
+ RET2RVAL(ret, rvalue);
+
+ /*
+ * 6. INTEGER value processed at 2.5.4.
+ */
+
+ return rvalue;
+}
+
+static int
asn1f_fix_simple(arg_t *arg) {
int rvalue = 0;
int ret;
diff --git a/libasn1fix/asn1fix_class.c b/libasn1fix/asn1fix_class.c
index b3bfae57..bf357193 100644
--- a/libasn1fix/asn1fix_class.c
+++ b/libasn1fix/asn1fix_class.c
@@ -1,7 +1,7 @@
#include "asn1fix_internal.h"
asn1p_expr_t *
-asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
+asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref) {
asn1p_expr_t *ioclass;
asn1p_expr_t *classfield;
asn1p_expr_t *expr;
@@ -20,14 +20,16 @@ asn1f_class_access(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
tmpref = *ref;
tmpref.comp_count = 1;
- ioclass = asn1f_lookup_symbol(arg, mod, &tmpref);
+ ioclass = asn1f_lookup_symbol(arg, mod, rhs_pspecs, &tmpref);
if(ioclass == NULL) {
errno = ESRCH;
return NULL;
}
if(ioclass->expr_type == A1TC_REFERENCE) {
ioclass = asn1f_lookup_symbol(arg,
- ioclass->module, ioclass->reference);
+ ioclass->module,
+ ioclass->rhs_pspecs,
+ ioclass->reference);
if(ioclass == NULL) {
errno = ESRCH;
return NULL;
diff --git a/libasn1fix/asn1fix_class.h b/libasn1fix/asn1fix_class.h
index 763e48cf..b704ff8b 100644
--- a/libasn1fix/asn1fix_class.h
+++ b/libasn1fix/asn1fix_class.h
@@ -4,12 +4,6 @@
/*
* Fetch the element from the class-related stuff (thing) by its reference.
*/
-asn1p_expr_t *asn1f_class_access(arg_t *, asn1p_module_t *mod, asn1p_ref_t *);
-
-/*
- * Externally accessible version of above function.
- */
-asn1p_expr_t *asn1f_class_access2(asn1p_t *asn, asn1p_module_t *mod,
- asn1p_expr_t *expr, asn1p_ref_t *);
+asn1p_expr_t *asn1f_class_access(arg_t *, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *);
#endif /* _ASN1FIX_CLASS_H_ */
diff --git a/libasn1fix/asn1fix_constr.c b/libasn1fix/asn1fix_constr.c
index 2c995cc1..353473d4 100644
--- a/libasn1fix/asn1fix_constr.c
+++ b/libasn1fix/asn1fix_constr.c
@@ -471,7 +471,8 @@ _asn1f_compare_tags(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
DEBUG(" %s is a type reference", a->Identifier);
- a = asn1f_lookup_symbol(arg, a->module, a->reference);
+ a = asn1f_lookup_symbol(arg,
+ a->module, a->rhs_pspecs, a->reference);
if(!a) return 0; /* Already FATAL()'ed somewhere else */
WITH_MODULE(a->module, ret = _asn1f_compare_tags(arg, a, b));
return ret;
diff --git a/libasn1fix/asn1fix_constraint.c b/libasn1fix/asn1fix_constraint.c
index 4afca5aa..23709a4e 100644
--- a/libasn1fix/asn1fix_constraint.c
+++ b/libasn1fix/asn1fix_constraint.c
@@ -30,7 +30,7 @@ asn1constraint_pullup(arg_t *arg) {
asn1p_expr_t *parent_expr;
assert(ref);
- parent_expr = asn1f_lookup_symbol(arg, expr->module, ref);
+ parent_expr = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, ref);
if(!parent_expr) {
if(errno != EEXIST) {
DEBUG("\tWhile fetching parent constraints: "
@@ -259,6 +259,7 @@ constraint_type_resolve(arg_t *arg, asn1p_constraint_t *ct) {
assert(ct->containedSubtype->type == ATV_REFERENCED);
rtype = asn1f_lookup_symbol(arg, arg->expr->module,
+ arg->expr->rhs_pspecs,
ct->containedSubtype->value.reference);
if(!rtype) {
FATAL("Cannot find type \"%s\" in constraints at line %d",
diff --git a/libasn1fix/asn1fix_cws.c b/libasn1fix/asn1fix_cws.c
index 0279c96d..c6bd1ab0 100644
--- a/libasn1fix/asn1fix_cws.c
+++ b/libasn1fix/asn1fix_cws.c
@@ -206,7 +206,7 @@ _asn1f_assign_cell_value(arg_t *arg, struct asn1p_ioc_row_s *row, struct asn1p_i
asn1p_ref_add_component(ref, p, RLT_UNKNOWN);
assert(ref);
- expr = asn1f_lookup_symbol(arg, arg->mod, ref);
+ expr = asn1f_lookup_symbol(arg, arg->mod, arg->expr->rhs_pspecs, ref);
if(!expr) {
FATAL("Cannot find %s referenced by %s at line %d",
p, arg->expr->Identifier,
diff --git a/libasn1fix/asn1fix_dereft.c b/libasn1fix/asn1fix_dereft.c
index 769abed9..8f570f64 100644
--- a/libasn1fix/asn1fix_dereft.c
+++ b/libasn1fix/asn1fix_dereft.c
@@ -6,9 +6,6 @@ asn1f_fix_dereference_types(arg_t *arg) {
asn1p_expr_t *type_expr;
int r_value = 0;
- if(expr->expr_type == A1TC_PARAMETRIZED)
- return asn1f_fix_parametrized_assignment(arg);
-
if(expr->expr_type != A1TC_REFERENCE
|| expr->meta_type != AMT_TYPEREF) {
//assert(expr->reference == 0);
diff --git a/libasn1fix/asn1fix_export.c b/libasn1fix/asn1fix_export.c
index 0a543dc1..6eb8cdad 100644
--- a/libasn1fix/asn1fix_export.c
+++ b/libasn1fix/asn1fix_export.c
@@ -20,13 +20,14 @@ asn1f_lookup_symbol_ex(
arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
- return asn1f_lookup_symbol(&arg, expr->module, ref);
+ return asn1f_lookup_symbol(&arg, expr->module, expr->rhs_pspecs, ref);
}
asn1p_expr_t *
asn1f_class_access_ex(asn1p_t *asn,
asn1p_module_t *mod,
asn1p_expr_t *expr,
+ asn1p_expr_t *rhs_pspecs,
asn1p_ref_t *ref) {
arg_t arg;
@@ -38,7 +39,7 @@ asn1f_class_access_ex(asn1p_t *asn,
arg.eh = a1f_replace_me_with_proper_interface_arg.eh;
arg.debug = a1f_replace_me_with_proper_interface_arg.debug;
- return asn1f_class_access(&arg, mod, ref);
+ return asn1f_class_access(&arg, mod, rhs_pspecs, ref);
}
asn1p_expr_t *
diff --git a/libasn1fix/asn1fix_export.h b/libasn1fix/asn1fix_export.h
index 533ba28e..606ddf89 100644
--- a/libasn1fix/asn1fix_export.h
+++ b/libasn1fix/asn1fix_export.h
@@ -25,7 +25,7 @@ asn1p_expr_t *asn1f_lookup_symbol_ex(
* Exportable version of an asn1f_class_access().
*/
asn1p_expr_t *asn1f_class_access_ex(asn1p_t *asn, asn1p_module_t *mod,
- asn1p_expr_t *expr, asn1p_ref_t *);
+ asn1p_expr_t *expr, asn1p_expr_t *rhs_rspecs, asn1p_ref_t *);
/*
* Exportable version of asn1f_find_terminal_type().
diff --git a/libasn1fix/asn1fix_integer.c b/libasn1fix/asn1fix_integer.c
index 892e9276..8a144911 100644
--- a/libasn1fix/asn1fix_integer.c
+++ b/libasn1fix/asn1fix_integer.c
@@ -143,7 +143,8 @@ _asn1f_make_sure_type_is(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_type_e type)
* Then, it is a reference. For a reference, try to resolve type
* and try again.
*/
- next_expr = asn1f_lookup_symbol(arg, expr->module, expr->reference);
+ next_expr = asn1f_lookup_symbol(arg, expr->module,
+ expr->rhs_pspecs, expr->reference);
if(next_expr == NULL) {
errno = ESRCH;
return -1;
diff --git a/libasn1fix/asn1fix_internal.h b/libasn1fix/asn1fix_internal.h
index dabf8567..612b718a 100644
--- a/libasn1fix/asn1fix_internal.h
+++ b/libasn1fix/asn1fix_internal.h
@@ -62,7 +62,7 @@ typedef struct arg_s {
#include "asn1fix_constr.h" /* Constructed types */
#include "asn1fix_class.h" /* CLASS support */
#include "asn1fix_cws.h" /* CLASS WITH SYNTAX support */
-#include "asn1fix_param.h" /* Parametrization */
+#include "asn1fix_param.h" /* Parameterization */
#include "asn1fix_retrieve.h" /* Data retrieval */
#include "asn1fix_enum.h" /* Process ENUMERATED */
#include "asn1fix_integer.h" /* Process INTEGER */
diff --git a/libasn1fix/asn1fix_misc.c b/libasn1fix/asn1fix_misc.c
index b28a58a2..5728bd4c 100644
--- a/libasn1fix/asn1fix_misc.c
+++ b/libasn1fix/asn1fix_misc.c
@@ -196,6 +196,17 @@ asn1f_recurse_expr(arg_t *arg, int (*callback)(arg_t *arg)) {
assert(expr);
+ if(expr->lhs_params && expr->spec_index == -1) {
+ int i;
+ for(i = 0; i < expr->specializations.pspecs_count; i++) {
+ arg->expr = expr->specializations.pspec[i].my_clone;
+ ret = asn1f_recurse_expr(arg, callback);
+ RET2RVAL(ret, rvalue);
+ }
+ arg->expr = expr; /* revert */
+ return rvalue;
+ }
+
/*
* Invoke the callback at this very level.
*/
diff --git a/libasn1fix/asn1fix_param.c b/libasn1fix/asn1fix_param.c
index a4d96902..bbd7cf4d 100644
--- a/libasn1fix/asn1fix_param.c
+++ b/libasn1fix/asn1fix_param.c
@@ -1,306 +1,217 @@
#include "asn1fix_internal.h"
-static int asn1f_parametrize(arg_t *arg, asn1p_expr_t *ex, asn1p_expr_t *ptype);
-static int asn1f_param_process_recursive(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype, asn1p_expr_t *actargs);
-static int asn1f_param_process_constraints(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype, asn1p_expr_t *actargs);
-
-static asn1p_expr_t *_referenced_argument(asn1p_ref_t *ref, asn1p_expr_t *ptype, asn1p_expr_t *actargs);
-static int _process_constraints(arg_t *arg, asn1p_constraint_t *ct, asn1p_expr_t *ptype, asn1p_expr_t *actargs);
-
-int
-asn1f_fix_parametrized_assignment(arg_t *arg) {
- asn1p_expr_t *expr = arg->expr;
- asn1p_expr_t *ptype;
+typedef struct resolver_arg {
+ asn1p_expr_t *(*resolver)(asn1p_expr_t *, void *arg);
+ arg_t *arg;
+ asn1p_expr_t *original_expr;
+ asn1p_paramlist_t *lhs_params;
+ asn1p_expr_t *rhs_pspecs;
+} resolver_arg_t;
+
+static asn1p_expr_t *resolve_expr(asn1p_expr_t *, void *resolver_arg);
+static int compare_specializations(arg_t *, asn1p_expr_t *a, asn1p_expr_t *b);
+static asn1p_expr_t *find_target_specialization_byref(resolver_arg_t *rarg, asn1p_ref_t *ref);
+static asn1p_expr_t *find_target_specialization_bystr(resolver_arg_t *rarg, char *str);
+
+asn1p_expr_t *
+asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_pspecs) {
+ resolver_arg_t rarg; /* resolver argument */
+ asn1p_expr_t *exc; /* expr clone */
+ asn1p_expr_t *rpc; /* rhs_pspecs clone */
+ asn1p_expr_t *target;
+ void *p;
+ struct asn1p_pspec_s *pspec;
+ int npspecs;
+ int i;
- assert(expr->expr_type == A1TC_PARAMETRIZED);
- assert(expr->reference);
+ assert(rhs_pspecs);
+ assert(expr->lhs_params);
+ assert(expr->parent_expr == 0);
- DEBUG("(\"%s\" ::= \"%s\" { %s }) for line %d",
- expr->Identifier,
- asn1f_printable_reference(expr->reference),
- asn1f_printable_value(expr->value),
- expr->_lineno);
+ DEBUG("Forking parameterization at %d for %s (%d alr)",
+ rhs_pspecs->_lineno, expr->Identifier,
+ expr->specializations.pspecs_count);
/*
- * Find the corresponding parametrized type definition.
+ * Find if this exact specialization has been used already.
*/
- DEBUG("Looking for parametrized type definition \"%s\"",
- asn1f_printable_reference(expr->reference));
- ptype = asn1f_lookup_symbol(arg, expr->module, expr->reference);
- if(ptype == NULL) {
- DEBUG("%s: missing parametrized type declaration",
- asn1f_printable_reference(expr->reference));
- return -1;
+ for(npspecs = 0;
+ npspecs < expr->specializations.pspecs_count;
+ npspecs++) {
+ if(compare_specializations(arg, rhs_pspecs,
+ expr->specializations.pspec[npspecs].rhs_pspecs) == 0) {
+ DEBUG("Reused parameterization for %s",
+ expr->Identifier);
+ return expr->specializations.pspec[npspecs].my_clone;
+ }
}
- /*
- * Check that the number of arguments which are expected by
- * the parametrized type declaration is consistent with the
- * number of arguments supplied by the parametrized assignment.
- */
- if(asn1f_count_children(expr) != ptype->params->params_count) {
- FATAL("Number of actual arguments %d in %s at line %d "
- "is not equal to number of expected arguments "
- "%d in %s at line %d",
- asn1f_count_children(expr),
- asn1f_printable_reference(expr->reference),
- expr->_lineno,
- ptype->params->params_count,
- ptype->Identifier,
- ptype->_lineno
- );
- return -1;
- }
+ rarg.resolver = resolve_expr;
+ rarg.arg = arg;
+ rarg.original_expr = expr;
+ rarg.lhs_params = expr->lhs_params;
+ rarg.rhs_pspecs = rhs_pspecs;
+ exc = asn1p_expr_clone_with_resolver(expr, resolve_expr, &rarg);
+ rpc = asn1p_expr_clone(rhs_pspecs, 0);
+ assert(exc && rpc);
/*
- * Perform an expansion of a parametrized assignment.
+ * Create a new specialization.
*/
- return asn1f_parametrize(arg, expr, ptype);
-}
-
-#define SUBSTITUTE(to, from) do { \
- asn1p_expr_t tmp, *__v; \
- if((to)->tag.tag_class \
- && (from)->tag.tag_class) { \
- FATAL("Layered tagging in parametrization " \
- "is not yet supported, " \
- "contact asn1c author for assistance " \
- "with line %d", (to)->_lineno); \
- return -1; \
- } \
- /* This code shall not be invoked too early */ \
- assert((to)->combined_constraints == NULL); \
- assert((from)->combined_constraints == NULL); \
- /* Copy stuff, and merge some parameters */ \
- tmp = *(to); \
- *(to) = *(from); \
- TQ_MOVE(&(to)->members, &(from)->members); \
- *(from) = tmp; \
- (to)->next = tmp.next; \
- (to)->parent_expr = tmp.parent_expr; \
- assert((to)->marker.flags == EM_NOMARK); \
- (to)->marker = tmp.marker; \
- if(tmp.tag.tag_class) \
- (to)->tag = tmp.tag; \
- if(tmp.constraints) { \
- if((to)->constraints) { \
- asn1p_constraint_t *ct; \
- ct = asn1p_constraint_new( \
- (to)->constraints->_lineno); \
- ct->type = ACT_CA_SET; \
- asn1p_constraint_insert(ct, \
- (to)->constraints); \
- asn1p_constraint_insert(ct, \
- tmp.constraints); \
- (to)->constraints = ct; \
- } else { \
- (to)->constraints = tmp.constraints; \
- } \
- } \
- (from)->constraints = 0; \
- (from)->marker.default_value = 0; \
- memset(&((from)->next), 0, sizeof((from)->next)); \
- memset(&((from)->members), 0, sizeof((from)->members)); \
- asn1p_expr_free(from); \
- TQ_FOR(__v, &((to)->members), next) { \
- assert(__v->parent_expr == (from)); \
- __v->parent_expr = (to); \
- } \
-} while(0)
-
-static int
-asn1f_parametrize(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype) {
- asn1p_expr_t *nex;
- void *p;
- int ret;
-
- DEBUG("asn1f_parametrize(%s <= %s)",
- expr->Identifier, ptype->Identifier);
-
- /*
- * The algorithm goes like that:
- * 1. Replace the expression's type with parametrized type.
- * 2. For every child in the parametrized type, import it
- * as a child of the expression, replacing all occurences of
- * symbols which are defined as parametrized type arguments
- * with the actual values.
- * 3. Don't forget to parametrize the subtype constraints.
- */
-
- nex = asn1p_expr_clone(ptype, 0);
- if(nex == NULL) return -1;
-
- /*
- * Cleanup the new expression so there is no ptype-related
- * stuff hanging around.
- */
- if(expr->Identifier) {
- p = strdup(expr->Identifier);
- if(p) {
- free(nex->Identifier);
- nex->Identifier = p;
- } else {
- asn1p_expr_free(nex);
- return -1;
- }
+ npspecs = expr->specializations.pspecs_count;
+ p = realloc(expr->specializations.pspec,
+ (npspecs + 1) * sizeof(expr->specializations.pspec[0]));
+ assert(p);
+ expr->specializations.pspec = p;
+ pspec = &expr->specializations.pspec[npspecs];
+ memset(pspec, 0, sizeof *pspec);
+
+ pspec->rhs_pspecs = rpc;
+ pspec->my_clone = exc;
+ exc->spec_index = npspecs;
+
+ /* Update LHS->RHS specialization in target */
+ target = TQ_FIRST(&rpc->members);
+ for(i = 0; i < exc->lhs_params->params_count;
+ i++, target = TQ_NEXT(target, next)) {
+ if(!target) { target = (void *)0xdeadbeef; break; }
+
+ assert(exc->lhs_params->params[i].into_expr == 0);
+ exc->lhs_params->params[i].into_expr = target;
}
- asn1p_paramlist_free(nex->params);
- nex->params = NULL;
- nex->meta_type = expr->meta_type;
-
- ret = asn1f_param_process_recursive(arg, nex, ptype, expr);
- if(ret != 0) {
- asn1p_expr_free(nex);
- return ret;
+ if(target) {
+ asn1p_expr_free(exc);
+ asn1p_expr_free(rpc);
+ FATAL("Parameterization of %s failed: "
+ "parameters number mismatch", expr->Identifier);
+ errno = EPERM;
+ return NULL;
}
- SUBSTITUTE(expr, nex);
+ DEBUG("Forked new parameterization for %s", expr->Identifier);
- return ret;
+ /* Commit */
+ expr->specializations.pspecs_count = npspecs + 1;
+ return exc;
}
static int
-asn1f_param_process_recursive(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype, asn1p_expr_t *actargs) {
- asn1p_expr_t *child;
-
-
- TQ_FOR(child, &(expr->members), next) {
- asn1p_expr_t *ra;
- asn1p_expr_t *ne; /* new expression (clone) */
-
- if(asn1f_param_process_constraints(arg, child, ptype, actargs))
- return -1;
-
- ra = _referenced_argument(child->reference, ptype, actargs);
- if(ra) {
- DEBUG("Substituting parameter for %s %s at line %d",
- child->Identifier,
- asn1f_printable_reference(child->reference),
- child->_lineno
- );
-
- assert(child->meta_type == AMT_TYPEREF);
- assert(child->expr_type == A1TC_REFERENCE);
-
- ne = asn1p_expr_clone(ra, 0);
- if(ne == NULL) return -1;
- assert(ne->Identifier == 0);
- ne->Identifier = strdup(child->Identifier);
- if(ne->Identifier == 0) {
- asn1p_expr_free(ne);
- return -1;
- }
- SUBSTITUTE(child, ne);
+compare_specializations(arg_t *arg, asn1p_expr_t *a, asn1p_expr_t *b) {
+ asn1p_expr_t *ac = TQ_FIRST(&a->members);
+ asn1p_expr_t *bc = TQ_FIRST(&b->members);
+
+ for(;ac && bc; ac = TQ_NEXT(ac, next), bc = TQ_NEXT(bc, next)) {
+ retry:
+ if(ac == bc) continue;
+ if(ac->meta_type != bc->meta_type) break;
+ if(ac->expr_type != bc->expr_type) break;
+
+ if(!ac->reference && !bc->reference)
+ continue;
+
+ if(ac->reference) {
+ ac = asn1f_lookup_symbol(arg,
+ ac->module, ac->rhs_pspecs, ac->reference);
+ if(!ac) break;
}
+ if(bc->reference) {
+ bc = asn1f_lookup_symbol(arg,
+ bc->module, bc->rhs_pspecs, bc->reference);
+ if(!bc) break;
+ }
+ goto retry;
}
+ if(ac || bc)
+ /* Specializations do not match: different size option sets */
+ return -1;
+
return 0;
}
-/*
- * Check that the given ref looks like an argument of a parametrized type.
- */
static asn1p_expr_t *
-_referenced_argument(asn1p_ref_t *ref, asn1p_expr_t *ptype, asn1p_expr_t *actargs) {
- asn1p_expr_t *aa;
- int i;
+resolve_expr(asn1p_expr_t *expr_to_resolve, void *resolver_arg) {
+ resolver_arg_t *rarg = resolver_arg;
+ arg_t *arg = rarg->arg;
+ asn1p_expr_t *expr;
+ asn1p_expr_t *nex;
- if(ref == NULL || ref->comp_count != 1)
+ DEBUG("Resolving %s (meta %d)",
+ expr_to_resolve->Identifier, expr_to_resolve->meta_type);
+
+ if(expr_to_resolve->meta_type == AMT_TYPEREF) {
+ expr = find_target_specialization_byref(rarg,
+ expr_to_resolve->reference);
+ if(!expr) return NULL;
+ } else if(expr_to_resolve->meta_type == AMT_VALUE) {
+ assert(expr_to_resolve->value);
+ expr = find_target_specialization_bystr(rarg,
+ expr_to_resolve->Identifier);
+ if(!expr) return NULL;
+ } else {
+ errno = ESRCH;
return NULL;
-
- aa = TQ_FIRST(&(actargs->members));
- for(i = 0; i < ptype->params->params_count;
- i++, aa = TQ_NEXT(aa, next)) {
- if(strcmp(ref->components[0].name,
- ptype->params->params[i].argument) == 0)
- return aa;
}
- return NULL;
-}
-
-/*
- * Search for parameters inside constraints.
- */
-static int
-asn1f_param_process_constraints(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *ptype, asn1p_expr_t *actargs) {
- asn1p_constraint_t *cts;
- int ret;
-
- if(!expr->constraints) return 0;
-
- cts = asn1p_constraint_clone(expr->constraints);
- assert(cts);
-
- ret = _process_constraints(arg, cts, ptype, actargs);
- if(ret == 1) {
- asn1p_constraint_free(expr->constraints);
- expr->constraints = cts;
- ret = 0;
+ DEBUG("Found target %s", expr->Identifier);
+ if(expr->meta_type == AMT_TYPE
+ || expr->meta_type == AMT_VALUE) {
+ DEBUG("Target is a simple type %s",
+ ASN_EXPR_TYPE2STR(expr->expr_type));
+ nex = asn1p_expr_clone(expr, 0);
+ free(nex->Identifier);
+ nex->Identifier = expr_to_resolve->Identifier
+ ? strdup(expr_to_resolve->Identifier) : 0;
+ return nex;
} else {
- asn1p_constraint_free(cts);
+ FATAL("Feature not implemented for %s",
+ rarg->original_expr->Identifier);
+ errno = EPERM;
+ return NULL;
}
- return ret;
+ return NULL;
}
-static int
-_process_constraints(arg_t *arg, asn1p_constraint_t *ct, asn1p_expr_t *ptype, asn1p_expr_t *actargs) {
- asn1p_value_t *values[3];
- int rvalue = 0;
- size_t i;
-
- values[0] = ct->value;
- values[1] = ct->range_start;
- values[2] = ct->range_stop;
-
- for(i = 0; i < sizeof(values)/sizeof(values[0]); i++) {
- asn1p_value_t *v = values[i];
- asn1p_expr_t *ra;
- asn1p_ref_t *ref;
- char *str;
-
- if(!v || v->type != ATV_REFERENCED) continue;
+static asn1p_expr_t *
+find_target_specialization_byref(resolver_arg_t *rarg, asn1p_ref_t *ref) {
+ char *refstr;
- ref = v->value.reference;
- ra = _referenced_argument(ref, ptype, actargs);
- if(!ra) continue;
+ if(!ref || ref->comp_count != 1) {
+ errno = ESRCH;
+ return NULL;
+ }
- DEBUG("_process_constraints(%s), ra=%s",
- asn1f_printable_reference(ref), ra->Identifier);
+ refstr = ref->components[0].name; /* T */
- if(ra->expr_type == A1TC_PARAMETRIZED) {
- DEBUG("Double %s", "parametrization");
- }
+ return find_target_specialization_bystr(rarg, refstr);
+}
- assert(ra->Identifier);
- str = strdup(ra->Identifier);
- if(!str) return -1;
+static asn1p_expr_t *
+find_target_specialization_bystr(resolver_arg_t *rarg, char *refstr) {
+ arg_t *arg = rarg->arg;
+ asn1p_expr_t *target;
+ int i;
- assert(ref->comp_count == 1);
- ref = asn1p_ref_new(ref->_lineno);
- if(!ref) { free(str); return -1; }
+ target = TQ_FIRST(&rarg->rhs_pspecs->members);
+ for(i = 0; i < rarg->lhs_params->params_count;
+ i++, target = TQ_NEXT(target, next)) {
+ struct asn1p_param_s *param = &rarg->lhs_params->params[i];
+ if(!target) break;
- if(asn1p_ref_add_component(ref, str, 0)) {
- free(str);
- return -1;
- }
+ if(strcmp(param->argument, refstr))
+ continue;
- asn1p_ref_free(v->value.reference);
- v->value.reference = ref;
- rvalue = 1;
+ return target;
}
-
- /* Process the rest of constraints recursively */
- for(i = 0; i < ct->el_count; i++) {
- int ret = _process_constraints(arg, ct->elements[i],
- ptype, actargs);
- if(ret == -1)
- rvalue = -1;
- else if(ret == 1 && rvalue != -1)
- rvalue = 1;
+ if(i != rarg->lhs_params->params_count) {
+ FATAL("Parameterization of %s failed: "
+ "parameters number mismatch",
+ rarg->original_expr->Identifier);
+ errno = EPERM;
+ return NULL;
}
- return rvalue;
+ errno = ESRCH;
+ return NULL;
}
-
diff --git a/libasn1fix/asn1fix_param.h b/libasn1fix/asn1fix_param.h
index 062ad8bd..5940b0e8 100644
--- a/libasn1fix/asn1fix_param.h
+++ b/libasn1fix/asn1fix_param.h
@@ -1,6 +1,6 @@
-#ifndef _ASN1FIX_PARAMETRIZATION_H_
-#define _ASN1FIX_PARAMETRIZATION_H_
+#ifndef _ASN1FIX_PARAMETERIZATION_H_
+#define _ASN1FIX_PARAMETERIZATION_H_
-int asn1f_fix_parametrized_assignment(arg_t *arg);
+asn1p_expr_t *asn1f_parameterization_fork(arg_t *arg, asn1p_expr_t *expr, asn1p_expr_t *rhs_pspecs);
-#endif /* _ASN1FIX_PARAMETRIZATION_H_ */
+#endif /* _ASN1FIX_PARAMETERIZATION_H_ */
diff --git a/libasn1fix/asn1fix_retrieve.c b/libasn1fix/asn1fix_retrieve.c
index 2c004be5..52506b81 100644
--- a/libasn1fix/asn1fix_retrieve.c
+++ b/libasn1fix/asn1fix_retrieve.c
@@ -146,7 +146,7 @@ asn1f_lookup_module(arg_t *arg, const char *module_name, asn1p_oid_t *oid) {
}
static asn1p_expr_t *
-asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref, int recursion_depth) {
+asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref, int recursion_depth) {
asn1p_expr_t *ref_tc; /* Referenced tc */
asn1p_module_t *imports_from;
char *modulename;
@@ -193,7 +193,7 @@ asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref, int
* This is a reference to a CLASS-related stuff.
* Employ a separate function for that.
*/
- extract = asn1f_class_access(arg, mod, ref);
+ extract = asn1f_class_access(arg, mod, rhs_pspecs, ref);
return extract;
} else {
@@ -255,7 +255,8 @@ asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref, int
assert(tmpref.comp_count > 0);
}
- expr = asn1f_lookup_symbol_impl(arg, imports_from, &tmpref, recursion_depth);
+ expr = asn1f_lookup_symbol_impl(arg, imports_from,
+ rhs_pspecs, &tmpref, recursion_depth);
if(!expr && !(arg->expr->_mark & TM_BROKEN)
&& !(imports_from->_tags & MT_STANDARD_MODULE)) {
arg->expr->_mark |= TM_BROKEN;
@@ -285,9 +286,38 @@ asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref, int
if(strcmp(ref_tc->Identifier, identifier) == 0)
break;
}
- if(ref_tc)
+ if(ref_tc) {
+ if(rhs_pspecs && !ref_tc->lhs_params) {
+ FATAL("Parameterized type %s expected "
+ "for %s at line %d",
+ ref_tc->Identifier,
+ asn1f_printable_reference(ref),
+ ref->_lineno);
+ errno = EPERM;
+ return NULL;
+ }
+ if(!rhs_pspecs && ref_tc->lhs_params) {
+ FATAL("Type %s expects specialization "
+ "from %s at line %d",
+ ref_tc->Identifier,
+ asn1f_printable_reference(ref),
+ ref->_lineno);
+ errno = EPERM;
+ return NULL;
+ }
+ if(rhs_pspecs && ref_tc->lhs_params) {
+ /* Specialize the target */
+ ref_tc = asn1f_parameterization_fork(arg,
+ ref_tc, rhs_pspecs);
+ }
+
return ref_tc;
+ }
+ /*
+ * Not found in the current module.
+ * Search in our default standard module.
+ */
{
/* Search inside standard module */
static asn1p_oid_t *uioc_oid;
@@ -335,8 +365,9 @@ asn1f_lookup_symbol_impl(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref, int
asn1p_expr_t *
-asn1f_lookup_symbol(arg_t *arg, asn1p_module_t *mod, asn1p_ref_t *ref) {
- return asn1f_lookup_symbol_impl(arg, mod, ref, 0);
+asn1f_lookup_symbol(arg_t *arg,
+ asn1p_module_t *mod, asn1p_expr_t *rhs_pspecs, asn1p_ref_t *ref) {
+ return asn1f_lookup_symbol_impl(arg, mod, rhs_pspecs, ref, 0);
}
asn1p_expr_t *
@@ -397,7 +428,7 @@ asn1f_find_terminal_thing(arg_t *arg, asn1p_expr_t *expr, enum ftt_what what) {
/*
* Lookup inside the default module and its IMPORTS section.
*/
- tc = asn1f_lookup_symbol(arg, expr->module, ref);
+ tc = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, ref);
if(tc == NULL) {
DEBUG("\tSymbol \"%s\" not found: %s",
asn1f_printable_reference(ref),
diff --git a/libasn1fix/asn1fix_retrieve.h b/libasn1fix/asn1fix_retrieve.h
index 8ab02607..2aeb82be 100644
--- a/libasn1fix/asn1fix_retrieve.h
+++ b/libasn1fix/asn1fix_retrieve.h
@@ -39,6 +39,7 @@ asn1p_module_t *asn1f_lookup_module(arg_t *arg,
*/
asn1p_expr_t *asn1f_lookup_symbol(arg_t *arg,
asn1p_module_t *mod,
+ asn1p_expr_t *rhs_pspecs,
asn1p_ref_t *ref);
/*
diff --git a/libasn1fix/asn1fix_tags.c b/libasn1fix/asn1fix_tags.c
index 3215fff6..db4d4ed1 100644
--- a/libasn1fix/asn1fix_tags.c
+++ b/libasn1fix/asn1fix_tags.c
@@ -66,7 +66,7 @@ asn1f_fetch_tags_impl(arg_t *arg, struct asn1p_type_tag_s **tags, int count, int
if(expr->meta_type == AMT_TYPEREF) {
asn1p_expr_t *nexpr;
DEBUG("Following the reference %s", expr->Identifier);
- nexpr = asn1f_lookup_symbol(arg, expr->module, expr->reference);
+ nexpr = asn1f_lookup_symbol(arg, expr->module, expr->rhs_pspecs, expr->reference);
if(nexpr == NULL) {
if(errno != EEXIST) /* -fknown-extern-type */
return -1;
diff --git a/libasn1parser/asn1p_constr.c b/libasn1parser/asn1p_constr.c
index bce4272f..7aa464ee 100644
--- a/libasn1parser/asn1p_constr.c
+++ b/libasn1parser/asn1p_constr.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <errno.h>
#include <assert.h>
@@ -45,14 +46,20 @@ asn1p_constraint_free(asn1p_constraint_t *ct) {
asn1p_constraint_t *
asn1p_constraint_clone(asn1p_constraint_t *src) {
+ return asn1p_constraint_clone_with_resolver(src, 0, 0);
+}
+
+asn1p_constraint_t *
+asn1p_constraint_clone_with_resolver(asn1p_constraint_t *src,
+ asn1p_value_t *(*vr)(asn1p_value_t *, void *varg), void *varg) {
asn1p_constraint_t *clone;
-#define CLONE(field, func) do { if(src->field) { \
- clone->field = func(src->field); \
- if(clone->field == NULL) { \
- asn1p_constraint_free(clone); \
- return NULL; \
- } \
+#define CLONE(field, func) do { if(src->field) { \
+ clone->field = func(src->field, vr, varg); \
+ if(clone->field == NULL) { \
+ asn1p_constraint_free(clone); \
+ return NULL; \
+ } \
} } while(0)
clone = asn1p_constraint_new(src->_lineno);
@@ -61,14 +68,14 @@ asn1p_constraint_clone(asn1p_constraint_t *src) {
clone->type = src->type;
clone->presence = src->presence;
- CLONE(containedSubtype, asn1p_value_clone);
- CLONE(value, asn1p_value_clone);
- CLONE(range_start, asn1p_value_clone);
- CLONE(range_stop, asn1p_value_clone);
+ CLONE(containedSubtype, asn1p_value_clone_with_resolver);
+ CLONE(value, asn1p_value_clone_with_resolver);
+ CLONE(range_start, asn1p_value_clone_with_resolver);
+ CLONE(range_stop, asn1p_value_clone_with_resolver);
for(i = 0; i < src->el_count; i++) {
asn1p_constraint_t *t;
- t = asn1p_constraint_clone(src->elements[i]);
+ t = asn1p_constraint_clone_with_resolver(src->elements[i], vr, varg);
if(!t) {
asn1p_constraint_free(clone);
return NULL;
@@ -86,32 +93,55 @@ asn1p_constraint_clone(asn1p_constraint_t *src) {
return clone;
}
-int
-asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what) {
- assert(into);
- assert(what);
-
- /*
- * Make sure there's enough space to add an element.
- */
- if(into->el_count == into->el_size) {
- unsigned int newsize = into->el_size?into->el_size<<2:4;
+/*
+ * Make sure there's enough space to add an element.
+ */
+static int
+asn1p_constraint_make_memory(asn1p_constraint_t *ct) {
+ if(ct->el_count == ct->el_size) {
+ unsigned int newsize = ct->el_size ? ct->el_size << 2 : 4;
void *p;
- p = realloc(into->elements,
- newsize * sizeof(into->elements[0]));
+ p = realloc(ct->elements, newsize * sizeof(ct->elements[0]));
if(p) {
- into->elements = p;
- into->el_size = newsize;
+ ct->elements = p;
+ ct->el_size = newsize;
} else {
return -1;
}
}
+ return 0;
+}
+
+int
+asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what) {
+ assert(into);
+ assert(what);
+
+ if(asn1p_constraint_make_memory(into))
+ return -1;
into->elements[into->el_count++] = what;
return 0;
}
+int
+asn1p_constraint_prepend(asn1p_constraint_t *before, asn1p_constraint_t *what) {
+ assert(before);
+ assert(what);
+
+ if(asn1p_constraint_make_memory(before))
+ return -1;
+
+ memmove(&before->elements[1], &before->elements[0],
+ before->el_count * sizeof(before->elements[0]));
+
+ before->elements[0] = what;
+ before->el_count++;
+
+ return 0;
+}
+
char *
asn1p_constraint_type2str(enum asn1p_constraint_type_e type) {
diff --git a/libasn1parser/asn1p_constr.h b/libasn1parser/asn1p_constr.h
index 8dd547b8..912fd8f7 100644
--- a/libasn1parser/asn1p_constr.h
+++ b/libasn1parser/asn1p_constr.h
@@ -76,10 +76,14 @@ void asn1p_constraint_free(asn1p_constraint_t *);
* Clone the constraint and all its children.
*/
asn1p_constraint_t *asn1p_constraint_clone(asn1p_constraint_t *source_to_clone);
+asn1p_constraint_t *asn1p_constraint_clone_with_resolver(
+ asn1p_constraint_t *source_to_clone,
+ asn1p_value_t *(*resolver)(asn1p_value_t *, void *), void *);
/*
* Insert additional element into the element array of a (to) constraint.
*/
int asn1p_constraint_insert(asn1p_constraint_t *into, asn1p_constraint_t *what);
+int asn1p_constraint_prepend(asn1p_constraint_t *before, asn1p_constraint_t *what);
#endif /* ASN1_PARSER_CONSTRAINT_H */
diff --git a/libasn1parser/asn1p_expr.c b/libasn1parser/asn1p_expr.c
index f5626a7b..266f2d76 100644
--- a/libasn1parser/asn1p_expr.c
+++ b/libasn1parser/asn1p_expr.c
@@ -6,6 +6,9 @@
#include "asn1parser.h"
+static asn1p_expr_t *asn1p_expr_clone_impl(asn1p_expr_t *expr, int skip_extensions, asn1p_expr_t *(*)(asn1p_expr_t *, void *), void *);
+static asn1p_value_t *value_resolver(asn1p_value_t *, void *arg);
+
/*
* Construct a new empty types collection.
*/
@@ -16,6 +19,7 @@ asn1p_expr_new(int _lineno) {
expr = calloc(1, sizeof *expr);
if(expr) {
TQ_INIT(&(expr->members));
+ expr->spec_index = -1;
expr->_lineno = _lineno;
}
@@ -24,22 +28,63 @@ asn1p_expr_new(int _lineno) {
asn1p_expr_t *
asn1p_expr_clone(asn1p_expr_t *expr, int skip_extensions) {
- asn1p_expr_t *clone;
+ return asn1p_expr_clone_impl(expr, skip_extensions, 0, 0);
+}
+
+asn1p_expr_t *
+asn1p_expr_clone_with_resolver(asn1p_expr_t *expr, asn1p_expr_t *(*r)(asn1p_expr_t *, void *), void *rarg) {
+ return asn1p_expr_clone_impl(expr, 0, r, rarg);
+}
+
+static asn1p_expr_t *
+asn1p_expr_clone_impl(asn1p_expr_t *expr, int skip_extensions, asn1p_expr_t *(*r)(asn1p_expr_t *, void *), void *rarg) {
+ asn1p_value_t *(*vr)(asn1p_value_t *, void *) = 0;
+ asn1p_expr_t *clone = 0;
asn1p_expr_t *tcmemb; /* Child of tc */
int hit_ext = 0;
- clone = asn1p_expr_new(expr->_lineno);
- if(clone == NULL) return NULL;
-
#define CLCOPY(field) do { clone->field = expr->field; } while(0)
-#define CLCLONE(field, func) do { if(expr->field) { \
- clone->field = func(expr->field); \
- if(clone->field == NULL) { \
- asn1p_expr_free(clone); \
- return NULL; \
- } \
+#define CLCLONE(field, func) do { if(expr->field) { \
+ clone->field = func(expr->field); \
+ if(clone->field == NULL) { \
+ asn1p_expr_free(clone); \
+ return NULL; \
+ } \
+ } } while(0)
+#define CLVRCLONE(field, func) do { if(expr->field) { \
+ clone->field = func(expr->field, vr, rarg); \
+ if(clone->field == NULL) { \
+ asn1p_expr_free(clone); \
+ return NULL; \
+ } \
} } while(0)
+ if(r) {
+ vr = value_resolver;
+ clone = r(expr, rarg);
+ if(clone) {
+ /* Merge constraints */
+ if(expr->constraints) {
+ asn1p_constraint_t *tmpct = asn1p_constraint_clone_with_resolver(expr->constraints, vr, rarg);
+ if(clone->constraints) {
+ if(asn1p_constraint_insert(clone->constraints, tmpct)) {
+ asn1p_constraint_free(tmpct);
+ asn1p_expr_free(clone);
+ return NULL;
+ }
+ } else {
+ clone->constraints = tmpct;
+ }
+ }
+ assert(expr->combined_constraints == 0);
+ return clone;
+ } else if(errno != ESRCH) {
+ return NULL; /* Hard error */
+ }
+ }
+ if(!clone) clone = asn1p_expr_new(expr->_lineno);
+ if(!clone) return NULL;
+
/*
* Copy simple fields.
*/
@@ -58,10 +103,10 @@ asn1p_expr_clone(asn1p_expr_t *expr, int skip_extensions) {
*/
CLCLONE(Identifier, strdup);
CLCLONE(reference, asn1p_ref_clone);
- CLCLONE(constraints, asn1p_constraint_clone);
- CLCLONE(combined_constraints, asn1p_constraint_clone);
- CLCLONE(params, asn1p_paramlist_clone);
- CLCLONE(value, asn1p_value_clone);
+ CLVRCLONE(constraints, asn1p_constraint_clone_with_resolver);
+ CLVRCLONE(combined_constraints, asn1p_constraint_clone_with_resolver);
+ CLCLONE(lhs_params, asn1p_paramlist_clone);
+ CLVRCLONE(value, asn1p_value_clone_with_resolver);
CLCLONE(marker.default_value, asn1p_value_clone);
CLCLONE(with_syntax, asn1p_wsyntx_clone);
@@ -78,7 +123,7 @@ asn1p_expr_clone(asn1p_expr_t *expr, int skip_extensions) {
}
if(hit_ext == 1) continue; /* Skip between ...'s */
- cmemb = asn1p_expr_clone(tcmemb, skip_extensions);
+ cmemb = asn1p_expr_clone_impl(tcmemb, skip_extensions, r, rarg);
if(cmemb == NULL) {
asn1p_expr_free(clone);
return NULL;
@@ -89,6 +134,48 @@ asn1p_expr_clone(asn1p_expr_t *expr, int skip_extensions) {
return clone;
}
+
+static asn1p_value_t *
+value_resolver(asn1p_value_t *value, void *rarg) {
+ asn1p_value_t *cval;
+ asn1p_expr_t *tmpexpr;
+ asn1p_expr_t *target;
+ asn1p_ref_t *ref;
+ struct {
+ asn1p_expr_t *(*expr_resolve)(asn1p_expr_t *, void *arg);
+ } *varg = rarg;
+
+ if(!value || value->type != ATV_REFERENCED) {
+ errno = ESRCH;
+ return NULL;
+ }
+
+ ref = value->value.reference;
+ tmpexpr = asn1p_expr_new(ref->_lineno);
+ tmpexpr->meta_type = AMT_TYPEREF;
+ tmpexpr->expr_type = A1TC_REFERENCE;
+ tmpexpr->reference = ref;
+ target = varg->expr_resolve(tmpexpr, rarg);
+ tmpexpr->reference = 0;
+ asn1p_expr_free(tmpexpr);
+
+ if(!target)
+ return NULL; /* errno's are compatible */
+
+ if(!target->value) {
+ fprintf(stderr,
+ "FATAL: Parameterization did not resolve value reference "
+ "at line %d", ref->_lineno);
+ asn1p_expr_free(target);
+ errno = EPERM;
+ return NULL;
+ }
+
+ cval = asn1p_value_clone(target->value);
+ asn1p_expr_free(target);
+ return cval;
+}
+
/*
* Add expression as a member of another.
*/
@@ -125,8 +212,8 @@ asn1p_expr_free(asn1p_expr_t *expr) {
asn1p_constraint_free(expr->constraints);
if(expr->combined_constraints)
asn1p_constraint_free(expr->combined_constraints);
- if(expr->params)
- asn1p_paramlist_free(expr->params);
+ if(expr->lhs_params)
+ asn1p_paramlist_free(expr->lhs_params);
if(expr->value)
asn1p_value_free(expr->value);
if(expr->marker.default_value)
diff --git a/libasn1parser/asn1p_expr.h b/libasn1parser/asn1p_expr.h
index bc5abf78..32645efc 100644
--- a/libasn1parser/asn1p_expr.h
+++ b/libasn1parser/asn1p_expr.h
@@ -11,7 +11,6 @@ typedef enum asn1p_expr_meta {
AMT_INVALID,
AMT_TYPE, /* Type1 ::= INTEGER */
AMT_TYPEREF, /* Type2 ::= Type1 */
- AMT_PARAMTYPE, /* Type3{Parameter} ::= SET { ... } */
AMT_VALUE, /* value1 Type1 ::= 1 */
AMT_VALUESET, /* ValueSet Type1 ::= { value1 } */
AMT_OBJECT, /* object CLASS ::= {...} */
@@ -35,7 +34,6 @@ typedef enum asn1p_expr_type {
A1TC_OPAQUE, /* Opaque data encoded as a bitvector */
A1TC_EXTENSIBLE, /* An extension marker "..." */
A1TC_COMPONENTS_OF, /* COMPONENTS OF clause */
- A1TC_PARAMETRIZED, /* A parametrized type declaration */
A1TC_VALUESET, /* Value set definition */
A1TC_CLASSDEF, /* Information Object Class */
A1TC_INSTANCE, /* Instance of Object Class */
@@ -148,10 +146,27 @@ typedef struct asn1p_expr_s {
asn1p_constraint_t *combined_constraints;
/*
- * A list of parameters for parametrized type declaration
- * (AMT_PARAMTYPE).
+ * Left hand side parameters for parametrized type declaration
+ * Type{Param1, Param2} ::= SEQUENCE { a Param1, b Param2 }
*/
- asn1p_paramlist_t *params;
+ asn1p_paramlist_t *lhs_params;
+ /*
+ * Right hand type specialization.
+ * Type2 ::= Type{Param1}
+ */
+ struct asn1p_expr_s *rhs_pspecs; /* ->members */
+ /*
+ * If lhs_params is defined, this structure represents all possible
+ * specializations of the parent expression.
+ */
+ struct {
+ struct asn1p_pspec_s {
+ struct asn1p_expr_s *rhs_pspecs;
+ struct asn1p_expr_s *my_clone;
+ } *pspec;
+ int pspecs_count; /* Number of specializations */
+ } specializations;
+ int spec_index; /* -1, or 0-based specialization index in the parent */
/*
* The actual value (DefinedValue or inlined value).
@@ -258,6 +273,9 @@ typedef struct asn1p_expr_s {
*/
asn1p_expr_t *asn1p_expr_new(int _lineno);
asn1p_expr_t *asn1p_expr_clone(asn1p_expr_t *, int skip_extensions);
+asn1p_expr_t *asn1p_expr_clone_with_resolver(asn1p_expr_t *,
+ asn1p_expr_t *(*resolver)(asn1p_expr_t *to_resolve, void *resolver_arg),
+ void *resolver_arg);
void asn1p_expr_add(asn1p_expr_t *to, asn1p_expr_t *what);
void asn1p_expr_free(asn1p_expr_t *expr);
diff --git a/libasn1parser/asn1p_l.c b/libasn1parser/asn1p_l.c
index 12084cc0..d4f152ff 100644
--- a/libasn1parser/asn1p_l.c
+++ b/libasn1parser/asn1p_l.c
@@ -28,7 +28,7 @@
#define YY_FLEX_MINOR_VERSION 5
#include <stdio.h>
-#include <errno.h>
+
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
@@ -41,9 +41,7 @@
#ifdef __cplusplus
#include <stdlib.h>
-#ifndef _WIN32
#include <unistd.h>
-#endif
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
@@ -83,7 +81,6 @@
#define YY_PROTO(proto) ()
#endif
-
/* Returned upon end-of-file. */
#define YY_NULL 0
@@ -1887,7 +1884,7 @@ static asn1c_integer_t _lex_atoi(const char *ptr);
/* Newline */
/* White-space */
-#line 1891 "asn1p_l.c"
+#line 1888 "asn1p_l.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1987,20 +1984,9 @@ YY_MALLOC_DECL
YY_FATAL_ERROR( "input in flex scanner failed" ); \
result = n; \
} \
- else \
- { \
- errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
- { \
- if( errno != EINTR) \
- { \
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
- break; \
- } \
- errno=0; \
- clearerr(yyin); \
- } \
- }
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
/* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -2052,7 +2038,7 @@ YY_DECL
#line 93 "asn1p_l.l"
-#line 2056 "asn1p_l.c"
+#line 2042 "asn1p_l.c"
if ( yy_init )
{
@@ -3112,7 +3098,7 @@ YY_RULE_SETUP
#line 538 "asn1p_l.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 3116 "asn1p_l.c"
+#line 3102 "asn1p_l.c"
case YY_END_OF_BUFFER:
{
@@ -3672,15 +3658,11 @@ YY_BUFFER_STATE b;
}
-#ifndef _WIN32
-#include <unistd.h>
-#else
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif
-#endif
#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
diff --git a/libasn1parser/asn1p_param.c b/libasn1parser/asn1p_param.c
index f7082241..3dc511bb 100644
--- a/libasn1parser/asn1p_param.c
+++ b/libasn1parser/asn1p_param.c
@@ -61,6 +61,8 @@ asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) {
if(p) {
pl->params = p;
pl->params_size = newsize;
+ memset(&pl->params[pl->params_count], 0,
+ sizeof(pl->params[0]));
} else {
return -1;
}
@@ -69,9 +71,8 @@ asn1p_paramlist_add_param(asn1p_paramlist_t *pl, asn1p_ref_t *gov, char *arg) {
if(gov) {
pl->params[pl->params_count].governor = asn1p_ref_clone(gov);
- if(pl->params[pl->params_count].governor == NULL) {
+ if(pl->params[pl->params_count].governor == NULL)
return -1;
- }
} else {
pl->params[pl->params_count].governor = 0;
}
@@ -103,6 +104,7 @@ asn1p_paramlist_clone(asn1p_paramlist_t *pl) {
newpl = NULL;
break;
}
+ newpl->params[i].into_expr = pl->params[i].into_expr;
}
}
diff --git a/libasn1parser/asn1p_param.h b/libasn1parser/asn1p_param.h
index c9c20c23..141c82ba 100644
--- a/libasn1parser/asn1p_param.h
+++ b/libasn1parser/asn1p_param.h
@@ -1,17 +1,21 @@
/*
- * Structures and prototypes related to parametrization
+ * Structures and prototypes related to parameterization
*/
-#ifndef ASN1_PARSER_PARAMETRIZATION_H
-#define ASN1_PARSER_PARAMETRIZATION_H
+#ifndef ASN1_PARSER_PARAMETERIZATION_H
+#define ASN1_PARSER_PARAMETERIZATION_H
+
+struct asn1p_expr_s; /* Forward declaration */
typedef struct asn1p_paramlist_s {
struct asn1p_param_s {
+ /* Translated from */
asn1p_ref_t *governor;
char *argument;
+ /* Translated into */
+ struct asn1p_expr_s *into_expr;
} *params;
int params_count;
int params_size;
-
int _lineno;
} asn1p_paramlist_t;
@@ -27,4 +31,4 @@ int asn1p_paramlist_add_param(asn1p_paramlist_t *,
asn1p_ref_t *opt_gov, char *arg);
-#endif /* ASN1_PARSER_PARAMETRIZATION_H */
+#endif /* ASN1_PARSER_PARAMETERIZATION_H */
diff --git a/libasn1parser/asn1p_value.c b/libasn1parser/asn1p_value.c
index 2242e3f2..6686e497 100644
--- a/libasn1parser/asn1p_value.c
+++ b/libasn1parser/asn1p_value.c
@@ -110,6 +110,13 @@ asn1p_value_fromint(asn1c_integer_t i) {
asn1p_value_t *
asn1p_value_clone(asn1p_value_t *v) {
+ return asn1p_value_clone_with_resolver(v, 0, 0);
+}
+
+asn1p_value_t *
+asn1p_value_clone_with_resolver(asn1p_value_t *v,
+ asn1p_value_t *(*resolver)(asn1p_value_t *, void *rarg),
+ void *rarg) {
asn1p_value_t *clone = NULL;
if(v) {
switch(v->type) {
@@ -142,6 +149,11 @@ asn1p_value_clone(asn1p_value_t *v) {
return asn1p_value_frombits(v->value.binary_vector.bits,
v->value.binary_vector.size_in_bits, 1);
case ATV_REFERENCED:
+ if(resolver) {
+ clone = resolver(v, rarg);
+ if(clone) return clone;
+ else if(errno != ESRCH) return NULL;
+ }
return asn1p_value_fromref(v->value.reference, 1);
case ATV_CHOICE_IDENTIFIER: {
char *id = v->value.choice_identifier.identifier;
diff --git a/libasn1parser/asn1p_value.h b/libasn1parser/asn1p_value.h
index a0103413..5705f745 100644
--- a/libasn1parser/asn1p_value.h
+++ b/libasn1parser/asn1p_value.h
@@ -52,17 +52,20 @@ typedef struct asn1p_value_s {
} asn1p_value_t;
/*
- * Constructors and destructor for value.
+ * Destructor and constructors for value.
* If ref, bits or buffer are omitted, the corresponding function returns
* (asn1p_value_t *)0 with errno = EINVAL.
* Allocated value (where applicable) is guaranteed to be NUL-terminated.
*/
+void asn1p_value_free(asn1p_value_t *);
asn1p_value_t *asn1p_value_fromref(asn1p_ref_t *ref, int do_copy);
asn1p_value_t *asn1p_value_frombits(uint8_t *bits, int size_in_bits, int dc);
asn1p_value_t *asn1p_value_frombuf(char *buffer, int size, int do_copy);
asn1p_value_t *asn1p_value_fromdouble(double);
asn1p_value_t *asn1p_value_fromint(asn1c_integer_t);
asn1p_value_t *asn1p_value_clone(asn1p_value_t *);
-void asn1p_value_free(asn1p_value_t *);
+asn1p_value_t *asn1p_value_clone_with_resolver(asn1p_value_t *,
+ asn1p_value_t *(*resolver)(asn1p_value_t *, void *rarg),
+ void *rarg);
#endif /* ASN1_PARSER_VALUE_H */
diff --git a/libasn1parser/asn1p_y.c b/libasn1parser/asn1p_y.c
index 86481ff9..31598c8e 100644
--- a/libasn1parser/asn1p_y.c
+++ b/libasn1parser/asn1p_y.c
@@ -1,281 +1,119 @@
-/* A Bison parser, made by GNU Bison 2.1. */
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* A Bison parser, made from asn1p_y.y
+ by GNU Bison version 1.28 */
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
-
-/* All symbols defined below should begin with yy or YY, to avoid
- infringing on user name space. This should be done even for local
- variables, as they might otherwise be expanded by user macros.
- There are some unavoidable exceptions within include files to
- define necessary library symbols; they are noted "INFRINGES ON
- USER NAME SPACE" below. */
+#define YYBISON 1 /* Identify Bison output. */
-/* Identify Bison output. */
-#define YYBISON 1
-
-/* Bison version. */
-#define YYBISON_VERSION "2.1"
-
-/* Skeleton name. */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers. */
-#define YYPURE 0
-
-/* Using locations. */
-#define YYLSP_NEEDED 0
-
-/* Substitute the variable and function names. */
#define yyparse asn1p_parse
-#define yylex asn1p_lex
+#define yylex asn1p_lex
#define yyerror asn1p_error
-#define yylval asn1p_lval
-#define yychar asn1p_char
+#define yylval asn1p_lval
+#define yychar asn1p_char
#define yydebug asn1p_debug
#define yynerrs asn1p_nerrs
+#define TOK_PPEQ 257
+#define TOK_whitespace 258
+#define TOK_opaque 259
+#define TOK_bstring 260
+#define TOK_cstring 261
+#define TOK_hstring 262
+#define TOK_identifier 263
+#define TOK_number 264
+#define TOK_tuple 265
+#define TOK_quadruple 266
+#define TOK_number_negative 267
+#define TOK_typereference 268
+#define TOK_capitalreference 269
+#define TOK_typefieldreference 270
+#define TOK_valuefieldreference 271
+#define TOK_Literal 272
+#define TOK_ABSENT 273
+#define TOK_ABSTRACT_SYNTAX 274
+#define TOK_ALL 275
+#define TOK_ANY 276
+#define TOK_APPLICATION 277
+#define TOK_AUTOMATIC 278
+#define TOK_BEGIN 279
+#define TOK_BIT 280
+#define TOK_BMPString 281
+#define TOK_BOOLEAN 282
+#define TOK_BY 283
+#define TOK_CHARACTER 284
+#define TOK_CHOICE 285
+#define TOK_CLASS 286
+#define TOK_COMPONENT 287
+#define TOK_COMPONENTS 288
+#define TOK_CONSTRAINED 289
+#define TOK_CONTAINING 290
+#define TOK_DEFAULT 291
+#define TOK_DEFINITIONS 292
+#define TOK_DEFINED 293
+#define TOK_EMBEDDED 294
+#define TOK_ENCODED 295
+#define TOK_ENCODING_CONTROL 296
+#define TOK_END 297
+#define TOK_ENUMERATED 298
+#define TOK_EXPLICIT 299
+#define TOK_EXPORTS 300
+#define TOK_EXTENSIBILITY 301
+#define TOK_EXTERNAL 302
+#define TOK_FALSE 303
+#define TOK_FROM 304
+#define TOK_GeneralizedTime 305
+#define TOK_GeneralString 306
+#define TOK_GraphicString 307
+#define TOK_IA5String 308
+#define TOK_IDENTIFIER 309
+#define TOK_IMPLICIT 310
+#define TOK_IMPLIED 311
+#define TOK_IMPORTS 312
+#define TOK_INCLUDES 313
+#define TOK_INSTANCE 314
+#define TOK_INSTRUCTIONS 315
+#define TOK_INTEGER 316
+#define TOK_ISO646String 317
+#define TOK_MAX 318
+#define TOK_MIN 319
+#define TOK_MINUS_INFINITY 320
+#define TOK_NULL 321
+#define TOK_NumericString 322
+#define TOK_OBJECT 323
+#define TOK_ObjectDescriptor 324
+#define TOK_OCTET 325
+#define TOK_OF 326
+#define TOK_OPTIONAL 327
+#define TOK_PATTERN 328
+#define TOK_PDV 329
+#define TOK_PLUS_INFINITY 330
+#define TOK_PRESENT 331
+#define TOK_PrintableString 332
+#define TOK_PRIVATE 333
+#define TOK_REAL 334
+#define TOK_RELATIVE_OID 335
+#define TOK_SEQUENCE 336
+#define TOK_SET 337
+#define TOK_SIZE 338
+#define TOK_STRING 339
+#define TOK_SYNTAX 340
+#define TOK_T61String 341
+#define TOK_TAGS 342
+#define TOK_TeletexString 343
+#define TOK_TRUE 344
+#define TOK_TYPE_IDENTIFIER 345
+#define TOK_UNIQUE 346
+#define TOK_UNIVERSAL 347
+#define TOK_UniversalString 348
+#define TOK_UTCTime 349
+#define TOK_UTF8String 350
+#define TOK_VideotexString 351
+#define TOK_VisibleString 352
+#define TOK_WITH 353
+#define TOK_EXCEPT 354
+#define TOK_INTERSECTION 355
+#define TOK_UNION 356
+#define TOK_TwoDots 357
+#define TOK_ThreeDots 358
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- TOK_PPEQ = 258,
- TOK_whitespace = 259,
- TOK_opaque = 260,
- TOK_bstring = 261,
- TOK_cstring = 262,
- TOK_hstring = 263,
- TOK_identifier = 264,
- TOK_number = 265,
- TOK_tuple = 266,
- TOK_quadruple = 267,
- TOK_number_negative = 268,
- TOK_typereference = 269,
- TOK_capitalreference = 270,
- TOK_typefieldreference = 271,
- TOK_valuefieldreference = 272,
- TOK_Literal = 273,
- TOK_ABSENT = 274,
- TOK_ABSTRACT_SYNTAX = 275,
- TOK_ALL = 276,
- TOK_ANY = 277,
- TOK_APPLICATION = 278,
- TOK_AUTOMATIC = 279,
- TOK_BEGIN = 280,
- TOK_BIT = 281,
- TOK_BMPString = 282,
- TOK_BOOLEAN = 283,
- TOK_BY = 284,
- TOK_CHARACTER = 285,
- TOK_CHOICE = 286,
- TOK_CLASS = 287,
- TOK_COMPONENT = 288,
- TOK_COMPONENTS = 289,
- TOK_CONSTRAINED = 290,
- TOK_CONTAINING = 291,
- TOK_DEFAULT = 292,
- TOK_DEFINITIONS = 293,
- TOK_DEFINED = 294,
- TOK_EMBEDDED = 295,
- TOK_ENCODED = 296,
- TOK_ENCODING_CONTROL = 297,
- TOK_END = 298,
- TOK_ENUMERATED = 299,
- TOK_EXPLICIT = 300,
- TOK_EXPORTS = 301,
- TOK_EXTENSIBILITY = 302,
- TOK_EXTERNAL = 303,
- TOK_FALSE = 304,
- TOK_FROM = 305,
- TOK_GeneralizedTime = 306,
- TOK_GeneralString = 307,
- TOK_GraphicString = 308,
- TOK_IA5String = 309,
- TOK_IDENTIFIER = 310,
- TOK_IMPLICIT = 311,
- TOK_IMPLIED = 312,
- TOK_IMPORTS = 313,
- TOK_INCLUDES = 314,
- TOK_INSTANCE = 315,
- TOK_INSTRUCTIONS = 316,
- TOK_INTEGER = 317,
- TOK_ISO646String = 318,
- TOK_MAX = 319,
- TOK_MIN = 320,
- TOK_MINUS_INFINITY = 321,
- TOK_NULL = 322,
- TOK_NumericString = 323,
- TOK_OBJECT = 324,
- TOK_ObjectDescriptor = 325,
- TOK_OCTET = 326,
- TOK_OF = 327,
- TOK_OPTIONAL = 328,
- TOK_PATTERN = 329,
- TOK_PDV = 330,
- TOK_PLUS_INFINITY = 331,
- TOK_PRESENT = 332,
- TOK_PrintableString = 333,
- TOK_PRIVATE = 334,
- TOK_REAL = 335,
- TOK_RELATIVE_OID = 336,
- TOK_SEQUENCE = 337,
- TOK_SET = 338,
- TOK_SIZE = 339,
- TOK_STRING = 340,
- TOK_SYNTAX = 341,
- TOK_T61String = 342,
- TOK_TAGS = 343,
- TOK_TeletexString = 344,
- TOK_TRUE = 345,
- TOK_TYPE_IDENTIFIER = 346,
- TOK_UNIQUE = 347,
- TOK_UNIVERSAL = 348,
- TOK_UniversalString = 349,
- TOK_UTCTime = 350,
- TOK_UTF8String = 351,
- TOK_VideotexString = 352,
- TOK_VisibleString = 353,
- TOK_WITH = 354,
- TOK_EXCEPT = 355,
- TOK_INTERSECTION = 356,
- TOK_UNION = 357,
- TOK_TwoDots = 358,
- TOK_ThreeDots = 359
- };
-#endif
-/* Tokens. */
-#define TOK_PPEQ 258
-#define TOK_whitespace 259
-#define TOK_opaque 260
-#define TOK_bstring 261
-#define TOK_cstring 262
-#define TOK_hstring 263
-#define TOK_identifier 264
-#define TOK_number 265
-#define TOK_tuple 266
-#define TOK_quadruple 267
-#define TOK_number_negative 268
-#define TOK_typereference 269
-#define TOK_capitalreference 270
-#define TOK_typefieldreference 271
-#define TOK_valuefieldreference 272
-#define TOK_Literal 273
-#define TOK_ABSENT 274
-#define TOK_ABSTRACT_SYNTAX 275
-#define TOK_ALL 276
-#define TOK_ANY 277
-#define TOK_APPLICATION 278
-#define TOK_AUTOMATIC 279
-#define TOK_BEGIN 280
-#define TOK_BIT 281
-#define TOK_BMPString 282
-#define TOK_BOOLEAN 283
-#define TOK_BY 284
-#define TOK_CHARACTER 285
-#define TOK_CHOICE 286
-#define TOK_CLASS 287
-#define TOK_COMPONENT 288
-#define TOK_COMPONENTS 289
-#define TOK_CONSTRAINED 290
-#define TOK_CONTAINING 291
-#define TOK_DEFAULT 292
-#define TOK_DEFINITIONS 293
-#define TOK_DEFINED 294
-#define TOK_EMBEDDED 295
-#define TOK_ENCODED 296
-#define TOK_ENCODING_CONTROL 297
-#define TOK_END 298
-#define TOK_ENUMERATED 299
-#define TOK_EXPLICIT 300
-#define TOK_EXPORTS 301
-#define TOK_EXTENSIBILITY 302
-#define TOK_EXTERNAL 303
-#define TOK_FALSE 304
-#define TOK_FROM 305
-#define TOK_GeneralizedTime 306
-#define TOK_GeneralString 307
-#define TOK_GraphicString 308
-#define TOK_IA5String 309
-#define TOK_IDENTIFIER 310
-#define TOK_IMPLICIT 311
-#define TOK_IMPLIED 312
-#define TOK_IMPORTS 313
-#define TOK_INCLUDES 314
-#define TOK_INSTANCE 315
-#define TOK_INSTRUCTIONS 316
-#define TOK_INTEGER 317
-#define TOK_ISO646String 318
-#define TOK_MAX 319
-#define TOK_MIN 320
-#define TOK_MINUS_INFINITY 321
-#define TOK_NULL 322
-#define TOK_NumericString 323
-#define TOK_OBJECT 324
-#define TOK_ObjectDescriptor 325
-#define TOK_OCTET 326
-#define TOK_OF 327
-#define TOK_OPTIONAL 328
-#define TOK_PATTERN 329
-#define TOK_PDV 330
-#define TOK_PLUS_INFINITY 331
-#define TOK_PRESENT 332
-#define TOK_PrintableString 333
-#define TOK_PRIVATE 334
-#define TOK_REAL 335
-#define TOK_RELATIVE_OID 336
-#define TOK_SEQUENCE 337
-#define TOK_SET 338
-#define TOK_SIZE 339
-#define TOK_STRING 340
-#define TOK_SYNTAX 341
-#define TOK_T61String 342
-#define TOK_TAGS 343
-#define TOK_TeletexString 344
-#define TOK_TRUE 345
-#define TOK_TYPE_IDENTIFIER 346
-#define TOK_UNIQUE 347
-#define TOK_UNIVERSAL 348
-#define TOK_UniversalString 349
-#define TOK_UTCTime 350
-#define TOK_UTF8String 351
-#define TOK_VideotexString 352
-#define TOK_VisibleString 353
-#define TOK_WITH 354
-#define TOK_EXCEPT 355
-#define TOK_INTERSECTION 356
-#define TOK_UNION 357
-#define TOK_TwoDots 358
-#define TOK_ThreeDots 359
-
-
-
-
-/* Copy the first part of user declarations. */
#line 1 "asn1p_y.y"
@@ -341,28 +179,8 @@ static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
} while(0)
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
-
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
-#endif
-
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 72 "asn1p_y.y"
-typedef union YYSTYPE {
+typedef union {
asn1p_t *a_grammar;
asn1p_module_flags_e a_module_flags;
asn1p_module_t *a_module;
@@ -395,1360 +213,906 @@ typedef union YYSTYPE {
struct asn1p_type_tag_s tag;
} tv_nametag;
} YYSTYPE;
-/* Line 196 of yacc.c. */
-#line 400 "asn1p_y.c"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
+#include <stdio.h>
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
#endif
-/* Copy the second part of user declarations. */
+#define YYFINAL 442
+#define YYFLAG -32768
+#define YYNTBASE 120
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 358 ? yytranslate[x] : 226)
+
+static const char yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 116, 2, 2, 2, 2, 2, 2, 109,
+ 110, 2, 2, 112, 2, 117, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 113, 111, 118,
+ 2, 2, 2, 119, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 114, 2, 115, 101, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 107, 103, 108, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 102, 104, 105, 106
+};
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 2, 4, 7, 16, 17, 19, 23, 26, 28,
+ 31, 33, 38, 40, 41, 43, 45, 48, 51, 54,
+ 57, 60, 63, 64, 66, 68, 71, 73, 75, 77,
+ 79, 81, 82, 86, 88, 92, 95, 97, 100, 101,
+ 103, 108, 110, 114, 116, 120, 122, 126, 130, 133,
+ 135, 139, 141, 145, 147, 148, 155, 157, 159, 163,
+ 167, 174, 176, 180, 182, 186, 190, 194, 196, 200,
+ 202, 204, 205, 207, 209, 213, 217, 220, 224, 226,
+ 228, 232, 235, 237, 239, 245, 246, 248, 250, 254,
+ 257, 262, 266, 270, 274, 278, 282, 283, 285, 286,
+ 293, 295, 298, 300, 302, 304, 308, 310, 314, 318,
+ 322, 323, 326, 328, 333, 338, 343, 350, 357, 359,
+ 364, 366, 371, 375, 377, 381, 385, 389, 391, 395,
+ 397, 401, 403, 405, 407, 409, 413, 417, 419, 424,
+ 428, 429, 433, 435, 437, 439, 441, 443, 445, 447,
+ 449, 451, 455, 457, 459, 461, 463, 466, 468, 470,
+ 472, 474, 477, 480, 482, 484, 487, 490, 492, 494,
+ 496, 498, 500, 503, 505, 508, 510, 512, 514, 516,
+ 518, 520, 522, 524, 526, 528, 530, 532, 534, 536,
+ 538, 540, 542, 544, 546, 547, 549, 551, 556, 560,
+ 565, 567, 571, 577, 579, 583, 587, 591, 595, 600,
+ 604, 606, 608, 612, 616, 620, 624, 626, 628, 629,
+ 635, 637, 640, 643, 647, 649, 651, 653, 655, 657,
+ 659, 661, 663, 667, 673, 675, 679, 681, 685, 686,
+ 688, 690, 692, 694, 696, 698, 702, 707, 709, 713,
+ 716, 720, 722, 726, 727, 729, 731, 734, 737, 741,
+ 743, 747, 749, 754, 759, 761, 763, 765, 767, 768,
+ 770, 773, 778, 779, 781, 783, 785, 786, 788, 790,
+ 792, 794, 796, 797, 799
+};
-/* Line 219 of yacc.c. */
-#line 412 "asn1p_y.c"
+static const short yyrhs[] = { 121,
+ 0, 122, 0, 121, 122, 0, 222, 123, 38, 127,
+ 3, 25, 130, 43, 0, 0, 124, 0, 107, 125,
+ 108, 0, 107, 108, 0, 126, 0, 125, 126, 0,
+ 225, 0, 225, 109, 10, 110, 0, 10, 0, 0,
+ 128, 0, 129, 0, 128, 129, 0, 45, 88, 0,
+ 56, 88, 0, 24, 88, 0, 47, 57, 0, 15,
+ 61, 0, 0, 131, 0, 132, 0, 131, 132, 0,
+ 134, 0, 140, 0, 146, 0, 176, 0, 143, 0,
+ 0, 42, 15, 133, 0, 185, 0, 58, 135, 111,
+ 0, 58, 50, 0, 137, 0, 135, 137, 0, 0,
+ 124, 0, 138, 50, 222, 136, 0, 139, 0, 138,
+ 112, 139, 0, 222, 0, 222, 107, 108, 0, 225,
+ 0, 46, 141, 111, 0, 46, 21, 111, 0, 46,
+ 111, 0, 142, 0, 141, 112, 142, 0, 222, 0,
+ 222, 107, 108, 0, 225, 0, 0, 222, 145, 3,
+ 107, 144, 181, 0, 170, 0, 182, 0, 222, 3,
+ 166, 0, 222, 3, 156, 0, 222, 107, 147, 108,
+ 3, 166, 0, 148, 0, 147, 112, 148, 0, 222,
+ 0, 222, 113, 225, 0, 222, 113, 222, 0, 182,
+ 113, 225, 0, 150, 0, 149, 112, 150, 0, 166,
+ 0, 225, 0, 0, 152, 0, 153, 0, 152, 112,
+ 153, 0, 225, 166, 211, 0, 166, 211, 0, 34,
+ 72, 166, 0, 165, 0, 155, 0, 154, 112, 155,
+ 0, 225, 166, 0, 165, 0, 166, 0, 32, 107,
+ 158, 108, 160, 0, 0, 92, 0, 159, 0, 158,
+ 112, 159, 0, 16, 211, 0, 17, 166, 157, 211,
+ 0, 17, 174, 211, 0, 17, 175, 211, 0, 16,
+ 174, 211, 0, 16, 166, 211, 0, 16, 175, 211,
+ 0, 0, 161, 0, 0, 99, 86, 107, 162, 163,
+ 108, 0, 164, 0, 163, 164, 0, 4, 0, 18,
+ 0, 173, 0, 114, 163, 115, 0, 106, 0, 106,
+ 116, 179, 0, 106, 116, 216, 0, 217, 168, 189,
+ 0, 0, 167, 169, 0, 184, 0, 31, 107, 154,
+ 108, 0, 82, 107, 151, 108, 0, 83, 107, 151,
+ 108, 0, 82, 189, 72, 224, 217, 168, 0, 83,
+ 189, 72, 224, 217, 168, 0, 22, 0, 22, 39,
+ 29, 225, 0, 170, 0, 170, 107, 149, 108, 0,
+ 60, 72, 170, 0, 14, 0, 14, 117, 222, 0,
+ 223, 117, 222, 0, 14, 117, 225, 0, 223, 0,
+ 223, 117, 171, 0, 172, 0, 171, 117, 172, 0,
+ 173, 0, 16, 0, 17, 0, 16, 0, 174, 117,
+ 16, 0, 174, 117, 17, 0, 15, 0, 225, 145,
+ 3, 177, 0, 225, 113, 177, 0, 0, 107, 178,
+ 181, 0, 67, 0, 49, 0, 90, 0, 6, 0,
+ 8, 0, 180, 0, 216, 0, 179, 0, 225, 0,
+ 222, 117, 225, 0, 7, 0, 11, 0, 12, 0,
+ 5, 0, 181, 5, 0, 28, 0, 67, 0, 80,
+ 0, 183, 0, 71, 85, 0, 69, 55, 0, 81,
+ 0, 48, 0, 40, 75, 0, 30, 85, 0, 95,
+ 0, 51, 0, 185, 0, 62, 0, 44, 0, 26,
+ 85, 0, 182, 0, 183, 213, 0, 27, 0, 52,
+ 0, 53, 0, 54, 0, 63, 0, 68, 0, 78,
+ 0, 87, 0, 89, 0, 94, 0, 96, 0, 97,
+ 0, 98, 0, 70, 0, 103, 0, 104, 0, 101,
+ 0, 102, 0, 100, 0, 0, 190, 0, 191, 0,
+ 84, 109, 192, 110, 0, 109, 192, 110, 0, 191,
+ 109, 192, 110, 0, 193, 0, 193, 112, 106, 0,
+ 193, 112, 106, 112, 193, 0, 194, 0, 21, 100,
+ 194, 0, 193, 186, 194, 0, 193, 187, 194, 0,
+ 194, 188, 194, 0, 197, 109, 192, 110, 0, 109,
+ 192, 110, 0, 198, 0, 199, 0, 198, 196, 198,
+ 0, 65, 196, 198, 0, 198, 196, 64, 0, 65,
+ 196, 64, 0, 205, 0, 200, 0, 0, 35, 29,
+ 107, 195, 181, 0, 105, 0, 105, 118, 0, 118,
+ 105, 0, 118, 105, 118, 0, 84, 0, 50, 0,
+ 49, 0, 90, 0, 216, 0, 180, 0, 225, 0,
+ 222, 0, 99, 33, 191, 0, 99, 34, 107, 201,
+ 108, 0, 202, 0, 201, 112, 202, 0, 106, 0,
+ 225, 189, 203, 0, 0, 204, 0, 77, 0, 19,
+ 0, 73, 0, 206, 0, 207, 0, 107, 222, 108,
+ 0, 206, 107, 208, 108, 0, 209, 0, 208, 112,
+ 209, 0, 119, 210, 0, 119, 117, 210, 0, 225,
+ 0, 210, 117, 225, 0, 0, 212, 0, 73, 0,
+ 37, 177, 0, 107, 108, 0, 107, 214, 108, 0,
+ 215, 0, 214, 112, 215, 0, 225, 0, 225, 109,
+ 216, 110, 0, 225, 109, 179, 110, 0, 216, 0,
+ 106, 0, 10, 0, 13, 0, 0, 218, 0, 219,
+ 221, 0, 114, 220, 10, 115, 0, 0, 93, 0,
+ 23, 0, 79, 0, 0, 56, 0, 45, 0, 14,
+ 0, 15, 0, 15, 0, 0, 225, 0, 9, 0
+};
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
-#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
-#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
#endif
-#ifndef YY_
-# if YYENABLE_NLS
-# if ENABLE_NLS
-# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
-# endif
-# endif
-# ifndef YY_
-# define YY_(msgid) msgid
-# endif
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 321, 327, 333, 349, 374, 376, 379, 383, 388, 395,
+ 403, 408, 412, 421, 423, 431, 435, 443, 447, 450,
+ 453, 457, 477, 479, 487, 491, 523, 527, 536, 543,
+ 556, 563, 565, 577, 589, 600, 605, 611, 617, 619,
+ 622, 633, 639, 645, 652, 658, 666, 670, 673, 680,
+ 686, 692, 699, 705, 714, 716, 725, 733, 747, 757,
+ 773, 781, 791, 801, 806, 813, 820, 830, 836, 842,
+ 846, 873, 875, 877, 883, 889, 897, 903, 910, 915,
+ 921, 927, 933, 936, 942, 952, 954, 957, 965, 972,
+ 985, 996, 1006, 1017, 1027, 1038, 1049, 1051, 1056, 1060,
+ 1065, 1070, 1076, 1081, 1084, 1088, 1093, 1102, 1111, 1122,
+ 1144, 1151, 1170, 1174, 1180, 1186, 1192, 1202, 1212, 1218,
+ 1239, 1249, 1257, 1271, 1280, 1290, 1300, 1310, 1318, 1339,
+ 1348, 1357, 1359, 1366, 1373, 1379, 1383, 1389, 1409, 1419,
+ 1427, 1427, 1432, 1437, 1442, 1447, 1451, 1455, 1458, 1461,
+ 1466, 1478, 1495, 1500, 1505, 1538, 1548, 1562, 1564, 1565,
+ 1566, 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575,
+ 1581, 1583, 1584, 1587, 1594, 1606, 1608, 1612, 1616, 1617,
+ 1618, 1619, 1620, 1624, 1625, 1626, 1627, 1631, 1632, 1639,
+ 1639, 1640, 1640, 1641, 1643, 1645, 1650, 1654, 1663, 1667,
+ 1672, 1676, 1682, 1692, 1696, 1699, 1702, 1705, 1710, 1719,
+ 1727, 1733, 1739, 1746, 1754, 1762, 1771, 1774, 1777, 1778,
+ 1788, 1790, 1791, 1792, 1795, 1799, 1804, 1810, 1815, 1818,
+ 1821, 1834, 1848, 1852, 1857, 1861, 1866, 1873, 1886, 1888,
+ 1891, 1895, 1898, 1903, 1907, 1915, 1930, 1936, 1943, 1956,
+ 1968, 1983, 1987, 2004, 2009, 2012, 2017, 2039, 2044, 2049,
+ 2055, 2061, 2069, 2077, 2085, 2092, 2102, 2107, 2137, 2139,
+ 2142, 2149, 2155, 2157, 2158, 2159, 2162, 2164, 2165, 2168,
+ 2173, 2180, 2187, 2189, 2194
+};
#endif
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols. */
-
-# ifdef YYSTACK_USE_ALLOCA
-# if YYSTACK_USE_ALLOCA
-# ifdef __GNUC__
-# define YYSTACK_ALLOC __builtin_alloca
-# else
-# define YYSTACK_ALLOC alloca
-# if defined (__STDC__) || defined (__cplusplus)
-# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYINCLUDED_STDLIB_H
-# endif
-# endif
-# endif
-# endif
-
-# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
-# ifndef YYSTACK_ALLOC_MAXIMUM
- /* The OS might guarantee only one guard page at the bottom of the stack,
- and a page size can be as small as 4096 bytes. So we cannot safely
- invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
- to allow for a few compiler-allocated temporary stack slots. */
-# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
-# endif
-# else
-# define YYSTACK_ALLOC YYMALLOC
-# define YYSTACK_FREE YYFREE
-# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
-# endif
-# ifdef __cplusplus
-extern "C" {
-# endif
-# ifndef YYMALLOC
-# define YYMALLOC malloc
-# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
-void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifndef YYFREE
-# define YYFREE free
-# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
-void free (void *); /* INFRINGES ON USER NAME SPACE */
-# endif
-# endif
-# ifdef __cplusplus
-}
-# endif
-# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
-
-
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member. */
-union yyalloc
-{
- short int yyss;
- YYSTYPE yyvs;
- };
-
-/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
- N elements. */
-# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
- + YYSTACK_GAP_MAXIMUM)
-
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (0)
-# endif
-# endif
-
-/* Relocate STACK from its old location to the new one. The
- local variables YYSIZE and YYSTACKSIZE give the old and new number of
- elements in the stack, and YYPTR gives the new location of the
- stack. Advance YYPTR to a properly aligned location for the next
- stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (0)
-
-#endif
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short int yysigned_char;
+#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
+
+static const char * const yytname[] = { "$","error","$undefined.","TOK_PPEQ",
+"TOK_whitespace","TOK_opaque","TOK_bstring","TOK_cstring","TOK_hstring","TOK_identifier",
+"TOK_number","TOK_tuple","TOK_quadruple","TOK_number_negative","TOK_typereference",
+"TOK_capitalreference","TOK_typefieldreference","TOK_valuefieldreference","TOK_Literal",
+"TOK_ABSENT","TOK_ABSTRACT_SYNTAX","TOK_ALL","TOK_ANY","TOK_APPLICATION","TOK_AUTOMATIC",
+"TOK_BEGIN","TOK_BIT","TOK_BMPString","TOK_BOOLEAN","TOK_BY","TOK_CHARACTER",
+"TOK_CHOICE","TOK_CLASS","TOK_COMPONENT","TOK_COMPONENTS","TOK_CONSTRAINED",
+"TOK_CONTAINING","TOK_DEFAULT","TOK_DEFINITIONS","TOK_DEFINED","TOK_EMBEDDED",
+"TOK_ENCODED","TOK_ENCODING_CONTROL","TOK_END","TOK_ENUMERATED","TOK_EXPLICIT",
+"TOK_EXPORTS","TOK_EXTENSIBILITY","TOK_EXTERNAL","TOK_FALSE","TOK_FROM","TOK_GeneralizedTime",
+"TOK_GeneralString","TOK_GraphicString","TOK_IA5String","TOK_IDENTIFIER","TOK_IMPLICIT",
+"TOK_IMPLIED","TOK_IMPORTS","TOK_INCLUDES","TOK_INSTANCE","TOK_INSTRUCTIONS",
+"TOK_INTEGER","TOK_ISO646String","TOK_MAX","TOK_MIN","TOK_MINUS_INFINITY","TOK_NULL",
+"TOK_NumericString","TOK_OBJECT","TOK_ObjectDescriptor","TOK_OCTET","TOK_OF",
+"TOK_OPTIONAL","TOK_PATTERN","TOK_PDV","TOK_PLUS_INFINITY","TOK_PRESENT","TOK_PrintableString",
+"TOK_PRIVATE","TOK_REAL","TOK_RELATIVE_OID","TOK_SEQUENCE","TOK_SET","TOK_SIZE",
+"TOK_STRING","TOK_SYNTAX","TOK_T61String","TOK_TAGS","TOK_TeletexString","TOK_TRUE",
+"TOK_TYPE_IDENTIFIER","TOK_UNIQUE","TOK_UNIVERSAL","TOK_UniversalString","TOK_UTCTime",
+"TOK_UTF8String","TOK_VideotexString","TOK_VisibleString","TOK_WITH","TOK_EXCEPT",
+"'^'","TOK_INTERSECTION","'|'","TOK_UNION","TOK_TwoDots","TOK_ThreeDots","'{'",
+"'}'","'('","')'","';'","','","':'","'['","']'","'!'","'.'","'<'","'@'","ParsedGrammar",
+"ModuleList","ModuleSpecification","optObjectIdentifier","ObjectIdentifier",
+"ObjectIdentifierBody","ObjectIdentifierElement","optModuleSpecificationFlags",
+"ModuleSpecificationFlags","ModuleSpecificationFlag","optModuleSpecificationBody",
+"ModuleSpecificationBody","ModuleSpecificationElement","@1","ImportsDefinition",
+"ImportsBundleSet","AssignedIdentifier","ImportsBundle","ImportsList","ImportsElement",
+"ExportsDefinition","ExportsBody","ExportsElement","ValueSetDefinition","@2",
+"DefinedTypeRef","DataTypeReference","ParameterArgumentList","ParameterArgumentName",
+"Specializations","Specialization","optComponentTypeLists","ComponentTypeLists",
+"ComponentType","AlternativeTypeLists","AlternativeType","ObjectClass","optUnique",
+"FieldSpec","ClassField","optWithSyntax","WithSyntax","@3","WithSyntaxList",
+"WithSyntaxToken","ExtensionAndException","Type","NSTD_IndirectMarker","TypeDeclaration",
+"TypeDeclarationSet","ComplexTypeReference","ComplexTypeReferenceAmpList","ComplexTypeReferenceElement",
+"PrimitiveFieldReference","FieldName","DefinedObjectClass","ValueDefinition",
+"Value","@4","DefinedValue","RestrictedCharacterStringValue","Opaque","BasicTypeId",
+"BasicTypeId_UniverationCompatible","BasicType","BasicString","Union","Intersection",
+"Except","optConstraints","Constraints","SetOfConstraints","ElementSetSpecs",
+"ElementSetSpec","ConstraintSubtypeElement","@5","ConstraintRangeSpec","ConstraintSpec",
+"SingleValue","ContainedSubtype","InnerTypeConstraint","WithComponentsList",
+"WithComponentsElement","optPresenceConstraint","PresenceConstraint","TableConstraint",
+"SimpleTableConstraint","ComponentRelationConstraint","AtNotationList","AtNotationElement",
+"ComponentIdList","optMarker","Marker","UniverationDefinition","UniverationList",
+"UniverationElement","SignedNumber","optTag","Tag","TagTypeValue","TagClass",
+"TagPlicit","TypeRefName","ObjectClassReference","optIdentifier","Identifier", NULL
+};
#endif
-/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 7
-/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 757
-
-/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 120
-/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 107
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 286
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 445
-
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 359
-
-#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
-{
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 116, 2, 2, 2, 2, 2, 2,
- 109, 110, 2, 2, 112, 2, 117, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 113, 111,
- 118, 2, 2, 2, 119, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 114, 2, 115, 101, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 107, 103, 108, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 102, 104, 105, 106
+static const short yyr1[] = { 0,
+ 120, 121, 121, 122, 123, 123, 124, 124, 125, 125,
+ 126, 126, 126, 127, 127, 128, 128, 129, 129, 129,
+ 129, 129, 130, 130, 131, 131, 132, 132, 132, 132,
+ 132, 133, 132, 132, 134, 134, 135, 135, 136, 136,
+ 137, 138, 138, 139, 139, 139, 140, 140, 140, 141,
+ 141, 142, 142, 142, 144, 143, 145, 145, 146, 146,
+ 146, 147, 147, 148, 148, 148, 148, 149, 149, 150,
+ 150, 151, 151, 152, 152, 153, 153, 153, 153, 154,
+ 154, 155, 155, 155, 156, 157, 157, 158, 158, 159,
+ 159, 159, 159, 159, 159, 159, 160, 160, 162, 161,
+ 163, 163, 164, 164, 164, 164, 165, 165, 165, 166,
+ 167, 168, 169, 169, 169, 169, 169, 169, 169, 169,
+ 169, 169, 169, 170, 170, 170, 170, 170, 170, 171,
+ 171, 172, 173, 173, 174, 174, 174, 175, 176, 177,
+ 178, 177, 177, 177, 177, 177, 177, 177, 177, 177,
+ 179, 179, 180, 180, 180, 181, 181, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+ 183, 183, 183, 184, 184, 185, 185, 185, 185, 185,
+ 185, 185, 185, 185, 185, 185, 185, 185, 185, 186,
+ 186, 187, 187, 188, 189, 189, 190, 190, 191, 191,
+ 192, 192, 192, 193, 193, 193, 193, 193, 194, 194,
+ 194, 194, 194, 194, 194, 194, 194, 194, 195, 194,
+ 196, 196, 196, 196, 197, 197, 198, 198, 198, 198,
+ 198, 199, 200, 200, 201, 201, 202, 202, 203, 203,
+ 204, 204, 204, 205, 205, 206, 207, 208, 208, 209,
+ 209, 210, 210, 211, 211, 212, 212, 213, 213, 214,
+ 214, 215, 215, 215, 215, 215, 216, 216, 217, 217,
+ 218, 219, 220, 220, 220, 220, 221, 221, 221, 222,
+ 222, 223, 224, 224, 225
};
-#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const unsigned short int yyprhs[] =
-{
- 0, 0, 3, 5, 7, 10, 19, 20, 22, 26,
- 29, 31, 34, 36, 41, 43, 44, 46, 48, 51,
- 54, 57, 60, 63, 66, 67, 69, 71, 74, 76,
- 78, 80, 82, 84, 85, 89, 91, 95, 98, 100,
- 103, 104, 106, 111, 113, 117, 119, 123, 125, 129,
- 133, 136, 138, 142, 144, 148, 150, 151, 158, 160,
- 162, 166, 170, 177, 179, 183, 185, 189, 193, 197,
- 199, 203, 205, 207, 208, 210, 212, 216, 220, 223,
- 227, 229, 231, 235, 238, 240, 242, 248, 249, 251,
- 253, 257, 260, 265, 269, 273, 277, 281, 285, 286,
- 288, 289, 296, 298, 301, 303, 305, 307, 311, 313,
- 317, 321, 325, 326, 329, 331, 336, 341, 346, 353,
- 360, 362, 367, 372, 374, 378, 380, 384, 388, 392,
- 394, 398, 400, 404, 406, 408, 410, 412, 416, 420,
- 422, 427, 431, 432, 436, 438, 440, 442, 444, 446,
- 448, 450, 452, 454, 458, 460, 462, 464, 466, 469,
- 471, 473, 475, 477, 480, 483, 485, 487, 490, 493,
- 495, 497, 499, 501, 503, 506, 508, 511, 513, 515,
- 517, 519, 521, 523, 525, 527, 529, 531, 533, 535,
- 537, 539, 541, 543, 545, 547, 549, 550, 552, 554,
- 559, 563, 568, 570, 574, 580, 582, 586, 590, 594,
- 598, 603, 607, 609, 611, 615, 619, 623, 627, 629,
- 631, 632, 638, 640, 643, 646, 650, 652, 654, 656,
- 658, 660, 662, 664, 666, 670, 676, 678, 682, 684,
- 688, 689, 691, 693, 695, 697, 699, 701, 705, 710,
- 712, 716, 719, 723, 725, 729, 730, 732, 734, 737,
- 740, 744, 746, 750, 752, 757, 762, 764, 766, 768,
- 770, 771, 773, 776, 781, 782, 784, 786, 788, 789,
- 791, 793, 795, 797, 799, 800, 802
+static const short yyr2[] = { 0,
+ 1, 1, 2, 8, 0, 1, 3, 2, 1, 2,
+ 1, 4, 1, 0, 1, 1, 2, 2, 2, 2,
+ 2, 2, 0, 1, 1, 2, 1, 1, 1, 1,
+ 1, 0, 3, 1, 3, 2, 1, 2, 0, 1,
+ 4, 1, 3, 1, 3, 1, 3, 3, 2, 1,
+ 3, 1, 3, 1, 0, 6, 1, 1, 3, 3,
+ 6, 1, 3, 1, 3, 3, 3, 1, 3, 1,
+ 1, 0, 1, 1, 3, 3, 2, 3, 1, 1,
+ 3, 2, 1, 1, 5, 0, 1, 1, 3, 2,
+ 4, 3, 3, 3, 3, 3, 0, 1, 0, 6,
+ 1, 2, 1, 1, 1, 3, 1, 3, 3, 3,
+ 0, 2, 1, 4, 4, 4, 6, 6, 1, 4,
+ 1, 4, 3, 1, 3, 3, 3, 1, 3, 1,
+ 3, 1, 1, 1, 1, 3, 3, 1, 4, 3,
+ 0, 3, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 1, 1, 1, 1, 2, 1, 1, 1,
+ 1, 2, 2, 1, 1, 2, 2, 1, 1, 1,
+ 1, 1, 2, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 1, 1, 4, 3, 4,
+ 1, 3, 5, 1, 3, 3, 3, 3, 4, 3,
+ 1, 1, 3, 3, 3, 3, 1, 1, 0, 5,
+ 1, 2, 2, 3, 1, 1, 1, 1, 1, 1,
+ 1, 1, 3, 5, 1, 3, 1, 3, 0, 1,
+ 1, 1, 1, 1, 1, 3, 4, 1, 3, 2,
+ 3, 1, 3, 0, 1, 1, 2, 2, 3, 1,
+ 3, 1, 4, 4, 1, 1, 1, 1, 0, 1,
+ 2, 4, 0, 1, 1, 1, 0, 1, 1, 1,
+ 1, 1, 0, 1, 1
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const short int yyrhs[] =
-{
- 121, 0, -1, 122, -1, 123, -1, 122, 123, -1,
- 223, 124, 38, 128, 3, 25, 131, 43, -1, -1,
- 125, -1, 107, 126, 108, -1, 107, 108, -1, 127,
- -1, 126, 127, -1, 226, -1, 226, 109, 10, 110,
- -1, 10, -1, -1, 129, -1, 130, -1, 129, 130,
- -1, 45, 88, -1, 56, 88, -1, 24, 88, -1,
- 47, 57, -1, 15, 61, -1, -1, 132, -1, 133,
- -1, 132, 133, -1, 135, -1, 141, -1, 147, -1,
- 177, -1, 144, -1, -1, 42, 15, 134, -1, 186,
- -1, 58, 136, 111, -1, 58, 50, -1, 138, -1,
- 136, 138, -1, -1, 125, -1, 139, 50, 223, 137,
- -1, 140, -1, 139, 112, 140, -1, 223, -1, 223,
- 107, 108, -1, 226, -1, 46, 142, 111, -1, 46,
- 21, 111, -1, 46, 111, -1, 143, -1, 142, 112,
- 143, -1, 223, -1, 223, 107, 108, -1, 226, -1,
- -1, 223, 146, 3, 107, 145, 182, -1, 171, -1,
- 183, -1, 223, 3, 167, -1, 223, 3, 157, -1,
- 223, 107, 148, 108, 3, 167, -1, 149, -1, 148,
- 112, 149, -1, 223, -1, 223, 113, 226, -1, 223,
- 113, 223, -1, 183, 113, 226, -1, 151, -1, 150,
- 112, 151, -1, 167, -1, 226, -1, -1, 153, -1,
- 154, -1, 153, 112, 154, -1, 226, 167, 212, -1,
- 167, 212, -1, 34, 72, 167, -1, 166, -1, 156,
- -1, 155, 112, 156, -1, 226, 167, -1, 166, -1,
- 167, -1, 32, 107, 159, 108, 161, -1, -1, 92,
- -1, 160, -1, 159, 112, 160, -1, 16, 212, -1,
- 17, 167, 158, 212, -1, 17, 175, 212, -1, 17,
- 176, 212, -1, 16, 175, 212, -1, 16, 167, 212,
- -1, 16, 176, 212, -1, -1, 162, -1, -1, 99,
- 86, 107, 163, 164, 108, -1, 165, -1, 164, 165,
- -1, 4, -1, 18, -1, 174, -1, 114, 164, 115,
- -1, 106, -1, 106, 116, 180, -1, 106, 116, 217,
- -1, 218, 169, 190, -1, -1, 168, 170, -1, 185,
- -1, 31, 107, 155, 108, -1, 82, 107, 152, 108,
- -1, 83, 107, 152, 108, -1, 82, 190, 72, 225,
- 218, 169, -1, 83, 190, 72, 225, 218, 169, -1,
- 22, -1, 22, 39, 29, 226, -1, 223, 107, 150,
- 108, -1, 171, -1, 60, 72, 171, -1, 14, -1,
- 14, 117, 223, -1, 224, 117, 223, -1, 14, 117,
- 226, -1, 224, -1, 224, 117, 172, -1, 173, -1,
- 172, 117, 173, -1, 174, -1, 16, -1, 17, -1,
- 16, -1, 175, 117, 16, -1, 175, 117, 17, -1,
- 15, -1, 226, 146, 3, 178, -1, 226, 113, 178,
- -1, -1, 107, 179, 182, -1, 67, -1, 49, -1,
- 90, -1, 6, -1, 8, -1, 181, -1, 217, -1,
- 180, -1, 226, -1, 223, 117, 226, -1, 7, -1,
- 11, -1, 12, -1, 5, -1, 182, 5, -1, 28,
- -1, 67, -1, 80, -1, 184, -1, 71, 85, -1,
- 69, 55, -1, 81, -1, 48, -1, 40, 75, -1,
- 30, 85, -1, 95, -1, 51, -1, 186, -1, 62,
- -1, 44, -1, 26, 85, -1, 183, -1, 184, 214,
- -1, 27, -1, 52, -1, 53, -1, 54, -1, 63,
- -1, 68, -1, 78, -1, 87, -1, 89, -1, 94,
- -1, 96, -1, 97, -1, 98, -1, 70, -1, 103,
- -1, 104, -1, 101, -1, 102, -1, 100, -1, -1,
- 191, -1, 192, -1, 84, 109, 193, 110, -1, 109,
- 193, 110, -1, 192, 109, 193, 110, -1, 194, -1,
- 194, 112, 106, -1, 194, 112, 106, 112, 194, -1,
- 195, -1, 21, 100, 195, -1, 194, 187, 195, -1,
- 194, 188, 195, -1, 195, 189, 195, -1, 198, 109,
- 193, 110, -1, 109, 193, 110, -1, 199, -1, 200,
- -1, 199, 197, 199, -1, 65, 197, 199, -1, 199,
- 197, 64, -1, 65, 197, 64, -1, 206, -1, 201,
- -1, -1, 35, 29, 107, 196, 182, -1, 105, -1,
- 105, 118, -1, 118, 105, -1, 118, 105, 118, -1,
- 84, -1, 50, -1, 49, -1, 90, -1, 217, -1,
- 181, -1, 226, -1, 223, -1, 99, 33, 192, -1,
- 99, 34, 107, 202, 108, -1, 203, -1, 202, 112,
- 203, -1, 106, -1, 226, 190, 204, -1, -1, 205,
- -1, 77, -1, 19, -1, 73, -1, 207, -1, 208,
- -1, 107, 223, 108, -1, 207, 107, 209, 108, -1,
- 210, -1, 209, 112, 210, -1, 119, 211, -1, 119,
- 117, 211, -1, 226, -1, 211, 117, 226, -1, -1,
- 213, -1, 73, -1, 37, 178, -1, 107, 108, -1,
- 107, 215, 108, -1, 216, -1, 215, 112, 216, -1,
- 226, -1, 226, 109, 217, 110, -1, 226, 109, 180,
- 110, -1, 217, -1, 106, -1, 10, -1, 13, -1,
- -1, 219, -1, 220, 222, -1, 114, 221, 10, 115,
- -1, -1, 93, -1, 23, -1, 79, -1, -1, 56,
- -1, 45, -1, 14, -1, 15, -1, 15, -1, -1,
- 226, -1, 9, -1
+static const short yydefact[] = { 0,
+ 280, 281, 1, 2, 5, 3, 0, 0, 6, 285,
+ 13, 8, 0, 9, 11, 14, 7, 10, 0, 0,
+ 0, 0, 0, 0, 0, 15, 16, 0, 22, 20,
+ 18, 21, 19, 0, 17, 12, 23, 176, 0, 0,
+ 177, 178, 179, 0, 180, 181, 189, 182, 183, 184,
+ 185, 186, 187, 188, 0, 24, 25, 27, 28, 31,
+ 29, 30, 34, 0, 0, 32, 0, 49, 0, 50,
+ 52, 54, 36, 0, 37, 0, 42, 44, 46, 4,
+ 26, 269, 124, 282, 0, 158, 0, 0, 172, 165,
+ 169, 171, 159, 0, 0, 160, 164, 168, 0, 0,
+ 57, 58, 161, 170, 128, 0, 33, 48, 47, 0,
+ 0, 35, 38, 0, 0, 0, 0, 273, 60, 59,
+ 111, 270, 277, 0, 173, 167, 166, 163, 162, 0,
+ 62, 0, 64, 0, 0, 0, 51, 53, 39, 43,
+ 45, 0, 275, 276, 274, 0, 0, 195, 279, 278,
+ 271, 125, 127, 0, 0, 0, 0, 55, 133, 134,
+ 129, 130, 132, 126, 146, 153, 147, 267, 154, 155,
+ 268, 144, 143, 145, 141, 139, 150, 148, 149, 0,
+ 151, 40, 41, 269, 269, 0, 88, 0, 119, 0,
+ 0, 195, 195, 112, 121, 174, 161, 113, 0, 0,
+ 110, 196, 197, 269, 63, 67, 66, 65, 0, 0,
+ 0, 0, 0, 138, 135, 0, 256, 254, 254, 254,
+ 90, 255, 86, 254, 254, 97, 0, 272, 0, 269,
+ 0, 269, 0, 269, 0, 269, 0, 175, 0, 0,
+ 0, 227, 226, 0, 225, 228, 0, 0, 0, 230,
+ 0, 201, 204, 0, 211, 212, 218, 217, 244, 245,
+ 229, 232, 231, 0, 61, 156, 56, 131, 142, 152,
+ 140, 257, 95, 0, 94, 96, 87, 254, 92, 93,
+ 0, 85, 98, 89, 0, 107, 0, 80, 83, 84,
+ 269, 123, 0, 0, 73, 74, 79, 254, 269, 283,
+ 0, 283, 0, 68, 70, 71, 266, 258, 0, 260,
+ 265, 262, 0, 0, 0, 221, 0, 0, 0, 0,
+ 0, 0, 199, 192, 193, 190, 191, 0, 0, 0,
+ 194, 0, 0, 0, 0, 0, 157, 136, 137, 91,
+ 0, 120, 0, 114, 269, 82, 269, 115, 269, 77,
+ 254, 269, 284, 116, 269, 122, 269, 259, 0, 0,
+ 198, 205, 219, 222, 223, 216, 214, 233, 0, 246,
+ 210, 202, 206, 207, 208, 0, 215, 213, 0, 0,
+ 248, 200, 99, 108, 109, 151, 81, 78, 75, 76,
+ 111, 111, 69, 261, 0, 0, 0, 224, 237, 0,
+ 235, 195, 0, 209, 0, 250, 252, 247, 0, 0,
+ 117, 118, 264, 263, 220, 234, 0, 239, 203, 251,
+ 0, 249, 103, 104, 0, 0, 101, 105, 236, 242,
+ 243, 241, 238, 240, 253, 0, 100, 102, 106, 0,
+ 0, 0
};
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned short int yyrline[] =
-{
- 0, 322, 322, 328, 333, 350, 375, 376, 380, 383,
- 389, 395, 404, 408, 412, 422, 423, 432, 435, 444,
- 447, 450, 453, 457, 478, 479, 488, 491, 524, 527,
- 536, 543, 556, 564, 563, 577, 590, 600, 606, 611,
- 618, 619, 623, 634, 639, 646, 652, 658, 667, 670,
- 673, 681, 686, 693, 699, 705, 716, 715, 726, 733,
- 751, 757, 773, 783, 792, 803, 807, 814, 821, 832,
- 837, 844, 847, 871, 872, 875, 880, 887, 894, 900,
- 907, 913, 918, 925, 930, 933, 940, 950, 951, 955,
- 962, 972, 982, 993, 1003, 1014, 1024, 1035, 1047, 1048,
- 1055, 1054, 1063, 1067, 1074, 1078, 1081, 1085, 1091, 1099,
- 1108, 1120, 1142, 1149, 1168, 1171, 1177, 1183, 1189, 1199,
- 1209, 1215, 1229, 1253, 1260, 1275, 1283, 1293, 1303, 1313,
- 1321, 1343, 1351, 1360, 1364, 1369, 1378, 1382, 1386, 1393,
- 1413, 1423, 1430, 1430, 1435, 1440, 1445, 1450, 1454, 1458,
- 1461, 1464, 1470, 1481, 1499, 1503, 1508, 1542, 1551, 1566,
- 1567, 1568, 1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576,
- 1577, 1578, 1585, 1586, 1587, 1591, 1597, 1610, 1611, 1615,
- 1619, 1620, 1621, 1622, 1623, 1627, 1628, 1629, 1630, 1634,
- 1635, 1642, 1642, 1643, 1643, 1644, 1647, 1648, 1654, 1657,
- 1667, 1670, 1676, 1679, 1685, 1696, 1699, 1702, 1705, 1708,
- 1714, 1722, 1730, 1736, 1742, 1749, 1757, 1765, 1774, 1777,
- 1781, 1780, 1792, 1793, 1794, 1795, 1799, 1802, 1808, 1813,
- 1818, 1821, 1824, 1838, 1852, 1855, 1861, 1864, 1870, 1876,
- 1890, 1891, 1895, 1898, 1901, 1907, 1910, 1919, 1934, 1940,
- 1946, 1960, 1971, 1987, 1990, 2008, 2012, 2016, 2020, 2043,
- 2047, 2053, 2058, 2065, 2072, 2080, 2088, 2095, 2106, 2110,
- 2141, 2142, 2146, 2153, 2159, 2160, 2161, 2162, 2166, 2167,
- 2168, 2172, 2176, 2184, 2191, 2192, 2198
+static const short yydefgoto[] = { 440,
+ 3, 4, 8, 9, 13, 14, 25, 26, 27, 55,
+ 56, 57, 107, 58, 74, 183, 75, 76, 77, 59,
+ 69, 70, 60, 209, 100, 61, 130, 131, 303, 304,
+ 294, 295, 296, 287, 288, 119, 278, 186, 187, 282,
+ 283, 410, 426, 427, 297, 298, 147, 148, 194, 101,
+ 161, 162, 428, 219, 220, 62, 176, 211, 177, 250,
+ 267, 102, 103, 198, 104, 329, 330, 332, 201, 202,
+ 203, 251, 252, 253, 397, 318, 254, 255, 256, 257,
+ 400, 401, 433, 434, 258, 259, 260, 380, 381, 406,
+ 221, 222, 238, 309, 310, 261, 121, 122, 123, 146,
+ 151, 262, 105, 352, 263
};
-#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
-static const char *const yytname[] =
-{
- "$end", "error", "$undefined", "TOK_PPEQ", "TOK_whitespace",
- "TOK_opaque", "TOK_bstring", "TOK_cstring", "TOK_hstring",
- "TOK_identifier", "TOK_number", "TOK_tuple", "TOK_quadruple",
- "TOK_number_negative", "TOK_typereference", "TOK_capitalreference",
- "TOK_typefieldreference", "TOK_valuefieldreference", "TOK_Literal",
- "TOK_ABSENT", "TOK_ABSTRACT_SYNTAX", "TOK_ALL", "TOK_ANY",
- "TOK_APPLICATION", "TOK_AUTOMATIC", "TOK_BEGIN", "TOK_BIT",
- "TOK_BMPString", "TOK_BOOLEAN", "TOK_BY", "TOK_CHARACTER", "TOK_CHOICE",
- "TOK_CLASS", "TOK_COMPONENT", "TOK_COMPONENTS", "TOK_CONSTRAINED",
- "TOK_CONTAINING", "TOK_DEFAULT", "TOK_DEFINITIONS", "TOK_DEFINED",
- "TOK_EMBEDDED", "TOK_ENCODED", "TOK_ENCODING_CONTROL", "TOK_END",
- "TOK_ENUMERATED", "TOK_EXPLICIT", "TOK_EXPORTS", "TOK_EXTENSIBILITY",
- "TOK_EXTERNAL", "TOK_FALSE", "TOK_FROM", "TOK_GeneralizedTime",
- "TOK_GeneralString", "TOK_GraphicString", "TOK_IA5String",
- "TOK_IDENTIFIER", "TOK_IMPLICIT", "TOK_IMPLIED", "TOK_IMPORTS",
- "TOK_INCLUDES", "TOK_INSTANCE", "TOK_INSTRUCTIONS", "TOK_INTEGER",
- "TOK_ISO646String", "TOK_MAX", "TOK_MIN", "TOK_MINUS_INFINITY",
- "TOK_NULL", "TOK_NumericString", "TOK_OBJECT", "TOK_ObjectDescriptor",
- "TOK_OCTET", "TOK_OF", "TOK_OPTIONAL", "TOK_PATTERN", "TOK_PDV",
- "TOK_PLUS_INFINITY", "TOK_PRESENT", "TOK_PrintableString", "TOK_PRIVATE",
- "TOK_REAL", "TOK_RELATIVE_OID", "TOK_SEQUENCE", "TOK_SET", "TOK_SIZE",
- "TOK_STRING", "TOK_SYNTAX", "TOK_T61String", "TOK_TAGS",
- "TOK_TeletexString", "TOK_TRUE", "TOK_TYPE_IDENTIFIER", "TOK_UNIQUE",
- "TOK_UNIVERSAL", "TOK_UniversalString", "TOK_UTCTime", "TOK_UTF8String",
- "TOK_VideotexString", "TOK_VisibleString", "TOK_WITH", "TOK_EXCEPT",
- "'^'", "TOK_INTERSECTION", "'|'", "TOK_UNION", "TOK_TwoDots",
- "TOK_ThreeDots", "'{'", "'}'", "'('", "')'", "';'", "','", "':'", "'['",
- "']'", "'!'", "'.'", "'<'", "'@'", "$accept", "ParsedGrammar",
- "ModuleList", "ModuleSpecification", "optObjectIdentifier",
- "ObjectIdentifier", "ObjectIdentifierBody", "ObjectIdentifierElement",
- "optModuleSpecificationFlags", "ModuleSpecificationFlags",
- "ModuleSpecificationFlag", "optModuleSpecificationBody",
- "ModuleSpecificationBody", "ModuleSpecificationElement", "@1",
- "ImportsDefinition", "ImportsBundleSet", "AssignedIdentifier",
- "ImportsBundle", "ImportsList", "ImportsElement", "ExportsDefinition",
- "ExportsBody", "ExportsElement", "ValueSetDefinition", "@2",
- "DefinedTypeRef", "DataTypeReference", "ParameterArgumentList",
- "ParameterArgumentName", "ActualParameterList", "ActualParameter",
- "optComponentTypeLists", "ComponentTypeLists", "ComponentType",
- "AlternativeTypeLists", "AlternativeType", "ObjectClass", "optUnique",
- "FieldSpec", "ClassField", "optWithSyntax", "WithSyntax", "@3",
- "WithSyntaxList", "WithSyntaxToken", "ExtensionAndException", "Type",
- "NSTD_IndirectMarker", "TypeDeclaration", "TypeDeclarationSet",
- "ComplexTypeReference", "ComplexTypeReferenceAmpList",
- "ComplexTypeReferenceElement", "PrimitiveFieldReference", "FieldName",
- "DefinedObjectClass", "ValueDefinition", "Value", "@4", "DefinedValue",
- "RestrictedCharacterStringValue", "Opaque", "BasicTypeId",
- "BasicTypeId_UniverationCompatible", "BasicType", "BasicString", "Union",
- "Intersection", "Except", "optConstraints", "Constraints",
- "SetOfConstraints", "ElementSetSpecs", "ElementSetSpec",
- "ConstraintSubtypeElement", "@5", "ConstraintRangeSpec",
- "ConstraintSpec", "SingleValue", "ContainedSubtype",
- "InnerTypeConstraint", "WithComponentsList", "WithComponentsElement",
- "optPresenceConstraint", "PresenceConstraint", "TableConstraint",
- "SimpleTableConstraint", "ComponentRelationConstraint", "AtNotationList",
- "AtNotationElement", "ComponentIdList", "optMarker", "Marker",
- "UniverationDefinition", "UniverationList", "UniverationElement",
- "SignedNumber", "optTag", "Tag", "TagTypeValue", "TagClass", "TagPlicit",
- "TypeRefName", "ObjectClassReference", "optIdentifier", "Identifier", 0
+static const short yypact[] = { 25,
+-32768,-32768, 25,-32768, -76,-32768, 18, 97,-32768,-32768,
+-32768,-32768, 34,-32768, -30, 139,-32768,-32768, 62, 82,
+ 73, 100, 128, 102, 195, 139,-32768, 109,-32768,-32768,
+-32768,-32768,-32768, 199,-32768,-32768, 429,-32768, 229, 49,
+-32768,-32768,-32768, 207,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768, 219, 429,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768, 353, 582,-32768, 158,-32768, -6,-32768,
+ 172,-32768,-32768, 67,-32768, -32,-32768, 175,-32768,-32768,
+-32768, -15, 183,-32768, 217,-32768, 223, 240,-32768,-32768,
+-32768,-32768,-32768, 261, 241,-32768,-32768,-32768, 658, 315,
+-32768,-32768,-32768,-32768, 210, 325,-32768,-32768,-32768, 233,
+ 221,-32768,-32768, 25, 233, 222, 224, 48,-32768,-32768,
+-32768,-32768, 148, 233,-32768,-32768,-32768,-32768,-32768, -34,
+-32768, 220, 226, 225, 282, 455,-32768,-32768, -76,-32768,
+-32768, 191,-32768,-32768,-32768, 324, 506, -48,-32768,-32768,
+-32768,-32768,-32768, 332, 658, 328, 233,-32768,-32768,-32768,
+ 230,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 231,
+ 227,-32768,-32768, 75, 37, 45,-32768, 234, 302, 239,
+ 279, 129, 134,-32768, 247,-32768, 248,-32768, 254, 161,
+-32768,-32768, 256, 243,-32768,-32768,-32768,-32768, 359, 218,
+ 359, 328, 455,-32768,-32768, 455,-32768, -5, 22, -5,
+-32768,-32768, 277, 22, -5, 267, 191,-32768, 341, 41,
+ 238, 26, 299, 26, 301, 16, 56,-32768, 161, 276,
+ 345,-32768,-32768, 76,-32768,-32768, 258, 25, 161,-32768,
+ 268, 163, 285, 273, 76,-32768,-32768,-32768, 270,-32768,
+-32768,-32768,-32768, 161,-32768,-32768, 381,-32768, 381,-32768,
+-32768,-32768,-32768, 255,-32768,-32768,-32768, -5,-32768,-32768,
+ 303,-32768,-32768,-32768, 328, 271, 138,-32768,-32768,-32768,
+ 243,-32768, 316, 283, 278,-32768,-32768, -5, 243, 328,
+ 284, 328, 151,-32768,-32768,-32768,-32768,-32768, 165,-32768,
+-32768, 286, 289, 310, 295, 290, 291, 190, 304, 296,
+ 317, 308,-32768,-32768,-32768,-32768,-32768, 305, 310, 310,
+-32768, 310, 161, 294, 293, 318,-32768,-32768,-32768,-32768,
+ 319,-32768, 274,-32768, 41,-32768, 243,-32768, 17,-32768,
+ -5, 243,-32768,-32768, 243,-32768, 16,-32768, 74, 274,
+-32768,-32768,-32768,-32768, 309,-32768,-32768, 256, 15,-32768,
+-32768, 320,-32768,-32768,-32768, 326,-32768,-32768, 7, 173,
+-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768, 327, 329, 359,-32768,-32768, 182,
+-32768, -48, 161,-32768, 328, 312,-32768,-32768, 293, 38,
+-32768,-32768,-32768,-32768, 381,-32768, 15, 160, 208, 312,
+ 328,-32768,-32768,-32768, 38, 30,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 5,-32768,-32768,-32768, 430,
+ 435,-32768
};
-#endif
-# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
-static const unsigned short int yytoknum[] =
-{
- 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
- 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
- 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
- 355, 94, 356, 124, 357, 358, 359, 123, 125, 40,
- 41, 59, 44, 58, 91, 93, 33, 46, 60, 64
-};
-# endif
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
-{
- 0, 120, 121, 122, 122, 123, 124, 124, 125, 125,
- 126, 126, 127, 127, 127, 128, 128, 129, 129, 130,
- 130, 130, 130, 130, 131, 131, 132, 132, 133, 133,
- 133, 133, 133, 134, 133, 133, 135, 135, 136, 136,
- 137, 137, 138, 139, 139, 140, 140, 140, 141, 141,
- 141, 142, 142, 143, 143, 143, 145, 144, 146, 146,
- 147, 147, 147, 148, 148, 149, 149, 149, 149, 150,
- 150, 151, 151, 152, 152, 153, 153, 154, 154, 154,
- 154, 155, 155, 156, 156, 156, 157, 158, 158, 159,
- 159, 160, 160, 160, 160, 160, 160, 160, 161, 161,
- 163, 162, 164, 164, 165, 165, 165, 165, 166, 166,
- 166, 167, 168, 169, 170, 170, 170, 170, 170, 170,
- 170, 170, 170, 170, 170, 171, 171, 171, 171, 171,
- 171, 172, 172, 173, 174, 174, 175, 175, 175, 176,
- 177, 178, 179, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 180, 180, 181, 181, 181, 182, 182, 183,
- 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
- 183, 183, 184, 184, 184, 185, 185, 186, 186, 186,
- 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
- 186, 187, 187, 188, 188, 189, 190, 190, 191, 191,
- 192, 192, 193, 193, 193, 194, 194, 194, 194, 194,
- 195, 195, 195, 195, 195, 195, 195, 195, 195, 195,
- 196, 195, 197, 197, 197, 197, 198, 198, 199, 199,
- 199, 199, 199, 200, 201, 201, 202, 202, 203, 203,
- 204, 204, 205, 205, 205, 206, 206, 207, 208, 209,
- 209, 210, 210, 211, 211, 212, 212, 213, 213, 214,
- 214, 215, 215, 216, 216, 216, 216, 216, 217, 217,
- 218, 218, 219, 220, 221, 221, 221, 221, 222, 222,
- 222, 223, 223, 224, 225, 225, 226
+static const short yypgoto[] = {-32768,
+-32768, 438,-32768, 306,-32768, 433,-32768,-32768, 426,-32768,
+-32768, 397,-32768,-32768,-32768,-32768, 380,-32768, 340,-32768,
+-32768, 347,-32768,-32768, 393,-32768,-32768, 321,-32768, 115,
+ 244,-32768, 110,-32768, 132,-32768,-32768,-32768, 246,-32768,
+-32768,-32768, 54, -329, -223, -71,-32768, -78,-32768, -137,
+-32768, 264, -106, 300, 311,-32768, -115,-32768, -215, -124,
+ -206, -37, 333,-32768, 40,-32768,-32768,-32768, -190,-32768,
+ 167, -72, 81, -74,-32768, 235,-32768, -232,-32768,-32768,
+-32768, 71,-32768,-32768,-32768,-32768,-32768,-32768, 80, 86,
+ -205,-32768,-32768,-32768, 135, -128, -186,-32768,-32768,-32768,
+-32768, 1,-32768, 193, -7
};
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
-{
- 0, 2, 1, 1, 2, 8, 0, 1, 3, 2,
- 1, 2, 1, 4, 1, 0, 1, 1, 2, 2,
- 2, 2, 2, 2, 0, 1, 1, 2, 1, 1,
- 1, 1, 1, 0, 3, 1, 3, 2, 1, 2,
- 0, 1, 4, 1, 3, 1, 3, 1, 3, 3,
- 2, 1, 3, 1, 3, 1, 0, 6, 1, 1,
- 3, 3, 6, 1, 3, 1, 3, 3, 3, 1,
- 3, 1, 1, 0, 1, 1, 3, 3, 2, 3,
- 1, 1, 3, 2, 1, 1, 5, 0, 1, 1,
- 3, 2, 4, 3, 3, 3, 3, 3, 0, 1,
- 0, 6, 1, 2, 1, 1, 1, 3, 1, 3,
- 3, 3, 0, 2, 1, 4, 4, 4, 6, 6,
- 1, 4, 4, 1, 3, 1, 3, 3, 3, 1,
- 3, 1, 3, 1, 1, 1, 1, 3, 3, 1,
- 4, 3, 0, 3, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 3, 1, 1, 1, 1, 2, 1,
- 1, 1, 1, 2, 2, 1, 1, 2, 2, 1,
- 1, 1, 1, 1, 2, 1, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 0, 1, 1, 4,
- 3, 4, 1, 3, 5, 1, 3, 3, 3, 3,
- 4, 3, 1, 1, 3, 3, 3, 3, 1, 1,
- 0, 5, 1, 2, 2, 3, 1, 1, 1, 1,
- 1, 1, 1, 1, 3, 5, 1, 3, 1, 3,
- 0, 1, 1, 1, 1, 1, 1, 3, 4, 1,
- 3, 2, 3, 1, 3, 0, 1, 1, 2, 2,
- 3, 1, 3, 1, 4, 4, 1, 1, 1, 1,
- 0, 1, 2, 4, 0, 1, 1, 1, 0, 1,
- 1, 1, 1, 1, 0, 1, 1
-};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
-static const unsigned short int yydefact[] =
-{
- 0, 281, 282, 0, 2, 3, 6, 1, 4, 0,
- 0, 7, 286, 14, 9, 0, 10, 12, 15, 8,
- 11, 0, 0, 0, 0, 0, 0, 0, 16, 17,
- 0, 23, 21, 19, 22, 20, 0, 18, 13, 24,
- 177, 0, 0, 178, 179, 180, 0, 181, 182, 190,
- 183, 184, 185, 186, 187, 188, 189, 0, 25, 26,
- 28, 29, 32, 30, 31, 35, 0, 0, 33, 0,
- 50, 0, 51, 53, 55, 37, 0, 38, 0, 43,
- 45, 47, 5, 27, 270, 125, 283, 0, 159, 0,
- 0, 173, 166, 170, 172, 160, 0, 0, 161, 165,
- 169, 0, 0, 58, 59, 162, 171, 129, 0, 34,
- 49, 48, 0, 0, 36, 39, 0, 0, 0, 0,
- 274, 61, 60, 112, 271, 278, 0, 174, 168, 167,
- 164, 163, 0, 63, 0, 65, 0, 0, 0, 52,
- 54, 40, 44, 46, 0, 276, 277, 275, 0, 0,
- 196, 280, 279, 272, 126, 128, 0, 0, 0, 0,
- 56, 134, 135, 130, 131, 133, 127, 147, 154, 148,
- 268, 155, 156, 269, 145, 144, 146, 142, 140, 151,
- 149, 150, 0, 152, 41, 42, 270, 270, 0, 89,
- 0, 125, 283, 120, 0, 0, 196, 196, 113, 123,
- 175, 162, 114, 0, 0, 0, 111, 197, 198, 270,
- 64, 68, 67, 66, 0, 0, 0, 0, 0, 139,
- 136, 0, 257, 255, 255, 255, 91, 256, 87, 255,
- 255, 98, 0, 273, 0, 270, 0, 270, 0, 270,
- 0, 0, 176, 270, 0, 0, 0, 228, 227, 0,
- 226, 229, 0, 0, 0, 231, 0, 202, 205, 0,
- 212, 213, 219, 218, 245, 246, 230, 233, 232, 0,
- 62, 157, 57, 132, 143, 153, 141, 258, 96, 0,
- 95, 97, 88, 255, 93, 94, 0, 86, 99, 90,
- 0, 108, 0, 81, 84, 85, 270, 124, 0, 0,
- 74, 75, 80, 255, 270, 284, 0, 284, 267, 259,
- 0, 261, 266, 263, 0, 69, 71, 72, 0, 0,
- 0, 222, 0, 0, 0, 0, 0, 0, 200, 193,
- 194, 191, 192, 0, 0, 0, 195, 0, 0, 0,
- 0, 0, 158, 137, 138, 92, 0, 121, 0, 115,
- 270, 83, 270, 116, 270, 78, 255, 270, 285, 117,
- 270, 260, 0, 0, 122, 270, 199, 206, 220, 223,
- 224, 217, 215, 234, 0, 247, 211, 203, 207, 208,
- 209, 0, 216, 214, 0, 0, 249, 201, 100, 109,
- 110, 152, 82, 79, 76, 77, 112, 112, 262, 0,
- 0, 70, 0, 225, 238, 0, 236, 196, 0, 210,
- 0, 251, 253, 248, 0, 0, 118, 119, 265, 264,
- 221, 235, 0, 240, 204, 252, 0, 250, 104, 105,
- 0, 0, 102, 106, 237, 243, 244, 242, 239, 241,
- 254, 0, 101, 103, 107
+#define YYLAST 756
+
+
+static const short yytable[] = { 15,
+ 5, 233, 235, 5, 269, 15, 289, 179, 423, 195,
+ 120, 178, 273, 275, 276, 10, 117, 114, 279, 280,
+ 159, 160, 424, 10, 10, 10, 10, 11, 163, 65,
+ 7, 216, 72, 423, 10, 199, 79, 64, 1, 2,
+ 71, 423, 10, 11, 78, 159, 160, 424, 65, 10,
+ 293, 214, 215, 159, 160, 424, 64, 10, 216, 293,
+ 200, 132, 1, 2, 10, 168, 79, 217, 171, 67,
+ 143, 28, 340, 154, 78, 10, 63, 155, 19, 115,
+ 1, 2, 10, 168, 179, 367, 171, 179, 178, 214,
+ 215, 178, 350, 292, 217, 63, 438, 271, 118, 133,
+ 272, 378, 72, 163, 109, 110, 438, 79, 311, 196,
+ 71, 216, 218, 223, 139, 78, 153, 132, 425, 439,
+ 399, 289, 286, 405, 152, 12, 144, 384, 181, 118,
+ 118, 286, 265, -72, 16, 164, 180, 437, 274, 118,
+ 145, 17, 29, 425, 395, 390, 286, 217, 206, 208,
+ 118, 425, 226, 20, 118, 133, 227, 207, 290, 68,
+ 30, 307, 21, 308, 305, 391, 313, 166, 392, 10,
+ 168, 169, 170, 171, 1, 2, 322, 112, 430, 307,
+ 316, 240, -254, 22, 32, 23, -254, 31, 118, 33,
+ 415, 336, 149, 317, 24, 241, 166, 34, 10, 168,
+ 169, 170, 171, 150, 270, 181, 184, 185, 181, 242,
+ 243, 418, 199, 180, 385, 10, 180, 199, 36, 346,
+ 1, 2, 291, 37, 299, 244, 299, 351, 306, 312,
+ 311, 396, 431, 159, 160, 232, 432, 200, 242, 362,
+ 234, 10, 200, 66, 245, 344, 1, 2, 321, 345,
+ 246, 83, 84, 366, 373, 374, 73, 375, 356, 247,
+ 376, 80, 357, 324, 325, 326, 327, 248, 108, 249,
+ 338, 339, 358, 290, 328, 388, 359, 342, 111, 246,
+ 408, 116, 10, 168, 409, 305, 171, 1, 2, 416,
+ 319, 320, 353, 417, 353, 1, 2, 159, 160, 124,
+ 166, 125, 10, 168, 169, 170, 171, 126, 324, 325,
+ 326, 327, 411, 412, 127, 128, 166, 134, 10, 168,
+ 169, 170, 171, 1, 2, 129, 135, 136, 138, 141,
+ 142, 158, 156, 188, 204, 386, 10, 291, 157, 213,
+ 229, 299, 242, 180, 241, 230, 210, 212, 228, 306,
+ 231, 312, 386, 236, 237, 82, 118, 377, 242, 243,
+ 180, 402, 239, 266, 264, 281, 83, 84, 277, 285,
+ 300, 407, 302, 315, 244, 314, 335, 323, 85, 38,
+ 86, 333, 87, 246, 331, 337, 343, 347, 341, 349,
+ 348, 354, 88, 245, 360, 365, 89, 407, 361, 246,
+ 90, 363, 369, 91, 41, 42, 43, 364, 247, 402,
+ 372, 379, 200, 435, 92, 45, 248, 371, 249, 93,
+ 46, 94, 47, 95, 370, 383, 398, 382, 421, 441,
+ 48, 403, 96, 97, 442, 404, 413, 10, 414, 49,
+ 6, 50, 1, 2, 182, 18, 51, 98, 52, 53,
+ 54, 35, 81, 113, 140, 38, 137, 106, 389, 99,
+ 165, 166, 167, 10, 168, 169, 170, 171, 1, 2,
+ 39, 393, 284, 268, 40, 205, 387, 301, 436, 197,
+ 41, 42, 43, 419, 224, 368, 44, 429, 422, 334,
+ 420, 45, 0, 394, 355, 225, 46, 0, 47, 0,
+ 0, 0, 0, 172, 0, 0, 48, 0, 0, 0,
+ 0, 0, 0, 0, 0, 49, 0, 50, 0, 83,
+ 84, 173, 51, 0, 52, 53, 54, 189, 0, 0,
+ 0, 85, 38, 86, 0, 87, 190, 0, 0, 0,
+ 0, 0, 0, 0, 174, 88, 0, 0, 0, 89,
+ 0, 0, 0, 90, 0, 0, 91, 41, 42, 43,
+ 0, 175, 0, 0, 0, 191, 0, 92, 45, 0,
+ 0, 0, 93, 46, 94, 47, 95, 0, 0, 0,
+ 0, 0, 0, 48, 0, 96, 97, 192, 193, 0,
+ 0, 0, 49, 0, 50, 83, 84, 0, 0, 51,
+ 98, 52, 53, 54, 0, 0, 0, 85, 38, 86,
+ 0, 87, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 88, 0, 0, 0, 89, 0, 0, 0, 90,
+ 0, 0, 91, 41, 42, 43, 0, 0, 0, 0,
+ 0, 0, 0, 92, 45, 0, 0, 0, 93, 46,
+ 94, 47, 95, 0, 0, 0, 0, 0, 0, 48,
+ 0, 96, 97, 0, 0, 0, 0, 0, 49, 0,
+ 50, 1, 2, 0, 0, 51, 98, 52, 53, 54,
+ 0, 0, 0, 85, 38, 86, 0, 87, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 88, 0, 0,
+ 0, 89, 0, 0, 0, 90, 0, 0, 91, 41,
+ 42, 43, 0, 0, 0, 0, 0, 0, 0, 92,
+ 45, 0, 0, 0, 93, 46, 94, 47, 95, 0,
+ 0, 0, 0, 0, 0, 48, 0, 96, 97, 0,
+ 0, 0, 0, 0, 49, 0, 50, 0, 0, 0,
+ 0, 51, 98, 52, 53, 54
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const short int yydefgoto[] =
-{
- -1, 3, 4, 5, 10, 11, 15, 16, 27, 28,
- 29, 57, 58, 59, 109, 60, 76, 185, 77, 78,
- 79, 61, 71, 72, 62, 214, 102, 63, 132, 133,
- 314, 315, 299, 300, 301, 292, 293, 121, 283, 188,
- 189, 287, 288, 415, 431, 432, 302, 303, 149, 150,
- 198, 103, 163, 164, 433, 224, 225, 64, 178, 216,
- 179, 255, 272, 104, 105, 202, 106, 334, 335, 337,
- 206, 207, 208, 256, 257, 258, 402, 323, 259, 260,
- 261, 262, 405, 406, 438, 439, 263, 264, 265, 385,
- 386, 411, 226, 227, 242, 310, 311, 266, 123, 124,
- 125, 148, 153, 267, 107, 357, 268
+static const short yycheck[] = { 7,
+ 0, 192, 193, 3, 211, 13, 230, 136, 4, 147,
+ 82, 136, 218, 219, 220, 9, 32, 50, 224, 225,
+ 16, 17, 18, 9, 9, 9, 9, 10, 135, 37,
+ 107, 37, 40, 4, 9, 84, 44, 37, 14, 15,
+ 40, 4, 9, 10, 44, 16, 17, 18, 56, 9,
+ 34, 15, 16, 16, 17, 18, 56, 9, 37, 34,
+ 109, 99, 14, 15, 9, 10, 74, 73, 13, 21,
+ 23, 10, 278, 108, 74, 9, 37, 112, 109, 112,
+ 14, 15, 9, 10, 213, 318, 13, 216, 213, 15,
+ 16, 216, 298, 231, 73, 56, 426, 213, 114, 99,
+ 216, 334, 110, 210, 111, 112, 436, 115, 237, 147,
+ 110, 37, 184, 185, 114, 115, 124, 155, 114, 115,
+ 106, 345, 106, 117, 124, 108, 79, 343, 136, 114,
+ 114, 106, 204, 108, 38, 135, 136, 108, 117, 114,
+ 93, 108, 61, 114, 360, 351, 106, 73, 156, 157,
+ 114, 114, 108, 15, 114, 155, 112, 157, 230, 111,
+ 88, 106, 24, 108, 236, 352, 239, 7, 355, 9,
+ 10, 11, 12, 13, 14, 15, 249, 111, 19, 106,
+ 105, 21, 108, 45, 57, 47, 112, 88, 114, 88,
+ 397, 264, 45, 118, 56, 35, 7, 3, 9, 10,
+ 11, 12, 13, 56, 212, 213, 16, 17, 216, 49,
+ 50, 402, 84, 213, 343, 9, 216, 84, 110, 291,
+ 14, 15, 230, 25, 232, 65, 234, 299, 236, 237,
+ 359, 360, 73, 16, 17, 107, 77, 109, 49, 314,
+ 107, 9, 109, 15, 84, 108, 14, 15, 248, 112,
+ 90, 14, 15, 64, 329, 330, 50, 332, 108, 99,
+ 333, 43, 112, 101, 102, 103, 104, 107, 111, 109,
+ 16, 17, 108, 345, 112, 347, 112, 285, 107, 90,
+ 108, 107, 9, 10, 112, 357, 13, 14, 15, 108,
+ 33, 34, 300, 112, 302, 14, 15, 16, 17, 117,
+ 7, 85, 9, 10, 11, 12, 13, 85, 101, 102,
+ 103, 104, 391, 392, 75, 55, 7, 3, 9, 10,
+ 11, 12, 13, 14, 15, 85, 117, 3, 108, 108,
+ 107, 107, 113, 10, 3, 343, 9, 345, 113, 113,
+ 39, 349, 49, 343, 35, 107, 117, 117, 115, 357,
+ 72, 359, 360, 107, 107, 3, 114, 64, 49, 50,
+ 360, 369, 109, 5, 109, 99, 14, 15, 92, 29,
+ 72, 379, 72, 29, 65, 100, 107, 110, 26, 27,
+ 28, 109, 30, 90, 100, 5, 116, 72, 86, 112,
+ 108, 108, 40, 84, 109, 105, 44, 405, 110, 90,
+ 48, 107, 107, 51, 52, 53, 54, 118, 99, 417,
+ 106, 119, 109, 421, 62, 63, 107, 110, 109, 67,
+ 68, 69, 70, 71, 108, 107, 118, 110, 117, 0,
+ 78, 112, 80, 81, 0, 110, 110, 9, 110, 87,
+ 3, 89, 14, 15, 139, 13, 94, 95, 96, 97,
+ 98, 26, 56, 74, 115, 27, 110, 65, 349, 107,
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 42, 357, 227, 210, 46, 155, 345, 234, 425, 147,
+ 52, 53, 54, 403, 185, 319, 58, 417, 409, 255,
+ 405, 63, -1, 359, 302, 185, 68, -1, 70, -1,
+ -1, -1, -1, 49, -1, -1, 78, -1, -1, -1,
+ -1, -1, -1, -1, -1, 87, -1, 89, -1, 14,
+ 15, 67, 94, -1, 96, 97, 98, 22, -1, -1,
+ -1, 26, 27, 28, -1, 30, 31, -1, -1, -1,
+ -1, -1, -1, -1, 90, 40, -1, -1, -1, 44,
+ -1, -1, -1, 48, -1, -1, 51, 52, 53, 54,
+ -1, 107, -1, -1, -1, 60, -1, 62, 63, -1,
+ -1, -1, 67, 68, 69, 70, 71, -1, -1, -1,
+ -1, -1, -1, 78, -1, 80, 81, 82, 83, -1,
+ -1, -1, 87, -1, 89, 14, 15, -1, -1, 94,
+ 95, 96, 97, 98, -1, -1, -1, 26, 27, 28,
+ -1, 30, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 40, -1, -1, -1, 44, -1, -1, -1, 48,
+ -1, -1, 51, 52, 53, 54, -1, -1, -1, -1,
+ -1, -1, -1, 62, 63, -1, -1, -1, 67, 68,
+ 69, 70, 71, -1, -1, -1, -1, -1, -1, 78,
+ -1, 80, 81, -1, -1, -1, -1, -1, 87, -1,
+ 89, 14, 15, -1, -1, 94, 95, 96, 97, 98,
+ -1, -1, -1, 26, 27, 28, -1, 30, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 40, -1, -1,
+ -1, 44, -1, -1, -1, 48, -1, -1, 51, 52,
+ 53, 54, -1, -1, -1, -1, -1, -1, -1, 62,
+ 63, -1, -1, -1, 67, 68, 69, 70, 71, -1,
+ -1, -1, -1, -1, -1, 78, -1, 80, 81, -1,
+ -1, -1, -1, -1, 87, -1, 89, -1, -1, -1,
+ -1, 94, 95, 96, 97, 98
};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/share/bison.simple"
+/* This file comes from bison-1.28. */
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -267
-static const short int yypact[] =
-{
- 203, -267, -267, 16, 203, -267, -54, -267, -267, 15,
- -2, -267, -267, -267, -267, 35, -267, -39, 199, -267,
- -267, 79, 45, 24, 69, 47, 110, 221, 199, -267,
- 66, -267, -267, -267, -267, -267, 215, -267, -267, 430,
- -267, 230, 43, -267, -267, -267, 201, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, 209, 430, -267,
- -267, -267, -267, -267, -267, -267, 239, 583, -267, 149,
- -267, 173, -267, 155, -267, -267, 51, -267, -19, -267,
- 157, -267, -267, -267, -12, 153, -267, 183, -267, 187,
- 205, -267, -267, -267, -267, -267, 219, 226, -267, -267,
- -267, 659, 311, -267, -267, -267, -267, 208, 313, -267,
- -267, -267, 262, 210, -267, -267, 203, 262, 232, 220,
- 58, -267, -267, -267, -267, 114, 262, -267, -267, -267,
- -267, -267, -24, -267, 225, 231, 244, 307, 171, -267,
- -267, -54, -267, -267, 278, -267, -267, -267, 354, 507,
- -36, -267, -267, -267, -267, -267, 375, 659, 379, 262,
- -267, -267, -267, 272, -267, -267, -267, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, -267, -267, -267,
- -267, -267, 273, 279, -267, -267, 61, 53, 48, -267,
- 276, 57, 286, 356, 289, 327, 88, 122, -267, -267,
- -267, 291, -267, 293, 294, 359, -267, -267, 295, 288,
- -267, -267, -267, -267, 400, 326, 400, 379, 171, -267,
- -267, 171, -267, 10, 74, 10, -267, -267, 314, 74,
- 10, 312, 278, -267, 381, 13, 333, 25, 342, 25,
- 343, 86, -267, 8, 359, 318, 387, -267, -267, -18,
- -267, -267, 316, 203, 359, -267, 309, 146, 320, 317,
- -18, -267, -267, -267, 321, -267, -267, -267, -267, 359,
- -267, -267, 418, -267, 418, -267, -267, -267, -267, 346,
- -267, -267, -267, 10, -267, -267, 339, -267, -267, -267,
- 379, 315, 81, -267, -267, -267, 288, -267, 355, 322,
- 323, -267, -267, 10, 288, 379, 324, 379, -267, -267,
- 99, -267, -267, 325, 125, -267, -267, -267, 319, 372,
- 329, 328, 335, 192, 332, 340, 334, 338, -267, -267,
- -267, -267, -267, 344, 372, 372, -267, 372, 359, 348,
- 336, 341, -267, -267, -267, -267, 345, -267, 290, -267,
- 13, -267, 288, -267, 1, -267, 10, 288, -267, -267,
- 288, -267, 65, 290, -267, 8, -267, -267, -267, -267,
- 347, -267, -267, 295, 12, -267, -267, 349, -267, -267,
- -267, 350, -267, -267, -4, 131, -267, -267, -267, -267,
- -267, -267, -267, -267, -267, -267, -267, -267, -267, 353,
- 357, -267, 400, -267, -267, 151, -267, -36, 359, -267,
- 379, 337, -267, -267, 336, 22, -267, -267, -267, -267,
- 418, -267, 12, 71, 228, 337, 379, -267, -267, -267,
- 22, 38, -267, -267, -267, -267, -267, -267, -267, -267,
- -267, 11, -267, -267, -267
-};
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-/* YYPGOTO[NTERM-NUM]. */
-static const short int yypgoto[] =
-{
- -267, -267, -267, 429, -267, 351, -267, 438, -267, -267,
- 431, -267, -267, 406, -267, -267, -267, -267, 393, -267,
- 358, -267, -267, 361, -267, -267, 403, -267, -267, 330,
- -267, 109, 238, -267, 124, -267, 130, -267, -267, -267,
- 253, -267, -267, -267, 56, -241, -226, -77, -267, -20,
- -267, -108, -267, 274, -114, 303, 304, -267, -83, -267,
- -266, -53, -215, 39, 352, -267, -7, -267, -267, -267,
- -194, -267, 170, -183, 87, -22, -267, 236, -267, -260,
- -267, -267, -267, 75, -267, -267, -267, -267, -267, -267,
- 85, 92, -211, -267, -267, -267, 141, -127, -71, -267,
- -267, -267, -267, 4, -267, 197, -9
-};
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -283
-static const short int yytable[] =
-{
- 17, 274, 238, 240, 6, 12, 17, 122, 6, 294,
- 12, 181, 278, 280, 281, 428, 7, 12, 284, 285,
- 119, 12, 12, 165, 12, 13, 428, 161, 162, 429,
- 67, 116, 65, 74, 12, 298, 18, 81, 161, 162,
- 429, 199, 428, 66, 12, 13, 73, 221, 204, 67,
- 80, 65, 12, 9, 161, 162, 429, 1, 2, 298,
- 12, 318, 66, 372, 69, 1, 2, 81, 219, 220,
- 21, 327, 345, 205, 12, 170, 219, 220, 173, 383,
- 80, 145, 389, 222, 156, 180, 341, 321, 157, 30,
- 435, 181, 355, 117, 181, 12, 170, 399, 221, 173,
- 322, 165, 120, 74, 34, 135, 31, 291, 81, 223,
- 228, 221, 32, 410, 312, 120, 73, 155, 404, 291,
- 141, 80, 120, 14, 294, 430, 444, 120, 297, 183,
- 154, 291, 270, -73, 222, 276, 430, 146, 277, 120,
- 134, 166, 182, 19, 436, 395, 442, 222, 437, 211,
- 213, 147, 430, 203, 70, 381, 231, 33, 295, 151,
- 232, 135, 114, 212, -281, 180, 316, 120, 180, -255,
- 152, 308, 204, -255, 126, 120, 38, 167, 168, 169,
- 12, 170, 171, 172, 173, 1, 2, 420, 200, 349,
- 443, 279, 308, 350, 309, 237, 134, 205, 35, 168,
- 443, 12, 170, 171, 172, 173, 204, 361, 275, 183,
- 12, 362, 183, 423, 22, 1, 2, 1, 2, 351,
- 174, 390, 182, 23, 36, 182, 296, 356, 304, 239,
- 304, 205, 313, 364, 317, 312, 400, 365, 175, 413,
- 39, 247, 84, 414, 24, 68, 25, 329, 330, 331,
- 332, 75, 82, 85, 86, 26, 371, 326, 333, 421,
- 110, 176, 113, 422, 118, 87, 40, 88, 127, 89,
- 126, 12, 128, 295, 130, 393, 1, 2, 177, 90,
- 129, 347, 251, 91, 111, 112, 396, 92, 316, 397,
- 93, 43, 44, 45, 186, 187, 358, 367, 358, 12,
- 170, 94, 47, 173, 1, 2, 95, 48, 96, 49,
- 97, 131, 378, 379, 136, 380, 138, 50, 140, 98,
- 99, 1, 2, 161, 162, 137, 51, 144, 52, 329,
- 330, 331, 332, 53, 100, 54, 55, 56, 158, 391,
- 143, 296, 161, 162, 159, 304, 101, 85, 86, 324,
- 325, 160, 182, 313, 391, 168, 317, 12, 170, 171,
- 172, 173, 343, 344, 190, 407, 168, 182, 12, 170,
- 171, 172, 173, 1, 2, 412, 416, 417, 209, 168,
- 245, 12, 170, 171, 172, 173, 1, 2, 12, 215,
- 217, 233, 218, -282, 246, 234, 235, 247, 241, 236,
- 243, 412, 120, 244, 269, 271, 282, 246, 247, 248,
- 290, 286, 382, 407, 305, 307, 320, 440, 319, 328,
- 336, 247, 248, 342, 249, 346, 338, 352, 340, 366,
- 353, 348, 359, 8, 363, 354, 368, 249, 251, 12,
- 370, 205, 375, 250, 1, 2, 369, 374, 376, 251,
- 377, 387, 388, 20, 426, 384, 250, 40, 252, 37,
- 409, 408, 251, 418, 83, 403, 253, 419, 254, 115,
- 108, 252, 41, 139, 401, 142, 42, 306, 394, 253,
- 392, 254, 43, 44, 45, 289, 441, 210, 46, 273,
- 229, 230, 184, 47, 373, 424, 339, 434, 48, 427,
- 49, 201, 425, 398, 360, 0, 0, 0, 50, 0,
- 0, 0, 0, 0, 0, 0, 0, 51, 0, 52,
- 0, 191, 192, 0, 53, 0, 54, 55, 56, 193,
- 0, 0, 0, 87, 40, 88, 0, 89, 194, 0,
- 0, 0, 0, 0, 0, 0, 0, 90, 0, 0,
- 0, 91, 0, 0, 0, 92, 0, 0, 93, 43,
- 44, 45, 0, 0, 0, 0, 0, 195, 0, 94,
- 47, 0, 0, 0, 95, 48, 96, 49, 97, 0,
- 0, 0, 0, 0, 0, 50, 0, 98, 99, 196,
- 197, 0, 0, 0, 51, 0, 52, 85, 86, 0,
- 0, 53, 100, 54, 55, 56, 0, 0, 0, 87,
- 40, 88, 0, 89, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 90, 0, 0, 0, 91, 0, 0,
- 0, 92, 0, 0, 93, 43, 44, 45, 0, 0,
- 0, 0, 0, 0, 0, 94, 47, 0, 0, 0,
- 95, 48, 96, 49, 97, 0, 0, 0, 0, 0,
- 0, 50, 0, 98, 99, 0, 0, 0, 0, 0,
- 51, 0, 52, 1, 2, 0, 0, 53, 100, 54,
- 55, 56, 0, 0, 0, 87, 40, 88, 0, 89,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 90,
- 0, 0, 0, 91, 0, 0, 0, 92, 0, 0,
- 93, 43, 44, 45, 0, 0, 0, 0, 0, 0,
- 0, 94, 47, 0, 0, 0, 95, 48, 96, 49,
- 97, 0, 0, 0, 0, 0, 0, 50, 0, 98,
- 99, 0, 0, 0, 0, 0, 51, 0, 52, 0,
- 0, 0, 0, 53, 100, 54, 55, 56
-};
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-static const short int yycheck[] =
-{
- 9, 216, 196, 197, 0, 9, 15, 84, 4, 235,
- 9, 138, 223, 224, 225, 4, 0, 9, 229, 230,
- 32, 9, 9, 137, 9, 10, 4, 16, 17, 18,
- 39, 50, 39, 42, 9, 34, 38, 46, 16, 17,
- 18, 149, 4, 39, 9, 10, 42, 37, 84, 58,
- 46, 58, 9, 107, 16, 17, 18, 14, 15, 34,
- 9, 244, 58, 323, 21, 14, 15, 76, 15, 16,
- 109, 254, 283, 109, 9, 10, 15, 16, 13, 339,
- 76, 23, 348, 73, 108, 138, 269, 105, 112, 10,
- 19, 218, 303, 112, 221, 9, 10, 363, 37, 13,
- 118, 215, 114, 112, 57, 101, 61, 106, 117, 186,
- 187, 37, 88, 117, 241, 114, 112, 126, 106, 106,
- 116, 117, 114, 108, 350, 114, 115, 114, 236, 138,
- 126, 106, 209, 108, 73, 218, 114, 79, 221, 114,
- 101, 137, 138, 108, 73, 356, 108, 73, 77, 158,
- 159, 93, 114, 149, 111, 338, 108, 88, 235, 45,
- 112, 157, 111, 159, 107, 218, 243, 114, 221, 108,
- 56, 106, 84, 112, 117, 114, 110, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 402, 149, 108,
- 431, 117, 106, 112, 108, 107, 157, 109, 88, 7,
- 441, 9, 10, 11, 12, 13, 84, 108, 217, 218,
- 9, 112, 221, 407, 15, 14, 15, 14, 15, 296,
- 49, 348, 218, 24, 3, 221, 235, 304, 237, 107,
- 239, 109, 241, 108, 243, 362, 363, 112, 67, 108,
- 25, 49, 3, 112, 45, 15, 47, 101, 102, 103,
- 104, 50, 43, 14, 15, 56, 64, 253, 112, 108,
- 111, 90, 107, 112, 107, 26, 27, 28, 85, 30,
- 117, 9, 85, 350, 55, 352, 14, 15, 107, 40,
- 75, 290, 90, 44, 111, 112, 357, 48, 365, 360,
- 51, 52, 53, 54, 16, 17, 305, 319, 307, 9,
- 10, 62, 63, 13, 14, 15, 67, 68, 69, 70,
- 71, 85, 334, 335, 3, 337, 3, 78, 108, 80,
- 81, 14, 15, 16, 17, 117, 87, 107, 89, 101,
- 102, 103, 104, 94, 95, 96, 97, 98, 113, 348,
- 108, 350, 16, 17, 113, 354, 107, 14, 15, 33,
- 34, 107, 348, 362, 363, 7, 365, 9, 10, 11,
- 12, 13, 16, 17, 10, 374, 7, 363, 9, 10,
- 11, 12, 13, 14, 15, 384, 396, 397, 3, 7,
- 21, 9, 10, 11, 12, 13, 14, 15, 9, 117,
- 117, 115, 113, 107, 35, 39, 107, 49, 107, 72,
- 107, 410, 114, 109, 109, 5, 92, 35, 49, 50,
- 29, 99, 64, 422, 72, 72, 29, 426, 100, 110,
- 100, 49, 50, 5, 65, 86, 109, 72, 107, 110,
- 108, 116, 108, 4, 109, 112, 107, 65, 90, 9,
- 105, 109, 108, 84, 14, 15, 118, 107, 110, 90,
- 106, 110, 107, 15, 117, 119, 84, 27, 99, 28,
- 110, 112, 90, 110, 58, 118, 107, 110, 109, 76,
- 67, 99, 42, 112, 365, 117, 46, 239, 354, 107,
- 350, 109, 52, 53, 54, 232, 430, 157, 58, 215,
- 187, 187, 141, 63, 324, 408, 260, 422, 68, 414,
- 70, 149, 410, 362, 307, -1, -1, -1, 78, -1,
- -1, -1, -1, -1, -1, -1, -1, 87, -1, 89,
- -1, 14, 15, -1, 94, -1, 96, 97, 98, 22,
- -1, -1, -1, 26, 27, 28, -1, 30, 31, -1,
- -1, -1, -1, -1, -1, -1, -1, 40, -1, -1,
- -1, 44, -1, -1, -1, 48, -1, -1, 51, 52,
- 53, 54, -1, -1, -1, -1, -1, 60, -1, 62,
- 63, -1, -1, -1, 67, 68, 69, 70, 71, -1,
- -1, -1, -1, -1, -1, 78, -1, 80, 81, 82,
- 83, -1, -1, -1, 87, -1, 89, 14, 15, -1,
- -1, 94, 95, 96, 97, 98, -1, -1, -1, 26,
- 27, 28, -1, 30, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 40, -1, -1, -1, 44, -1, -1,
- -1, 48, -1, -1, 51, 52, 53, 54, -1, -1,
- -1, -1, -1, -1, -1, 62, 63, -1, -1, -1,
- 67, 68, 69, 70, 71, -1, -1, -1, -1, -1,
- -1, 78, -1, 80, 81, -1, -1, -1, -1, -1,
- 87, -1, 89, 14, 15, -1, -1, 94, 95, 96,
- 97, 98, -1, -1, -1, 26, 27, 28, -1, 30,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 40,
- -1, -1, -1, 44, -1, -1, -1, 48, -1, -1,
- 51, 52, 53, 54, -1, -1, -1, -1, -1, -1,
- -1, 62, 63, -1, -1, -1, 67, 68, 69, 70,
- 71, -1, -1, -1, -1, -1, -1, 78, -1, 80,
- 81, -1, -1, -1, -1, -1, 87, -1, 89, -1,
- -1, -1, -1, 94, 95, 96, 97, 98
-};
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
-{
- 0, 14, 15, 121, 122, 123, 223, 0, 123, 107,
- 124, 125, 9, 10, 108, 126, 127, 226, 38, 108,
- 127, 109, 15, 24, 45, 47, 56, 128, 129, 130,
- 10, 61, 88, 88, 57, 88, 3, 130, 110, 25,
- 27, 42, 46, 52, 53, 54, 58, 63, 68, 70,
- 78, 87, 89, 94, 96, 97, 98, 131, 132, 133,
- 135, 141, 144, 147, 177, 186, 223, 226, 15, 21,
- 111, 142, 143, 223, 226, 50, 136, 138, 139, 140,
- 223, 226, 43, 133, 3, 14, 15, 26, 28, 30,
- 40, 44, 48, 51, 62, 67, 69, 71, 80, 81,
- 95, 107, 146, 171, 183, 184, 186, 224, 146, 134,
- 111, 111, 112, 107, 111, 138, 50, 112, 107, 32,
- 114, 157, 167, 218, 219, 220, 117, 85, 85, 75,
- 55, 85, 148, 149, 183, 223, 3, 117, 3, 143,
- 108, 223, 140, 108, 107, 23, 79, 93, 221, 168,
- 169, 45, 56, 222, 223, 226, 108, 112, 113, 113,
- 107, 16, 17, 172, 173, 174, 223, 6, 7, 8,
- 10, 11, 12, 13, 49, 67, 90, 107, 178, 180,
- 181, 217, 223, 226, 125, 137, 16, 17, 159, 160,
- 10, 14, 15, 22, 31, 60, 82, 83, 170, 171,
- 183, 184, 185, 223, 84, 109, 190, 191, 192, 3,
- 149, 226, 223, 226, 145, 117, 179, 117, 113, 15,
- 16, 37, 73, 167, 175, 176, 212, 213, 167, 175,
- 176, 108, 112, 115, 39, 107, 72, 107, 190, 107,
- 190, 107, 214, 107, 109, 21, 35, 49, 50, 65,
- 84, 90, 99, 107, 109, 181, 193, 194, 195, 198,
- 199, 200, 201, 206, 207, 208, 217, 223, 226, 109,
- 167, 5, 182, 173, 182, 226, 178, 178, 212, 117,
- 212, 212, 92, 158, 212, 212, 99, 161, 162, 160,
- 29, 106, 155, 156, 166, 167, 226, 171, 34, 152,
- 153, 154, 166, 167, 226, 72, 152, 72, 106, 108,
- 215, 216, 217, 226, 150, 151, 167, 226, 193, 100,
- 29, 105, 118, 197, 33, 34, 223, 193, 110, 101,
- 102, 103, 104, 112, 187, 188, 100, 189, 109, 197,
- 107, 193, 5, 16, 17, 212, 86, 226, 116, 108,
- 112, 167, 72, 108, 112, 212, 167, 225, 226, 108,
- 225, 108, 112, 109, 108, 112, 110, 195, 107, 118,
- 105, 64, 199, 192, 107, 108, 110, 106, 195, 195,
- 195, 193, 64, 199, 119, 209, 210, 110, 107, 180,
- 217, 226, 156, 167, 154, 212, 218, 218, 216, 180,
- 217, 151, 196, 118, 106, 202, 203, 226, 112, 110,
- 117, 211, 226, 108, 112, 163, 169, 169, 110, 110,
- 182, 108, 112, 190, 194, 211, 117, 210, 4, 18,
- 114, 164, 165, 174, 203, 19, 73, 77, 204, 205,
- 226, 164, 108, 165, 115
-};
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
+#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
+#include <alloca.h>
+#else /* not sparc */
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
+#include <malloc.h>
+#endif
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
+ #pragma alloca
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
+#endif /* __hpux */
+#endif
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
+
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
+#define YYEMPTY -2
#define YYEOF 0
-
#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
-
#define YYFAIL goto yyerrlab
-
#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value) \
+#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
- { \
- yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
-
#define YYTERROR 1
#define YYERRCODE 256
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (N) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (0)
+#ifndef YYPURE
+#define YYLEX yylex()
#endif
-
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
+#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
#else
-# define YYLEX yylex ()
+#define YYLEX yylex(&yylval, &yylloc)
#endif
-
-/* Enable debugging if requested. */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-# define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (0)
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included). |
-`------------------------------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_stack_print (short int *bottom, short int *top)
+#else /* not YYLSP_NEEDED */
+#ifdef YYLEX_PARAM
+#define YYLEX yylex(&yylval, YYLEX_PARAM)
#else
-static void
-yy_stack_print (bottom, top)
- short int *bottom;
- short int *top;
+#define YYLEX yylex(&yylval)
+#endif
+#endif /* not YYLSP_NEEDED */
#endif
-{
- YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
- YYFPRINTF (stderr, "\n");
-}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (0)
+/* If nonreentrant, generate the variables here */
+#ifndef YYPURE
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced. |
-`------------------------------------------------*/
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yy_reduce_print (int yyrule)
-#else
-static void
-yy_reduce_print (yyrule)
- int yyrule;
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
#endif
-{
- int yyi;
- unsigned long int yylno = yyrline[yyrule];
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
- yyrule - 1, yylno);
- /* Print the symbols being reduced, and their result. */
- for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
- YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
- YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
-}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
-/* Nonzero means print parse trace. It is left uninitialized so that
- multiple parsers can coexist. */
-int yydebug;
-#else /* !YYDEBUG */
-# define YYDPRINTF(Args)
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-# define YY_STACK_PRINT(Bottom, Top)
-# define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
-/* YYINITDEPTH -- initial size of the parser's stacks. */
#ifndef YYINITDEPTH
-# define YYINITDEPTH 200
+#define YYINITDEPTH 200
#endif
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
- if the built-in stack extension method is used).
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
- Do not make this value too large; the results are undefined if
- YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
- evaluated with infinite-precision integer arithmetic. */
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
#ifndef YYMAXDEPTH
-# define YYMAXDEPTH 10000
+#define YYMAXDEPTH 10000
#endif
-
-
-#if YYERROR_VERBOSE
-
-# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
-# define yystrlen strlen
-# else
-/* Return the length of YYSTR. */
-static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
-yystrlen (const char *yystr)
-# else
-yystrlen (yystr)
- const char *yystr;
-# endif
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_memcpy (to, from, count)
+ char *to;
+ char *from;
+ unsigned int count;
{
- const char *yys = yystr;
-
- while (*yys++ != '\0')
- continue;
-
- return yys - yystr - 1;
-}
-# endif
-# endif
-
-# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
-# define yystpcpy stpcpy
-# else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
- YYDEST. */
-static char *
-# if defined (__STDC__) || defined (__cplusplus)
-yystpcpy (char *yydest, const char *yysrc)
-# else
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
-{
- char *yyd = yydest;
- const char *yys = yysrc;
-
- while ((*yyd++ = *yys++) != '\0')
- continue;
-
- return yyd - 1;
-}
-# endif
-# endif
-
-# ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
- quotes and backslashes, so that it's suitable for yyerror. The
- heuristic is that double-quoting is unnecessary unless the string
- contains an apostrophe, a comma, or backslash (other than
- backslash-backslash). YYSTR is taken from yytname. If YYRES is
- null, do not copy; instead, return the length of what the result
- would have been. */
-static YYSIZE_T
-yytnamerr (char *yyres, const char *yystr)
-{
- if (*yystr == '"')
- {
- size_t yyn = 0;
- char const *yyp = yystr;
-
- for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
- do_not_strip_quotes: ;
- }
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
- if (! yyres)
- return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
+ while (i-- > 0)
+ *t++ = *f++;
}
-# endif
-#endif /* YYERROR_VERBOSE */
+#else /* __cplusplus */
-
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
static void
-yysymprint (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
-
+ register char *t = to;
+ register char *f = from;
+ register int i = count;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- switch (yytype)
- {
- default:
- break;
- }
- YYFPRINTF (yyoutput, ")");
+ while (i-- > 0)
+ *t++ = *f++;
}
-#endif /* ! YYDEBUG */
-/*-----------------------------------------------.
-| Release the memory associated to this symbol. |
-`-----------------------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
#endif
-{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
-
- if (!yymsg)
- yymsg = "Deleting";
- YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
-
- switch (yytype)
- {
-
- default:
- break;
- }
-}
+#endif
+#line 217 "/usr/share/bison.simple"
-/* Prevent warnings from -Wmissing-prototypes. */
+/* The user can define YYPARSE_PARAM as the name of an argument to be passed
+ into yyparse. The argument should have type void *.
+ It should actually point to an object.
+ Grammar actions can access the variable by casting it
+ to the proper pointer type. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM);
-# else
-int yyparse ();
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-
-
-
-/* The look-ahead symbol. */
-int yychar;
-
-/* The semantic value of the look-ahead symbol. */
-YYSTYPE yylval;
-
-/* Number of syntax errors so far. */
-int yynerrs;
-
-
-
-/*----------.
-| yyparse. |
-`----------*/
-
+#ifdef __cplusplus
+#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL
+#else /* not __cplusplus */
+#define YYPARSE_PARAM_ARG YYPARSE_PARAM
+#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
+#endif /* not __cplusplus */
+#else /* not YYPARSE_PARAM */
+#define YYPARSE_PARAM_ARG
+#define YYPARSE_PARAM_DECL
+#endif /* not YYPARSE_PARAM */
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
-#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
-int
-yyparse (void)
+int yyparse (void *);
#else
-int
-yyparse ()
- ;
+int yyparse (void);
#endif
#endif
-{
-
- int yystate;
- int yyn;
- int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
- int yytoken = 0;
-
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- short int yyssa[YYINITDEPTH];
- short int *yyss = yyssa;
- short int *yyssp;
+int
+yyparse(YYPARSE_PARAM_ARG)
+ YYPARSE_PARAM_DECL
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1 = 0; /* lookahead token as an internal (translated) token number */
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
- YYSIZE_T yystacksize = YYINITDEPTH;
+ int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
int yylen;
- YYDPRINTF ((stderr, "Starting parse\n"));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
yystate = 0;
yyerrstatus = 0;
@@ -1760,404 +1124,429 @@ yyparse ()
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
- yyssp = yyss;
+ yyssp = yyss - 1;
yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
- goto yysetstate;
-
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
- /* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
- yyssp++;
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
- yysetstate:
- *yyssp = yystate;
+ *++yyssp = yystate;
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
{
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ int size = yyssp - yyss + 1;
#ifdef yyoverflow
- {
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- short int *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
-
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
- }
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+#ifdef YYLSP_NEEDED
+ /* This used to be a conditional around just the two extra args,
+ but that might be undefined if yyoverflow is a macro. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yyls1, size * sizeof (*yylsp),
+ &yystacksize);
+#else
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+ &yystacksize);
+#endif
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
/* Extend the stack our own way. */
- if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 2;
+ }
yystacksize *= 2;
- if (YYMAXDEPTH < yystacksize)
+ if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
-
- {
- short int *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
-# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
- }
-# endif
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
+#endif
#endif /* no yyoverflow */
- yyssp = yyss + yysize - 1;
- yyvsp = yyvs + yysize - 1;
-
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
- if (yyss + yystacksize - 1 <= yyssp)
+ if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
goto yybackup;
-
-/*-----------.
-| yybackup. |
-`-----------*/
-yybackup:
+ yybackup:
/* Do appropriate processing given the current state. */
-/* Read a look-ahead token if we need one and don't already have one. */
+/* Read a lookahead token if we need one and don't already have one. */
/* yyresume: */
- /* First try to decide what to do without reference to look-ahead token. */
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yyn == YYFLAG)
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
if (yychar == YYEMPTY)
{
- YYDPRINTF ((stderr, "Reading a token: "));
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
yychar = YYLEX;
}
- if (yychar <= YYEOF)
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
{
- yychar = yytoken = YYEOF;
- YYDPRINTF ((stderr, "Now at end of input.\n"));
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
}
else
{
- yytoken = YYTRANSLATE (yychar);
- YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
}
- /* If the proper action on seeing token YYTOKEN is to reduce or to
- detect an error, take that action. */
- yyn += yytoken;
- if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
+
yyn = yytable[yyn];
- if (yyn <= 0)
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
+ if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
- /* Shift the look-ahead token. */
- YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
/* Discard the token being shifted unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state. |
-`-----------------------------------------------------------*/
+/* Do the default action for the current state. */
yydefault:
+
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
- goto yyreduce;
-
-/*-----------------------------.
-| yyreduce -- Do a reduction. |
-`-----------------------------*/
+/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
- /* yyn is the number of a rule to reduce with. */
yylen = yyr2[yyn];
+ if (yylen > 0)
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
- /* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
- Otherwise, the following line sets YYVAL to garbage.
- This behavior is undocumented and Bison
- users should not rely upon it. Assigning to YYVAL
- unconditionally makes the parser a bit smaller, and it avoids a
- GCC warning that YYVAL may be used uninitialized. */
- yyval = yyvsp[1-yylen];
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
- YY_REDUCE_PRINT (yyn);
- switch (yyn)
- {
- case 2:
-#line 322 "asn1p_y.y"
- {
- *(void **)param = (yyvsp[0].a_grammar);
- }
- break;
- case 3:
-#line 328 "asn1p_y.y"
- {
- (yyval.a_grammar) = asn1p_new();
- checkmem((yyval.a_grammar));
- TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[0].a_module), mod_next);
- }
- break;
+ switch (yyn) {
- case 4:
+case 1:
+#line 322 "asn1p_y.y"
+{
+ *(void **)param = yyvsp[0].a_grammar;
+ ;
+ break;}
+case 2:
+#line 328 "asn1p_y.y"
+{
+ yyval.a_grammar = asn1p_new();
+ checkmem(yyval.a_grammar);
+ TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
+ ;
+ break;}
+case 3:
#line 333 "asn1p_y.y"
- {
- (yyval.a_grammar) = (yyvsp[-1].a_grammar);
- TQ_ADD(&((yyval.a_grammar)->modules), (yyvsp[0].a_module), mod_next);
- }
- break;
-
- case 5:
+{
+ yyval.a_grammar = yyvsp[-1].a_grammar;
+ TQ_ADD(&(yyval.a_grammar->modules), yyvsp[0].a_module, mod_next);
+ ;
+ break;}
+case 4:
#line 354 "asn1p_y.y"
- {
+{
- if((yyvsp[-1].a_module)) {
- (yyval.a_module) = (yyvsp[-1].a_module);
+ if(yyvsp[-1].a_module) {
+ yyval.a_module = yyvsp[-1].a_module;
} else {
/* There's a chance that a module is just plain empty */
- (yyval.a_module) = asn1p_module_new();
+ yyval.a_module = asn1p_module_new();
}
- checkmem((yyval.a_module));
-
- (yyval.a_module)->ModuleName = (yyvsp[-7].tv_str);
- (yyval.a_module)->module_oid = (yyvsp[-6].a_oid);
- (yyval.a_module)->module_flags = (yyvsp[-4].a_module_flags);
- }
- break;
-
- case 6:
+ checkmem(yyval.a_module);
+
+ yyval.a_module->ModuleName = yyvsp[-7].tv_str;
+ yyval.a_module->module_oid = yyvsp[-6].a_oid;
+ yyval.a_module->module_flags = yyvsp[-4].a_module_flags;
+ ;
+ break;}
+case 5:
#line 375 "asn1p_y.y"
- { (yyval.a_oid) = 0; }
- break;
-
- case 7:
+{ yyval.a_oid = 0; ;
+ break;}
+case 6:
#line 376 "asn1p_y.y"
- { (yyval.a_oid) = (yyvsp[0].a_oid); }
- break;
-
- case 8:
+{ yyval.a_oid = yyvsp[0].a_oid; ;
+ break;}
+case 7:
#line 380 "asn1p_y.y"
- {
- (yyval.a_oid) = (yyvsp[-1].a_oid);
- }
- break;
-
- case 9:
+{
+ yyval.a_oid = yyvsp[-1].a_oid;
+ ;
+ break;}
+case 8:
#line 383 "asn1p_y.y"
- {
- (yyval.a_oid) = 0;
- }
- break;
-
- case 10:
+{
+ yyval.a_oid = 0;
+ ;
+ break;}
+case 9:
#line 389 "asn1p_y.y"
- {
- (yyval.a_oid) = asn1p_oid_new();
- asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[0].a_oid_arc));
- if((yyvsp[0].a_oid_arc).name)
- free((yyvsp[0].a_oid_arc).name);
- }
- break;
-
- case 11:
+{
+ yyval.a_oid = asn1p_oid_new();
+ asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
+ if(yyvsp[0].a_oid_arc.name)
+ free(yyvsp[0].a_oid_arc.name);
+ ;
+ break;}
+case 10:
#line 395 "asn1p_y.y"
- {
- (yyval.a_oid) = (yyvsp[-1].a_oid);
- asn1p_oid_add_arc((yyval.a_oid), &(yyvsp[0].a_oid_arc));
- if((yyvsp[0].a_oid_arc).name)
- free((yyvsp[0].a_oid_arc).name);
- }
- break;
-
- case 12:
+{
+ yyval.a_oid = yyvsp[-1].a_oid;
+ asn1p_oid_add_arc(yyval.a_oid, &yyvsp[0].a_oid_arc);
+ if(yyvsp[0].a_oid_arc.name)
+ free(yyvsp[0].a_oid_arc.name);
+ ;
+ break;}
+case 11:
#line 404 "asn1p_y.y"
- { /* iso */
- (yyval.a_oid_arc).name = (yyvsp[0].tv_str);
- (yyval.a_oid_arc).number = -1;
- }
- break;
-
- case 13:
+{ /* iso */
+ yyval.a_oid_arc.name = yyvsp[0].tv_str;
+ yyval.a_oid_arc.number = -1;
+ ;
+ break;}
+case 12:
#line 408 "asn1p_y.y"
- { /* iso(1) */
- (yyval.a_oid_arc).name = (yyvsp[-3].tv_str);
- (yyval.a_oid_arc).number = (yyvsp[-1].a_int);
- }
- break;
-
- case 14:
+{ /* iso(1) */
+ yyval.a_oid_arc.name = yyvsp[-3].tv_str;
+ yyval.a_oid_arc.number = yyvsp[-1].a_int;
+ ;
+ break;}
+case 13:
#line 412 "asn1p_y.y"
- { /* 1 */
- (yyval.a_oid_arc).name = 0;
- (yyval.a_oid_arc).number = (yyvsp[0].a_int);
- }
- break;
-
- case 15:
+{ /* 1 */
+ yyval.a_oid_arc.name = 0;
+ yyval.a_oid_arc.number = yyvsp[0].a_int;
+ ;
+ break;}
+case 14:
#line 422 "asn1p_y.y"
- { (yyval.a_module_flags) = MSF_NOFLAGS; }
- break;
-
- case 16:
+{ yyval.a_module_flags = MSF_NOFLAGS; ;
+ break;}
+case 15:
#line 423 "asn1p_y.y"
- {
- (yyval.a_module_flags) = (yyvsp[0].a_module_flags);
- }
- break;
-
- case 17:
+{
+ yyval.a_module_flags = yyvsp[0].a_module_flags;
+ ;
+ break;}
+case 16:
#line 432 "asn1p_y.y"
- {
- (yyval.a_module_flags) = (yyvsp[0].a_module_flags);
- }
- break;
-
- case 18:
+{
+ yyval.a_module_flags = yyvsp[0].a_module_flags;
+ ;
+ break;}
+case 17:
#line 435 "asn1p_y.y"
- {
- (yyval.a_module_flags) = (yyvsp[-1].a_module_flags) | (yyvsp[0].a_module_flags);
- }
- break;
-
- case 19:
+{
+ yyval.a_module_flags = yyvsp[-1].a_module_flags | yyvsp[0].a_module_flags;
+ ;
+ break;}
+case 18:
#line 444 "asn1p_y.y"
- {
- (yyval.a_module_flags) = MSF_EXPLICIT_TAGS;
- }
- break;
-
- case 20:
+{
+ yyval.a_module_flags = MSF_EXPLICIT_TAGS;
+ ;
+ break;}
+case 19:
#line 447 "asn1p_y.y"
- {
- (yyval.a_module_flags) = MSF_IMPLICIT_TAGS;
- }
- break;
-
- case 21:
+{
+ yyval.a_module_flags = MSF_IMPLICIT_TAGS;
+ ;
+ break;}
+case 20:
#line 450 "asn1p_y.y"
- {
- (yyval.a_module_flags) = MSF_AUTOMATIC_TAGS;
- }
- break;
-
- case 22:
+{
+ yyval.a_module_flags = MSF_AUTOMATIC_TAGS;
+ ;
+ break;}
+case 21:
#line 453 "asn1p_y.y"
- {
- (yyval.a_module_flags) = MSF_EXTENSIBILITY_IMPLIED;
- }
- break;
-
- case 23:
+{
+ yyval.a_module_flags = MSF_EXTENSIBILITY_IMPLIED;
+ ;
+ break;}
+case 22:
#line 457 "asn1p_y.y"
- {
+{
/* X.680Amd1 specifies TAG and XER */
- if(strcmp((yyvsp[-1].tv_str), "TAG") == 0) {
- (yyval.a_module_flags) = MSF_TAG_INSTRUCTIONS;
- } else if(strcmp((yyvsp[-1].tv_str), "XER") == 0) {
- (yyval.a_module_flags) = MSF_XER_INSTRUCTIONS;
+ if(strcmp(yyvsp[-1].tv_str, "TAG") == 0) {
+ yyval.a_module_flags = MSF_TAG_INSTRUCTIONS;
+ } else if(strcmp(yyvsp[-1].tv_str, "XER") == 0) {
+ yyval.a_module_flags = MSF_XER_INSTRUCTIONS;
} else {
fprintf(stderr,
"WARNING: %s INSTRUCTIONS at line %d: "
"Unrecognized encoding reference\n",
- (yyvsp[-1].tv_str), yylineno);
- (yyval.a_module_flags) = MSF_unk_INSTRUCTIONS;
+ yyvsp[-1].tv_str, yylineno);
+ yyval.a_module_flags = MSF_unk_INSTRUCTIONS;
}
- free((yyvsp[-1].tv_str));
- }
- break;
-
- case 24:
+ free(yyvsp[-1].tv_str);
+ ;
+ break;}
+case 23:
#line 478 "asn1p_y.y"
- { (yyval.a_module) = 0; }
- break;
-
- case 25:
+{ yyval.a_module = 0; ;
+ break;}
+case 24:
#line 479 "asn1p_y.y"
- {
- (yyval.a_module) = (yyvsp[0].a_module);
- }
- break;
-
- case 26:
+{
+ yyval.a_module = yyvsp[0].a_module;
+ ;
+ break;}
+case 25:
#line 488 "asn1p_y.y"
- {
- (yyval.a_module) = (yyvsp[0].a_module);
- }
- break;
-
- case 27:
+{
+ yyval.a_module = yyvsp[0].a_module;
+ ;
+ break;}
+case 26:
#line 491 "asn1p_y.y"
- {
- (yyval.a_module) = (yyvsp[-1].a_module);
+{
+ yyval.a_module = yyvsp[-1].a_module;
/* Behave well when one of them is skipped. */
- if(!((yyvsp[-1].a_module))) {
- if((yyvsp[0].a_module)) (yyval.a_module) = (yyvsp[0].a_module);
+ if(!(yyvsp[-1].a_module)) {
+ if(yyvsp[0].a_module) yyval.a_module = yyvsp[0].a_module;
break;
}
@@ -2165,12 +1554,12 @@ yyreduce:
#error MY_IMPORT DEFINED ELSEWHERE!
#endif
#define MY_IMPORT(foo,field) do { \
- while(TQ_FIRST(&((yyvsp[0].a_module)->foo))) { \
- TQ_ADD(&((yyval.a_module)->foo), \
- TQ_REMOVE(&((yyvsp[0].a_module)->foo), field), \
+ while(TQ_FIRST(&(yyvsp[0].a_module->foo))) { \
+ TQ_ADD(&(yyval.a_module->foo), \
+ TQ_REMOVE(&(yyvsp[0].a_module->foo), field), \
field); \
} \
- assert(TQ_FIRST(&((yyvsp[0].a_module)->foo)) == 0); \
+ assert(TQ_FIRST(&(yyvsp[0].a_module->foo)) == 0); \
} while(0)
MY_IMPORT(imports, xp_next);
@@ -2178,2522 +1567,2214 @@ yyreduce:
MY_IMPORT(members, next);
#undef MY_IMPORT
- }
- break;
-
- case 28:
+ ;
+ break;}
+case 27:
#line 524 "asn1p_y.y"
- {
- (yyval.a_module) = (yyvsp[0].a_module);
- }
- break;
-
- case 29:
+{
+ yyval.a_module = yyvsp[0].a_module;
+ ;
+ break;}
+case 28:
#line 527 "asn1p_y.y"
- {
- (yyval.a_module) = asn1p_module_new();
- checkmem((yyval.a_module));
- if((yyvsp[0].a_xports)) {
- TQ_ADD(&((yyval.a_module)->exports), (yyvsp[0].a_xports), xp_next);
+{
+ yyval.a_module = asn1p_module_new();
+ checkmem(yyval.a_module);
+ if(yyvsp[0].a_xports) {
+ TQ_ADD(&(yyval.a_module->exports), yyvsp[0].a_xports, xp_next);
} else {
/* "EXPORTS ALL;" ? */
}
- }
- break;
-
- case 30:
+ ;
+ break;}
+case 29:
#line 536 "asn1p_y.y"
- {
- (yyval.a_module) = asn1p_module_new();
- checkmem((yyval.a_module));
- assert((yyvsp[0].a_expr)->expr_type != A1TC_INVALID);
- assert((yyvsp[0].a_expr)->meta_type != AMT_INVALID);
- TQ_ADD(&((yyval.a_module)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 31:
+{
+ yyval.a_module = asn1p_module_new();
+ checkmem(yyval.a_module);
+ assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
+ assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
+ TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 30:
#line 543 "asn1p_y.y"
- {
- (yyval.a_module) = asn1p_module_new();
- checkmem((yyval.a_module));
- assert((yyvsp[0].a_expr)->expr_type != A1TC_INVALID);
- assert((yyvsp[0].a_expr)->meta_type != AMT_INVALID);
- TQ_ADD(&((yyval.a_module)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 32:
+{
+ yyval.a_module = asn1p_module_new();
+ checkmem(yyval.a_module);
+ assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
+ assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
+ TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 31:
#line 556 "asn1p_y.y"
- {
- (yyval.a_module) = asn1p_module_new();
- checkmem((yyval.a_module));
- assert((yyvsp[0].a_expr)->expr_type != A1TC_INVALID);
- assert((yyvsp[0].a_expr)->meta_type != AMT_INVALID);
- TQ_ADD(&((yyval.a_module)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 33:
+{
+ yyval.a_module = asn1p_module_new();
+ checkmem(yyval.a_module);
+ assert(yyvsp[0].a_expr->expr_type != A1TC_INVALID);
+ assert(yyvsp[0].a_expr->meta_type != AMT_INVALID);
+ TQ_ADD(&(yyval.a_module->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 32:
#line 564 "asn1p_y.y"
- { asn1p_lexer_hack_push_encoding_control(); }
- break;
-
- case 34:
+{ asn1p_lexer_hack_push_encoding_control(); ;
+ break;}
+case 33:
#line 565 "asn1p_y.y"
- {
+{
fprintf(stderr,
"WARNING: ENCODING-CONTROL %s "
"specification at line %d ignored\n",
- (yyvsp[-1].tv_str), yylineno);
- free((yyvsp[-1].tv_str));
- (yyval.a_module) = 0;
- }
- break;
-
- case 35:
+ yyvsp[-1].tv_str, yylineno);
+ free(yyvsp[-1].tv_str);
+ yyval.a_module = 0;
+ ;
+ break;}
+case 34:
#line 577 "asn1p_y.y"
- {
+{
return yyerror(
"Attempt to redefine a standard basic string type, "
"please comment out or remove this type redefinition.");
- }
- break;
-
- case 36:
+ ;
+ break;}
+case 35:
#line 590 "asn1p_y.y"
- {
+{
if(!saved_aid && 0)
return yyerror("Unterminated IMPORTS FROM, "
"expected semicolon ';'");
saved_aid = 0;
- (yyval.a_module) = (yyvsp[-1].a_module);
- }
- break;
-
- case 37:
+ yyval.a_module = yyvsp[-1].a_module;
+ ;
+ break;}
+case 36:
#line 600 "asn1p_y.y"
- {
+{
return yyerror("Empty IMPORTS list");
- }
- break;
-
- case 38:
+ ;
+ break;}
+case 37:
#line 606 "asn1p_y.y"
- {
- (yyval.a_module) = asn1p_module_new();
- checkmem((yyval.a_module));
- TQ_ADD(&((yyval.a_module)->imports), (yyvsp[0].a_xports), xp_next);
- }
- break;
-
- case 39:
+{
+ yyval.a_module = asn1p_module_new();
+ checkmem(yyval.a_module);
+ TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
+ ;
+ break;}
+case 38:
#line 611 "asn1p_y.y"
- {
- (yyval.a_module) = (yyvsp[-1].a_module);
- TQ_ADD(&((yyval.a_module)->imports), (yyvsp[0].a_xports), xp_next);
- }
- break;
-
- case 40:
+{
+ yyval.a_module = yyvsp[-1].a_module;
+ TQ_ADD(&(yyval.a_module->imports), yyvsp[0].a_xports, xp_next);
+ ;
+ break;}
+case 39:
#line 618 "asn1p_y.y"
- { memset(&(yyval.a_aid), 0, sizeof((yyval.a_aid))); }
- break;
-
- case 41:
+{ memset(&yyval.a_aid, 0, sizeof(yyval.a_aid)); ;
+ break;}
+case 40:
#line 619 "asn1p_y.y"
- { (yyval.a_aid).oid = (yyvsp[0].a_oid); }
- break;
-
- case 42:
+{ yyval.a_aid.oid = yyvsp[0].a_oid; ;
+ break;}
+case 41:
#line 623 "asn1p_y.y"
- {
- (yyval.a_xports) = (yyvsp[-3].a_xports);
- (yyval.a_xports)->fromModuleName = (yyvsp[-1].tv_str);
- (yyval.a_xports)->identifier = (yyvsp[0].a_aid);
+{
+ yyval.a_xports = yyvsp[-3].a_xports;
+ yyval.a_xports->fromModuleName = yyvsp[-1].tv_str;
+ yyval.a_xports->identifier = yyvsp[0].a_aid;
/* This stupid thing is used for look-back hack. */
- saved_aid = (yyval.a_xports)->identifier.oid ? 0 : &((yyval.a_xports)->identifier);
- checkmem((yyval.a_xports));
- }
- break;
-
- case 43:
+ saved_aid = yyval.a_xports->identifier.oid ? 0 : &(yyval.a_xports->identifier);
+ checkmem(yyval.a_xports);
+ ;
+ break;}
+case 42:
#line 634 "asn1p_y.y"
- {
- (yyval.a_xports) = asn1p_xports_new();
- checkmem((yyval.a_xports));
- TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 44:
+{
+ yyval.a_xports = asn1p_xports_new();
+ checkmem(yyval.a_xports);
+ TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 43:
#line 639 "asn1p_y.y"
- {
- (yyval.a_xports) = (yyvsp[-2].a_xports);
- TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 45:
+{
+ yyval.a_xports = yyvsp[-2].a_xports;
+ TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 44:
#line 646 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
- (yyval.a_expr)->expr_type = A1TC_REFERENCE;
- }
- break;
-
- case 46:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[0].tv_str;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ ;
+ break;}
+case 45:
#line 652 "asn1p_y.y"
- { /* Completely equivalent to above */
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->expr_type = A1TC_REFERENCE;
- }
- break;
-
- case 47:
+{ /* Completely equivalent to above */
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ ;
+ break;}
+case 46:
#line 658 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
- (yyval.a_expr)->expr_type = A1TC_REFERENCE;
- }
- break;
-
- case 48:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[0].tv_str;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ ;
+ break;}
+case 47:
#line 667 "asn1p_y.y"
- {
- (yyval.a_xports) = (yyvsp[-1].a_xports);
- }
- break;
-
- case 49:
+{
+ yyval.a_xports = yyvsp[-1].a_xports;
+ ;
+ break;}
+case 48:
#line 670 "asn1p_y.y"
- {
- (yyval.a_xports) = 0;
- }
- break;
-
- case 50:
+{
+ yyval.a_xports = 0;
+ ;
+ break;}
+case 49:
#line 673 "asn1p_y.y"
- {
+{
/* Empty EXPORTS clause effectively prohibits export. */
- (yyval.a_xports) = asn1p_xports_new();
- checkmem((yyval.a_xports));
- }
- break;
-
- case 51:
+ yyval.a_xports = asn1p_xports_new();
+ checkmem(yyval.a_xports);
+ ;
+ break;}
+case 50:
#line 681 "asn1p_y.y"
- {
- (yyval.a_xports) = asn1p_xports_new();
- assert((yyval.a_xports));
- TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 52:
+{
+ yyval.a_xports = asn1p_xports_new();
+ assert(yyval.a_xports);
+ TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 51:
#line 686 "asn1p_y.y"
- {
- (yyval.a_xports) = (yyvsp[-2].a_xports);
- TQ_ADD(&((yyval.a_xports)->members), (yyvsp[0].a_expr), next);
- }
- break;
-
- case 53:
+{
+ yyval.a_xports = yyvsp[-2].a_xports;
+ TQ_ADD(&(yyval.a_xports->members), yyvsp[0].a_expr, next);
+ ;
+ break;}
+case 52:
#line 693 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
- (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
- }
- break;
-
- case 54:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[0].tv_str;
+ yyval.a_expr->expr_type = A1TC_EXPORTVAR;
+ ;
+ break;}
+case 53:
#line 699 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
- }
- break;
-
- case 55:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->expr_type = A1TC_EXPORTVAR;
+ ;
+ break;}
+case 54:
#line 705 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
- (yyval.a_expr)->expr_type = A1TC_EXPORTVAR;
- }
- break;
-
- case 56:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[0].tv_str;
+ yyval.a_expr->expr_type = A1TC_EXPORTVAR;
+ ;
+ break;}
+case 55:
#line 716 "asn1p_y.y"
- { asn1p_lexer_hack_push_opaque_state(); }
- break;
-
- case 57:
+{ asn1p_lexer_hack_push_opaque_state(); ;
+ break;}
+case 56:
#line 716 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-4].a_expr);
- assert((yyval.a_expr)->Identifier == 0);
- (yyval.a_expr)->Identifier = (yyvsp[-5].tv_str);
- (yyval.a_expr)->meta_type = AMT_VALUESET;
+{
+ yyval.a_expr = yyvsp[-4].a_expr;
+ assert(yyval.a_expr->Identifier == 0);
+ yyval.a_expr->Identifier = yyvsp[-5].tv_str;
+ yyval.a_expr->meta_type = AMT_VALUESET;
/* take care of ValueSet body */
- }
- break;
-
- case 58:
+ ;
+ break;}
+case 57:
#line 726 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->reference = (yyvsp[0].a_ref);
- (yyval.a_expr)->expr_type = A1TC_REFERENCE;
- (yyval.a_expr)->meta_type = AMT_TYPEREF;
- }
- break;
-
- case 59:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->reference = yyvsp[0].a_ref;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ yyval.a_expr->meta_type = AMT_TYPEREF;
+ ;
+ break;}
+case 58:
#line 733 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = (yyvsp[0].a_type);
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 60:
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = yyvsp[0].a_type;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 59:
#line 751 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- assert((yyval.a_expr)->expr_type);
- assert((yyval.a_expr)->meta_type);
- }
- break;
-
- case 61:
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ assert(yyval.a_expr->expr_type);
+ assert(yyval.a_expr->meta_type);
+ ;
+ break;}
+case 60:
#line 757 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
- assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
- }
- break;
-
- case 62:
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
+ assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS);
+ ;
+ break;}
+case 61:
#line 773 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- assert((yyval.a_expr)->Identifier == 0);
- (yyval.a_expr)->Identifier = (yyvsp[-5].tv_str);
- (yyval.a_expr)->params = (yyvsp[-3].a_plist);
- (yyval.a_expr)->meta_type = AMT_PARAMTYPE;
- }
- break;
-
- case 63:
-#line 783 "asn1p_y.y"
- {
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ assert(yyval.a_expr->Identifier == 0);
+ yyval.a_expr->Identifier = yyvsp[-5].tv_str;
+ yyval.a_expr->lhs_params = yyvsp[-3].a_plist;
+ ;
+ break;}
+case 62:
+#line 782 "asn1p_y.y"
+{
int ret;
- (yyval.a_plist) = asn1p_paramlist_new(yylineno);
- checkmem((yyval.a_plist));
- ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[0].a_parg).governor, (yyvsp[0].a_parg).argument);
+ yyval.a_plist = asn1p_paramlist_new(yylineno);
+ checkmem(yyval.a_plist);
+ ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
checkmem(ret == 0);
- if((yyvsp[0].a_parg).governor) asn1p_ref_free((yyvsp[0].a_parg).governor);
- if((yyvsp[0].a_parg).argument) free((yyvsp[0].a_parg).argument);
- }
- break;
-
- case 64:
-#line 792 "asn1p_y.y"
- {
+ if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
+ if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
+ ;
+ break;}
+case 63:
+#line 791 "asn1p_y.y"
+{
int ret;
- (yyval.a_plist) = (yyvsp[-2].a_plist);
- ret = asn1p_paramlist_add_param((yyval.a_plist), (yyvsp[0].a_parg).governor, (yyvsp[0].a_parg).argument);
+ yyval.a_plist = yyvsp[-2].a_plist;
+ ret = asn1p_paramlist_add_param(yyval.a_plist, yyvsp[0].a_parg.governor, yyvsp[0].a_parg.argument);
checkmem(ret == 0);
- if((yyvsp[0].a_parg).governor) asn1p_ref_free((yyvsp[0].a_parg).governor);
- if((yyvsp[0].a_parg).argument) free((yyvsp[0].a_parg).argument);
- }
- break;
-
- case 65:
-#line 803 "asn1p_y.y"
- {
- (yyval.a_parg).governor = NULL;
- (yyval.a_parg).argument = (yyvsp[0].tv_str);
- }
- break;
-
- case 66:
-#line 807 "asn1p_y.y"
- {
+ if(yyvsp[0].a_parg.governor) asn1p_ref_free(yyvsp[0].a_parg.governor);
+ if(yyvsp[0].a_parg.argument) free(yyvsp[0].a_parg.argument);
+ ;
+ break;}
+case 64:
+#line 802 "asn1p_y.y"
+{
+ yyval.a_parg.governor = NULL;
+ yyval.a_parg.argument = yyvsp[0].tv_str;
+ ;
+ break;}
+case 65:
+#line 806 "asn1p_y.y"
+{
int ret;
- (yyval.a_parg).governor = asn1p_ref_new(yylineno);
- ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[-2].tv_str), 0);
+ yyval.a_parg.governor = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
checkmem(ret == 0);
- (yyval.a_parg).argument = (yyvsp[0].tv_str);
- }
- break;
-
- case 67:
-#line 814 "asn1p_y.y"
- {
+ yyval.a_parg.argument = yyvsp[0].tv_str;
+ ;
+ break;}
+case 66:
+#line 813 "asn1p_y.y"
+{
int ret;
- (yyval.a_parg).governor = asn1p_ref_new(yylineno);
- ret = asn1p_ref_add_component((yyval.a_parg).governor, (yyvsp[-2].tv_str), 0);
+ yyval.a_parg.governor = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component(yyval.a_parg.governor, yyvsp[-2].tv_str, 0);
checkmem(ret == 0);
- (yyval.a_parg).argument = (yyvsp[0].tv_str);
- }
- break;
-
- case 68:
-#line 821 "asn1p_y.y"
- {
+ yyval.a_parg.argument = yyvsp[0].tv_str;
+ ;
+ break;}
+case 67:
+#line 820 "asn1p_y.y"
+{
int ret;
- (yyval.a_parg).governor = asn1p_ref_new(yylineno);
- ret = asn1p_ref_add_component((yyval.a_parg).governor,
- ASN_EXPR_TYPE2STR((yyvsp[-2].a_type)), 1);
+ yyval.a_parg.governor = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component(yyval.a_parg.governor,
+ ASN_EXPR_TYPE2STR(yyvsp[-2].a_type), 1);
checkmem(ret == 0);
- (yyval.a_parg).argument = (yyvsp[0].tv_str);
- }
- break;
-
- case 69:
-#line 832 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 70:
-#line 837 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 71:
-#line 844 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- }
- break;
-
- case 72:
-#line 847 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
- (yyval.a_expr)->expr_type = A1TC_REFERENCE;
- (yyval.a_expr)->meta_type = AMT_VALUE;
- }
- break;
-
- case 73:
-#line 871 "asn1p_y.y"
- { (yyval.a_expr) = asn1p_expr_new(yylineno); }
- break;
-
- case 74:
-#line 872 "asn1p_y.y"
- { (yyval.a_expr) = (yyvsp[0].a_expr); }
- break;
-
- case 75:
+ yyval.a_parg.argument = yyvsp[0].tv_str;
+ ;
+ break;}
+case 68:
+#line 831 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 69:
+#line 836 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 70:
+#line 843 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ ;
+ break;}
+case 71:
+#line 846 "asn1p_y.y"
+{
+ asn1p_ref_t *ref;
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[0].tv_str;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ ref = asn1p_ref_new(yylineno);
+ asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
+ yyval.a_expr->value = asn1p_value_fromref(ref, 0);
+ ;
+ break;}
+case 72:
+#line 874 "asn1p_y.y"
+{ yyval.a_expr = asn1p_expr_new(yylineno); ;
+ break;}
+case 73:
#line 875 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 76:
-#line 880 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 77:
-#line 887 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- assert((yyval.a_expr)->Identifier == 0);
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyvsp[0].a_marker).flags |= (yyval.a_expr)->marker.flags;
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 78:
-#line 894 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- (yyvsp[0].a_marker).flags |= (yyval.a_expr)->marker.flags;
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- _fixup_anonymous_identifier((yyval.a_expr));
- }
- break;
-
- case 79:
-#line 900 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->meta_type = (yyvsp[0].a_expr)->meta_type;
- (yyval.a_expr)->expr_type = A1TC_COMPONENTS_OF;
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 80:
-#line 907 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- }
- break;
-
- case 81:
-#line 913 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 82:
-#line 918 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 83:
-#line 925 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- assert((yyval.a_expr)->Identifier == 0);
- (yyval.a_expr)->Identifier = (yyvsp[-1].tv_str);
- }
- break;
-
- case 84:
-#line 930 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- }
- break;
-
- case 85:
+{ yyval.a_expr = yyvsp[0].a_expr; ;
+ break;}
+case 74:
+#line 878 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 75:
+#line 883 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 76:
+#line 890 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ assert(yyval.a_expr->Identifier == 0);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 77:
+#line 897 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ yyvsp[0].a_marker.flags |= yyval.a_expr->marker.flags;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ _fixup_anonymous_identifier(yyval.a_expr);
+ ;
+ break;}
+case 78:
+#line 903 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->meta_type = yyvsp[0].a_expr->meta_type;
+ yyval.a_expr->expr_type = A1TC_COMPONENTS_OF;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 79:
+#line 910 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ ;
+ break;}
+case 80:
+#line 916 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 81:
+#line 921 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 82:
+#line 928 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ assert(yyval.a_expr->Identifier == 0);
+ yyval.a_expr->Identifier = yyvsp[-1].tv_str;
+ ;
+ break;}
+case 83:
#line 933 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- _fixup_anonymous_identifier((yyval.a_expr));
- }
- break;
-
- case 86:
-#line 940 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->with_syntax = (yyvsp[0].a_wsynt);
- assert((yyval.a_expr)->expr_type == A1TC_CLASSDEF);
- assert((yyval.a_expr)->meta_type == AMT_OBJECTCLASS);
- }
- break;
-
- case 87:
-#line 950 "asn1p_y.y"
- { (yyval.a_int) = 0; }
- break;
-
- case 88:
-#line 951 "asn1p_y.y"
- { (yyval.a_int) = 1; }
- break;
-
- case 89:
-#line 955 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = A1TC_CLASSDEF;
- (yyval.a_expr)->meta_type = AMT_OBJECTCLASS;
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 90:
-#line 962 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 91:
-#line 972 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[-1].tv_str);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 92:
-#line 982 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
- (yyval.a_expr)->unique = (yyvsp[-1].a_int);
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- asn1p_expr_add((yyval.a_expr), (yyvsp[-2].a_expr));
- }
- break;
-
- case 93:
-#line 993 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVFS;
- (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 94:
-#line 1003 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OFS;
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 95:
-#line 1014 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_VTVSFS;
- (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 96:
-#line 1024 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_FTVSFS;
- asn1p_expr_add((yyval.a_expr), (yyvsp[-1].a_expr));
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 97:
-#line 1035 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyval.a_expr)->reference = (yyvsp[-1].a_ref);
- (yyval.a_expr)->meta_type = AMT_OBJECTFIELD;
- (yyval.a_expr)->expr_type = A1TC_CLASSFIELD_OSFS;
- (yyval.a_expr)->marker = (yyvsp[0].a_marker);
- }
- break;
-
- case 98:
-#line 1047 "asn1p_y.y"
- { (yyval.a_wsynt) = 0; }
- break;
-
- case 99:
-#line 1048 "asn1p_y.y"
- {
- (yyval.a_wsynt) = (yyvsp[0].a_wsynt);
- }
- break;
-
- case 100:
-#line 1055 "asn1p_y.y"
- { asn1p_lexer_hack_enable_with_syntax(); }
- break;
-
- case 101:
-#line 1057 "asn1p_y.y"
- {
- (yyval.a_wsynt) = (yyvsp[-1].a_wsynt);
- }
- break;
-
- case 102:
-#line 1063 "asn1p_y.y"
- {
- (yyval.a_wsynt) = asn1p_wsyntx_new();
- TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[0].a_wchunk), next);
- }
- break;
-
- case 103:
-#line 1067 "asn1p_y.y"
- {
- (yyval.a_wsynt) = (yyvsp[-1].a_wsynt);
- TQ_ADD(&((yyval.a_wsynt)->chunks), (yyvsp[0].a_wchunk), next);
- }
- break;
-
- case 104:
-#line 1074 "asn1p_y.y"
- {
- (yyval.a_wchunk) = asn1p_wsyntx_chunk_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
- (yyval.a_wchunk)->type = WC_WHITESPACE;
- }
- break;
-
- case 105:
-#line 1078 "asn1p_y.y"
- {
- (yyval.a_wchunk) = asn1p_wsyntx_chunk_frombuf((yyvsp[0].tv_str), strlen((yyvsp[0].tv_str)), 0);
- }
- break;
-
- case 106:
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ ;
+ break;}
+case 84:
+#line 936 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ _fixup_anonymous_identifier(yyval.a_expr);
+ ;
+ break;}
+case 85:
+#line 943 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ checkmem(yyval.a_expr);
+ yyval.a_expr->with_syntax = yyvsp[0].a_wsynt;
+ assert(yyval.a_expr->expr_type == A1TC_CLASSDEF);
+ assert(yyval.a_expr->meta_type == AMT_OBJECTCLASS);
+ ;
+ break;}
+case 86:
+#line 953 "asn1p_y.y"
+{ yyval.a_int = 0; ;
+ break;}
+case 87:
+#line 954 "asn1p_y.y"
+{ yyval.a_int = 1; ;
+ break;}
+case 88:
+#line 958 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = A1TC_CLASSDEF;
+ yyval.a_expr->meta_type = AMT_OBJECTCLASS;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 89:
+#line 965 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 90:
+#line 975 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[-1].tv_str;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_TFS; /* TypeFieldSpec */
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 91:
+#line 985 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ yyval.a_expr->Identifier = yyvsp[-3].tv_str;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVFS; /* FixedTypeValueFieldSpec */
+ yyval.a_expr->unique = yyvsp[-1].a_int;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ asn1p_expr_add(yyval.a_expr, yyvsp[-2].a_expr);
+ ;
+ break;}
+case 92:
+#line 996 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVFS;
+ yyval.a_expr->reference = yyvsp[-1].a_ref;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 93:
+#line 1006 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->reference = yyvsp[-1].a_ref;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_OFS;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 94:
+#line 1017 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_VTVSFS;
+ yyval.a_expr->reference = yyvsp[-1].a_ref;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 95:
+#line 1027 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_FTVSFS;
+ asn1p_expr_add(yyval.a_expr, yyvsp[-1].a_expr);
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 96:
+#line 1038 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = yyvsp[-2].tv_str;
+ yyval.a_expr->reference = yyvsp[-1].a_ref;
+ yyval.a_expr->meta_type = AMT_OBJECTFIELD;
+ yyval.a_expr->expr_type = A1TC_CLASSFIELD_OSFS;
+ yyval.a_expr->marker = yyvsp[0].a_marker;
+ ;
+ break;}
+case 97:
+#line 1050 "asn1p_y.y"
+{ yyval.a_wsynt = 0; ;
+ break;}
+case 98:
+#line 1051 "asn1p_y.y"
+{
+ yyval.a_wsynt = yyvsp[0].a_wsynt;
+ ;
+ break;}
+case 99:
+#line 1058 "asn1p_y.y"
+{ asn1p_lexer_hack_enable_with_syntax(); ;
+ break;}
+case 100:
+#line 1060 "asn1p_y.y"
+{
+ yyval.a_wsynt = yyvsp[-1].a_wsynt;
+ ;
+ break;}
+case 101:
+#line 1066 "asn1p_y.y"
+{
+ yyval.a_wsynt = asn1p_wsyntx_new();
+ TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
+ ;
+ break;}
+case 102:
+#line 1070 "asn1p_y.y"
+{
+ yyval.a_wsynt = yyvsp[-1].a_wsynt;
+ TQ_ADD(&(yyval.a_wsynt->chunks), yyvsp[0].a_wchunk, next);
+ ;
+ break;}
+case 103:
+#line 1077 "asn1p_y.y"
+{
+ yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
+ yyval.a_wchunk->type = WC_WHITESPACE;
+ ;
+ break;}
+case 104:
#line 1081 "asn1p_y.y"
- {
- (yyval.a_wchunk) = asn1p_wsyntx_chunk_frombuf((yyvsp[0].a_refcomp).name, strlen((yyvsp[0].a_refcomp).name), 0);
- (yyval.a_wchunk)->type = WC_FIELD;
- }
- break;
-
- case 107:
-#line 1085 "asn1p_y.y"
- {
- (yyval.a_wchunk) = asn1p_wsyntx_chunk_fromsyntax((yyvsp[-1].a_wsynt));
- }
- break;
-
- case 108:
-#line 1091 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = strdup("...");
- checkmem((yyval.a_expr)->Identifier);
- (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 109:
-#line 1099 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = strdup("...");
- checkmem((yyval.a_expr)->Identifier);
- (yyval.a_expr)->value = (yyvsp[0].a_value);
- (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 110:
-#line 1108 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = strdup("...");
- (yyval.a_expr)->value = (yyvsp[0].a_value);
- checkmem((yyval.a_expr)->Identifier);
- (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 111:
-#line 1120 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- (yyval.a_expr)->tag = (yyvsp[-2].a_tag);
+{
+ yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].tv_str, strlen(yyvsp[0].tv_str), 0);
+ ;
+ break;}
+case 105:
+#line 1084 "asn1p_y.y"
+{
+ yyval.a_wchunk = asn1p_wsyntx_chunk_frombuf(yyvsp[0].a_refcomp.name, strlen(yyvsp[0].a_refcomp.name), 0);
+ yyval.a_wchunk->type = WC_FIELD;
+ ;
+ break;}
+case 106:
+#line 1088 "asn1p_y.y"
+{
+ yyval.a_wchunk = asn1p_wsyntx_chunk_fromsyntax(yyvsp[-1].a_wsynt);
+ ;
+ break;}
+case 107:
+#line 1094 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = strdup("...");
+ checkmem(yyval.a_expr->Identifier);
+ yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 108:
+#line 1102 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = strdup("...");
+ checkmem(yyval.a_expr->Identifier);
+ yyval.a_expr->value = yyvsp[0].a_value;
+ yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 109:
+#line 1111 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = strdup("...");
+ yyval.a_expr->value = yyvsp[0].a_value;
+ checkmem(yyval.a_expr->Identifier);
+ yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 110:
+#line 1123 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ yyval.a_expr->tag = yyvsp[-2].a_tag;
/*
* Outer constraint for SEQUENCE OF and SET OF applies
* to the inner type.
*/
- if((yyval.a_expr)->expr_type == ASN_CONSTR_SEQUENCE_OF
- || (yyval.a_expr)->expr_type == ASN_CONSTR_SET_OF) {
- assert(!TQ_FIRST(&((yyval.a_expr)->members))->constraints);
- TQ_FIRST(&((yyval.a_expr)->members))->constraints = (yyvsp[0].a_constr);
+ if(yyval.a_expr->expr_type == ASN_CONSTR_SEQUENCE_OF
+ || yyval.a_expr->expr_type == ASN_CONSTR_SET_OF) {
+ assert(!TQ_FIRST(&(yyval.a_expr->members))->constraints);
+ TQ_FIRST(&(yyval.a_expr->members))->constraints = yyvsp[0].a_constr;
} else {
- if((yyval.a_expr)->constraints) {
- assert(!(yyvsp[-1].a_expr));
+ if(yyval.a_expr->constraints) {
+ assert(!yyvsp[-1].a_expr);
} else {
- (yyval.a_expr)->constraints = (yyvsp[0].a_constr);
+ yyval.a_expr->constraints = yyvsp[0].a_constr;
}
}
- }
- break;
-
- case 112:
-#line 1142 "asn1p_y.y"
- {
- (yyval.a_int) = asn1p_as_pointer ? EM_INDIRECT : 0;
+ ;
+ break;}
+case 111:
+#line 1145 "asn1p_y.y"
+{
+ yyval.a_int = asn1p_as_pointer ? EM_INDIRECT : 0;
asn1p_as_pointer = 0;
- }
- break;
-
- case 113:
-#line 1149 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- (yyval.a_expr)->marker.flags |= (yyvsp[-1].a_int);
+ ;
+ break;}
+case 112:
+#line 1152 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ yyval.a_expr->marker.flags |= yyvsp[-1].a_int;
- if(((yyval.a_expr)->marker.flags & EM_INDIRECT)
- && ((yyval.a_expr)->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
+ if((yyval.a_expr->marker.flags & EM_INDIRECT)
+ && (yyval.a_expr->marker.flags & EM_OPTIONAL) != EM_OPTIONAL) {
fprintf(stderr,
"INFO: Directive <ASN1C:RepresentAsPointer> "
"applied to %s at line %d\n",
- ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
- ? ASN_EXPR_TYPE2STR((yyval.a_expr)->expr_type)
+ ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type)
+ ? ASN_EXPR_TYPE2STR(yyval.a_expr->expr_type)
: "member",
- (yyval.a_expr)->_lineno
+ yyval.a_expr->_lineno
);
}
- }
- break;
-
- case 114:
-#line 1168 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[0].a_expr);
- }
- break;
-
- case 115:
+ ;
+ break;}
+case 113:
#line 1171 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- assert((yyval.a_expr)->expr_type == A1TC_INVALID);
- (yyval.a_expr)->expr_type = ASN_CONSTR_CHOICE;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 116:
-#line 1177 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- assert((yyval.a_expr)->expr_type == A1TC_INVALID);
- (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 117:
-#line 1183 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- assert((yyval.a_expr)->expr_type == A1TC_INVALID);
- (yyval.a_expr)->expr_type = ASN_CONSTR_SET;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 118:
-#line 1189 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->constraints = (yyvsp[-4].a_constr);
- (yyval.a_expr)->expr_type = ASN_CONSTR_SEQUENCE_OF;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- (yyvsp[0].a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyvsp[0].a_expr)->tag = (yyvsp[-1].a_tag);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 119:
-#line 1199 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->constraints = (yyvsp[-4].a_constr);
- (yyval.a_expr)->expr_type = ASN_CONSTR_SET_OF;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- (yyvsp[0].a_expr)->Identifier = (yyvsp[-2].tv_str);
- (yyvsp[0].a_expr)->tag = (yyvsp[-1].a_tag);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 120:
-#line 1209 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 121:
-#line 1215 "asn1p_y.y"
- {
- int ret;
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->reference = asn1p_ref_new(yylineno);
- ret = asn1p_ref_add_component((yyval.a_expr)->reference,
- (yyvsp[0].tv_str), RLT_lowercase);
- checkmem(ret == 0);
- (yyval.a_expr)->expr_type = ASN_TYPE_ANY;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 122:
-#line 1229 "asn1p_y.y"
- {
+{
+ yyval.a_expr = yyvsp[0].a_expr;
+ ;
+ break;}
+case 114:
+#line 1174 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ assert(yyval.a_expr->expr_type == A1TC_INVALID);
+ yyval.a_expr->expr_type = ASN_CONSTR_CHOICE;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 115:
+#line 1180 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ assert(yyval.a_expr->expr_type == A1TC_INVALID);
+ yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 116:
+#line 1186 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ assert(yyval.a_expr->expr_type == A1TC_INVALID);
+ yyval.a_expr->expr_type = ASN_CONSTR_SET;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 117:
+#line 1192 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->constraints = yyvsp[-4].a_constr;
+ yyval.a_expr->expr_type = ASN_CONSTR_SEQUENCE_OF;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
+ yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 118:
+#line 1202 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->constraints = yyvsp[-4].a_constr;
+ yyval.a_expr->expr_type = ASN_CONSTR_SET_OF;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ yyvsp[0].a_expr->Identifier = yyvsp[-2].tv_str;
+ yyvsp[0].a_expr->tag = yyvsp[-1].a_tag;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 119:
+#line 1212 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = ASN_TYPE_ANY;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 120:
+#line 1218 "asn1p_y.y"
+{
int ret;
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- assert((yyval.a_expr)->expr_type == 0);
- assert((yyval.a_expr)->meta_type == 0);
- assert((yyval.a_expr)->reference == 0);
- (yyval.a_expr)->reference = asn1p_ref_new(yylineno);
- checkmem((yyval.a_expr)->reference);
- ret = asn1p_ref_add_component((yyval.a_expr)->reference, (yyvsp[-3].tv_str), RLT_UNKNOWN);
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->reference = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component(yyval.a_expr->reference,
+ yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
- free((yyvsp[-3].tv_str));
- (yyval.a_expr)->expr_type = A1TC_PARAMETRIZED;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 123:
-#line 1253 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->reference = (yyvsp[0].a_ref);
- (yyval.a_expr)->expr_type = A1TC_REFERENCE;
- (yyval.a_expr)->meta_type = AMT_TYPEREF;
- }
- break;
-
- case 124:
-#line 1260 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->reference = (yyvsp[0].a_ref);
- (yyval.a_expr)->expr_type = A1TC_INSTANCE;
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 125:
-#line 1275 "asn1p_y.y"
- {
+ yyval.a_expr->expr_type = ASN_TYPE_ANY;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 121:
+#line 1239 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->reference = yyvsp[0].a_ref;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ yyval.a_expr->meta_type = AMT_TYPEREF;
+ ;
+ break;}
+case 122:
+#line 1249 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->reference = yyvsp[-3].a_ref;
+ yyval.a_expr->rhs_pspecs = yyvsp[-1].a_expr;
+ yyval.a_expr->expr_type = A1TC_REFERENCE;
+ yyval.a_expr->meta_type = AMT_TYPEREF;
+ ;
+ break;}
+case 123:
+#line 1257 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->reference = yyvsp[0].a_ref;
+ yyval.a_expr->expr_type = A1TC_INSTANCE;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 124:
+#line 1272 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- checkmem((yyval.a_ref));
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_UNKNOWN);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ checkmem(yyval.a_ref);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 126:
-#line 1283 "asn1p_y.y"
- {
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 125:
+#line 1280 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- checkmem((yyval.a_ref));
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_UNKNOWN);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ checkmem(yyval.a_ref);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_UNKNOWN);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- free((yyvsp[-2].tv_str));
- }
- break;
-
- case 127:
-#line 1293 "asn1p_y.y"
- {
+ free(yyvsp[-2].tv_str);
+ ;
+ break;}
+case 126:
+#line 1290 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- checkmem((yyval.a_ref));
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_UNKNOWN);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ checkmem(yyval.a_ref);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_UNKNOWN);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- free((yyvsp[-2].tv_str));
- }
- break;
-
- case 128:
-#line 1303 "asn1p_y.y"
- {
+ free(yyvsp[-2].tv_str);
+ ;
+ break;}
+case 127:
+#line 1300 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- checkmem((yyval.a_ref));
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_UNKNOWN);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ checkmem(yyval.a_ref);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_lowercase);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
- free((yyvsp[-2].tv_str));
- }
- break;
-
- case 129:
-#line 1313 "asn1p_y.y"
- {
+ free(yyvsp[-2].tv_str);
+ ;
+ break;}
+case 128:
+#line 1310 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- checkmem((yyval.a_ref));
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_CAPITALS);
- free((yyvsp[0].tv_str));
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ checkmem(yyval.a_ref);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
+ free(yyvsp[0].tv_str);
checkmem(ret == 0);
- }
- break;
-
- case 130:
-#line 1321 "asn1p_y.y"
- {
+ ;
+ break;}
+case 129:
+#line 1318 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = (yyvsp[0].a_ref);
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[-2].tv_str), RLT_CAPITALS);
- free((yyvsp[-2].tv_str));
+ yyval.a_ref = yyvsp[0].a_ref;
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[-2].tv_str, RLT_CAPITALS);
+ free(yyvsp[-2].tv_str);
checkmem(ret == 0);
/*
* Move the last element infront.
*/
{
struct asn1p_ref_component_s tmp_comp;
- tmp_comp = (yyval.a_ref)->components[(yyval.a_ref)->comp_count-1];
- memmove(&(yyval.a_ref)->components[1],
- &(yyval.a_ref)->components[0],
- sizeof((yyval.a_ref)->components[0])
- * ((yyval.a_ref)->comp_count - 1));
- (yyval.a_ref)->components[0] = tmp_comp;
+ tmp_comp = yyval.a_ref->components[yyval.a_ref->comp_count-1];
+ memmove(&yyval.a_ref->components[1],
+ &yyval.a_ref->components[0],
+ sizeof(yyval.a_ref->components[0])
+ * (yyval.a_ref->comp_count - 1));
+ yyval.a_ref->components[0] = tmp_comp;
}
- }
- break;
-
- case 131:
-#line 1343 "asn1p_y.y"
- {
+ ;
+ break;}
+case 130:
+#line 1340 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- checkmem((yyval.a_ref));
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].a_refcomp).name, (yyvsp[0].a_refcomp).lex_type);
- free((yyvsp[0].a_refcomp).name);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ checkmem(yyval.a_ref);
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
+ free(yyvsp[0].a_refcomp.name);
checkmem(ret == 0);
- }
- break;
-
- case 132:
-#line 1351 "asn1p_y.y"
- {
+ ;
+ break;}
+case 131:
+#line 1348 "asn1p_y.y"
+{
int ret;
- (yyval.a_ref) = (yyvsp[-2].a_ref);
- ret = asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].a_refcomp).name, (yyvsp[0].a_refcomp).lex_type);
- free((yyvsp[0].a_refcomp).name);
+ yyval.a_ref = yyvsp[-2].a_ref;
+ ret = asn1p_ref_add_component(yyval.a_ref, yyvsp[0].a_refcomp.name, yyvsp[0].a_refcomp.lex_type);
+ free(yyvsp[0].a_refcomp.name);
checkmem(ret == 0);
- }
- break;
-
- case 134:
-#line 1364 "asn1p_y.y"
- {
- (yyval.a_refcomp).lex_type = RLT_AmpUppercase;
- (yyval.a_refcomp).name = (yyvsp[0].tv_str);
- }
- break;
-
- case 135:
-#line 1369 "asn1p_y.y"
- {
- (yyval.a_refcomp).lex_type = RLT_Amplowercase;
- (yyval.a_refcomp).name = (yyvsp[0].tv_str);
- }
- break;
-
- case 136:
-#line 1378 "asn1p_y.y"
- {
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_AmpUppercase);
- }
- break;
-
- case 137:
-#line 1382 "asn1p_y.y"
- {
- (yyval.a_ref) = (yyval.a_ref);
- asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_AmpUppercase);
- }
- break;
-
- case 138:
-#line 1386 "asn1p_y.y"
- {
- (yyval.a_ref) = (yyval.a_ref);
- asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_Amplowercase);
- }
- break;
-
- case 139:
-#line 1393 "asn1p_y.y"
- {
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- asn1p_ref_add_component((yyval.a_ref), (yyvsp[0].tv_str), RLT_CAPITALS);
- }
- break;
-
- case 140:
-#line 1413 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- assert((yyval.a_expr)->Identifier == NULL);
- (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
- (yyval.a_expr)->meta_type = AMT_VALUE;
- (yyval.a_expr)->value = (yyvsp[0].a_value);
- }
- break;
-
- case 141:
-#line 1423 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint(0);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_CHOICE_IDENTIFIER;
- (yyval.a_value)->value.choice_identifier.identifier = (yyvsp[-2].tv_str);
- (yyval.a_value)->value.choice_identifier.value = (yyvsp[0].a_value);
- }
- break;
-
- case 142:
-#line 1430 "asn1p_y.y"
- { asn1p_lexer_hack_push_opaque_state(); }
- break;
-
- case 143:
-#line 1430 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_UNPARSED;
- }
- break;
-
- case 144:
-#line 1435 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint(0);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_NULL;
- }
- break;
-
- case 145:
-#line 1440 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint(0);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_FALSE;
- }
- break;
-
- case 146:
-#line 1445 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint(0);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_TRUE;
- }
- break;
-
- case 147:
-#line 1450 "asn1p_y.y"
- {
- (yyval.a_value) = _convert_bitstring2binary((yyvsp[0].tv_str), 'B');
- checkmem((yyval.a_value));
- }
- break;
-
- case 148:
-#line 1454 "asn1p_y.y"
- {
- (yyval.a_value) = _convert_bitstring2binary((yyvsp[0].tv_str), 'H');
- checkmem((yyval.a_value));
- }
- break;
-
- case 149:
+ ;
+ break;}
+case 133:
+#line 1361 "asn1p_y.y"
+{
+ yyval.a_refcomp.lex_type = RLT_AmpUppercase;
+ yyval.a_refcomp.name = yyvsp[0].tv_str;
+ ;
+ break;}
+case 134:
+#line 1366 "asn1p_y.y"
+{
+ yyval.a_refcomp.lex_type = RLT_Amplowercase;
+ yyval.a_refcomp.name = yyvsp[0].tv_str;
+ ;
+ break;}
+case 135:
+#line 1375 "asn1p_y.y"
+{
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase);
+ ;
+ break;}
+case 136:
+#line 1379 "asn1p_y.y"
+{
+ yyval.a_ref = yyval.a_ref;
+ asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_AmpUppercase);
+ ;
+ break;}
+case 137:
+#line 1383 "asn1p_y.y"
+{
+ yyval.a_ref = yyval.a_ref;
+ asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_Amplowercase);
+ ;
+ break;}
+case 138:
+#line 1390 "asn1p_y.y"
+{
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ asn1p_ref_add_component(yyval.a_ref, yyvsp[0].tv_str, RLT_CAPITALS);
+ ;
+ break;}
+case 139:
+#line 1410 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ assert(yyval.a_expr->Identifier == NULL);
+ yyval.a_expr->Identifier = yyvsp[-3].tv_str;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ yyval.a_expr->value = yyvsp[0].a_value;
+ ;
+ break;}
+case 140:
+#line 1420 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(0);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_CHOICE_IDENTIFIER;
+ yyval.a_value->value.choice_identifier.identifier = yyvsp[-2].tv_str;
+ yyval.a_value->value.choice_identifier.value = yyvsp[0].a_value;
+ ;
+ break;}
+case 141:
+#line 1427 "asn1p_y.y"
+{ asn1p_lexer_hack_push_opaque_state(); ;
+ break;}
+case 142:
+#line 1427 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_UNPARSED;
+ ;
+ break;}
+case 143:
+#line 1432 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(0);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_NULL;
+ ;
+ break;}
+case 144:
+#line 1437 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(0);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_FALSE;
+ ;
+ break;}
+case 145:
+#line 1442 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(0);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_TRUE;
+ ;
+ break;}
+case 146:
+#line 1447 "asn1p_y.y"
+{
+ yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'B');
+ checkmem(yyval.a_value);
+ ;
+ break;}
+case 147:
+#line 1451 "asn1p_y.y"
+{
+ yyval.a_value = _convert_bitstring2binary(yyvsp[0].tv_str, 'H');
+ checkmem(yyval.a_value);
+ ;
+ break;}
+case 148:
+#line 1455 "asn1p_y.y"
+{
+ yyval.a_value = yyval.a_value;
+ ;
+ break;}
+case 149:
#line 1458 "asn1p_y.y"
- {
- (yyval.a_value) = (yyval.a_value);
- }
- break;
-
- case 150:
+{
+ yyval.a_value = yyvsp[0].a_value;
+ ;
+ break;}
+case 150:
#line 1461 "asn1p_y.y"
- {
- (yyval.a_value) = (yyvsp[0].a_value);
- }
- break;
-
- case 151:
-#line 1464 "asn1p_y.y"
- {
- (yyval.a_value) = (yyvsp[0].a_value);
- }
- break;
-
- case 152:
-#line 1470 "asn1p_y.y"
- {
+{
+ yyval.a_value = yyvsp[0].a_value;
+ ;
+ break;}
+case 151:
+#line 1467 "asn1p_y.y"
+{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
- ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_lowercase);
+ ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
- (yyval.a_value) = asn1p_value_fromref(ref, 0);
- checkmem((yyval.a_value));
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 153:
-#line 1481 "asn1p_y.y"
- {
+ yyval.a_value = asn1p_value_fromref(ref, 0);
+ checkmem(yyval.a_value);
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 152:
+#line 1478 "asn1p_y.y"
+{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
- ret = asn1p_ref_add_component(ref, (yyvsp[-2].tv_str), RLT_UNKNOWN);
+ ret = asn1p_ref_add_component(ref, yyvsp[-2].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_lowercase);
+ ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
- (yyval.a_value) = asn1p_value_fromref(ref, 0);
- checkmem((yyval.a_value));
- free((yyvsp[-2].tv_str));
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 154:
-#line 1499 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
- checkmem((yyval.a_value));
- }
- break;
-
- case 155:
-#line 1503 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_TUPLE;
- }
- break;
-
- case 156:
-#line 1508 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_QUADRUPLE;
- }
- break;
-
- case 157:
-#line 1542 "asn1p_y.y"
- {
- (yyval.tv_opaque).len = (yyvsp[0].tv_opaque).len + 1;
- (yyval.tv_opaque).buf = malloc((yyval.tv_opaque).len + 1);
- checkmem((yyval.tv_opaque).buf);
- (yyval.tv_opaque).buf[0] = '{';
- memcpy((yyval.tv_opaque).buf + 1, (yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len);
- (yyval.tv_opaque).buf[(yyval.tv_opaque).len] = '\0';
- free((yyvsp[0].tv_opaque).buf);
- }
- break;
-
- case 158:
-#line 1551 "asn1p_y.y"
- {
- int newsize = (yyvsp[-1].tv_opaque).len + (yyvsp[0].tv_opaque).len;
+ yyval.a_value = asn1p_value_fromref(ref, 0);
+ checkmem(yyval.a_value);
+ free(yyvsp[-2].tv_str);
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 153:
+#line 1496 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
+ checkmem(yyval.a_value);
+ ;
+ break;}
+case 154:
+#line 1500 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_TUPLE;
+ ;
+ break;}
+case 155:
+#line 1505 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_QUADRUPLE;
+ ;
+ break;}
+case 156:
+#line 1539 "asn1p_y.y"
+{
+ yyval.tv_opaque.len = yyvsp[0].tv_opaque.len + 1;
+ yyval.tv_opaque.buf = malloc(yyval.tv_opaque.len + 1);
+ checkmem(yyval.tv_opaque.buf);
+ yyval.tv_opaque.buf[0] = '{';
+ memcpy(yyval.tv_opaque.buf + 1, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
+ yyval.tv_opaque.buf[yyval.tv_opaque.len] = '\0';
+ free(yyvsp[0].tv_opaque.buf);
+ ;
+ break;}
+case 157:
+#line 1548 "asn1p_y.y"
+{
+ int newsize = yyvsp[-1].tv_opaque.len + yyvsp[0].tv_opaque.len;
char *p = malloc(newsize + 1);
checkmem(p);
- memcpy(p , (yyvsp[-1].tv_opaque).buf, (yyvsp[-1].tv_opaque).len);
- memcpy(p + (yyvsp[-1].tv_opaque).len, (yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len);
+ memcpy(p , yyvsp[-1].tv_opaque.buf, yyvsp[-1].tv_opaque.len);
+ memcpy(p + yyvsp[-1].tv_opaque.len, yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len);
p[newsize] = '\0';
- free((yyvsp[-1].tv_opaque).buf);
- free((yyvsp[0].tv_opaque).buf);
- (yyval.tv_opaque).buf = p;
- (yyval.tv_opaque).len = newsize;
- }
- break;
-
- case 159:
+ free(yyvsp[-1].tv_opaque.buf);
+ free(yyvsp[0].tv_opaque.buf);
+ yyval.tv_opaque.buf = p;
+ yyval.tv_opaque.len = newsize;
+ ;
+ break;}
+case 158:
+#line 1563 "asn1p_y.y"
+{ yyval.a_type = ASN_BASIC_BOOLEAN; ;
+ break;}
+case 159:
+#line 1564 "asn1p_y.y"
+{ yyval.a_type = ASN_BASIC_NULL; ;
+ break;}
+case 160:
+#line 1565 "asn1p_y.y"
+{ yyval.a_type = ASN_BASIC_REAL; ;
+ break;}
+case 161:
#line 1566 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_BOOLEAN; }
- break;
-
- case 160:
+{ yyval.a_type = yyvsp[0].a_type; ;
+ break;}
+case 162:
#line 1567 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_NULL; }
- break;
-
- case 161:
+{ yyval.a_type = ASN_BASIC_OCTET_STRING; ;
+ break;}
+case 163:
#line 1568 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_REAL; }
- break;
-
- case 162:
+{ yyval.a_type = ASN_BASIC_OBJECT_IDENTIFIER; ;
+ break;}
+case 164:
#line 1569 "asn1p_y.y"
- { (yyval.a_type) = (yyvsp[0].a_type); }
- break;
-
- case 163:
+{ yyval.a_type = ASN_BASIC_RELATIVE_OID; ;
+ break;}
+case 165:
#line 1570 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_OCTET_STRING; }
- break;
-
- case 164:
+{ yyval.a_type = ASN_BASIC_EXTERNAL; ;
+ break;}
+case 166:
#line 1571 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_OBJECT_IDENTIFIER; }
- break;
-
- case 165:
+{ yyval.a_type = ASN_BASIC_EMBEDDED_PDV; ;
+ break;}
+case 167:
#line 1572 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_RELATIVE_OID; }
- break;
-
- case 166:
+{ yyval.a_type = ASN_BASIC_CHARACTER_STRING; ;
+ break;}
+case 168:
#line 1573 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_EXTERNAL; }
- break;
-
- case 167:
+{ yyval.a_type = ASN_BASIC_UTCTime; ;
+ break;}
+case 169:
#line 1574 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_EMBEDDED_PDV; }
- break;
-
- case 168:
+{ yyval.a_type = ASN_BASIC_GeneralizedTime; ;
+ break;}
+case 170:
#line 1575 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_CHARACTER_STRING; }
- break;
-
- case 169:
-#line 1576 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_UTCTime; }
- break;
-
- case 170:
-#line 1577 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_GeneralizedTime; }
- break;
-
- case 171:
-#line 1578 "asn1p_y.y"
- { (yyval.a_type) = (yyvsp[0].a_type); }
- break;
-
- case 172:
-#line 1585 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_INTEGER; }
- break;
-
- case 173:
-#line 1586 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_ENUMERATED; }
- break;
-
- case 174:
-#line 1587 "asn1p_y.y"
- { (yyval.a_type) = ASN_BASIC_BIT_STRING; }
- break;
-
- case 175:
-#line 1591 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = (yyvsp[0].a_type);
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 176:
-#line 1597 "asn1p_y.y"
- {
- if((yyvsp[0].a_expr)) {
- (yyval.a_expr) = (yyvsp[0].a_expr);
+{ yyval.a_type = yyvsp[0].a_type; ;
+ break;}
+case 171:
+#line 1582 "asn1p_y.y"
+{ yyval.a_type = ASN_BASIC_INTEGER; ;
+ break;}
+case 172:
+#line 1583 "asn1p_y.y"
+{ yyval.a_type = ASN_BASIC_ENUMERATED; ;
+ break;}
+case 173:
+#line 1584 "asn1p_y.y"
+{ yyval.a_type = ASN_BASIC_BIT_STRING; ;
+ break;}
+case 174:
+#line 1588 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = yyvsp[0].a_type;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 175:
+#line 1594 "asn1p_y.y"
+{
+ if(yyvsp[0].a_expr) {
+ yyval.a_expr = yyvsp[0].a_expr;
} else {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
}
- (yyval.a_expr)->expr_type = (yyvsp[-1].a_type);
- (yyval.a_expr)->meta_type = AMT_TYPE;
- }
- break;
-
- case 177:
-#line 1610 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_BMPString; }
- break;
-
- case 178:
-#line 1611 "asn1p_y.y"
- {
- (yyval.a_type) = ASN_STRING_GeneralString;
+ yyval.a_expr->expr_type = yyvsp[-1].a_type;
+ yyval.a_expr->meta_type = AMT_TYPE;
+ ;
+ break;}
+case 176:
+#line 1607 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_BMPString; ;
+ break;}
+case 177:
+#line 1608 "asn1p_y.y"
+{
+ yyval.a_type = ASN_STRING_GeneralString;
fprintf(stderr, "WARNING: GeneralString is not fully supported\n");
- }
- break;
-
- case 179:
-#line 1615 "asn1p_y.y"
- {
- (yyval.a_type) = ASN_STRING_GraphicString;
+ ;
+ break;}
+case 178:
+#line 1612 "asn1p_y.y"
+{
+ yyval.a_type = ASN_STRING_GraphicString;
fprintf(stderr, "WARNING: GraphicString is not fully supported\n");
- }
- break;
-
- case 180:
+ ;
+ break;}
+case 179:
+#line 1616 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_IA5String; ;
+ break;}
+case 180:
+#line 1617 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_ISO646String; ;
+ break;}
+case 181:
+#line 1618 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_NumericString; ;
+ break;}
+case 182:
#line 1619 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_IA5String; }
- break;
-
- case 181:
+{ yyval.a_type = ASN_STRING_PrintableString; ;
+ break;}
+case 183:
#line 1620 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_ISO646String; }
- break;
-
- case 182:
-#line 1621 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_NumericString; }
- break;
-
- case 183:
-#line 1622 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_PrintableString; }
- break;
-
- case 184:
-#line 1623 "asn1p_y.y"
- {
- (yyval.a_type) = ASN_STRING_T61String;
+{
+ yyval.a_type = ASN_STRING_T61String;
fprintf(stderr, "WARNING: T61String is not fully supported\n");
- }
- break;
-
- case 185:
+ ;
+ break;}
+case 184:
+#line 1624 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_TeletexString; ;
+ break;}
+case 185:
+#line 1625 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_UniversalString; ;
+ break;}
+case 186:
+#line 1626 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_UTF8String; ;
+ break;}
+case 187:
#line 1627 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_TeletexString; }
- break;
-
- case 186:
-#line 1628 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_UniversalString; }
- break;
-
- case 187:
-#line 1629 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_UTF8String; }
- break;
-
- case 188:
-#line 1630 "asn1p_y.y"
- {
- (yyval.a_type) = ASN_STRING_VideotexString;
+{
+ yyval.a_type = ASN_STRING_VideotexString;
fprintf(stderr, "WARNING: VideotexString is not fully supported\n");
- }
- break;
-
- case 189:
-#line 1634 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_VisibleString; }
- break;
-
- case 190:
-#line 1635 "asn1p_y.y"
- { (yyval.a_type) = ASN_STRING_ObjectDescriptor; }
- break;
-
- case 196:
-#line 1647 "asn1p_y.y"
- { (yyval.a_constr) = 0; }
- break;
-
- case 197:
-#line 1648 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 198:
+ ;
+ break;}
+case 188:
+#line 1631 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_VisibleString; ;
+ break;}
+case 189:
+#line 1632 "asn1p_y.y"
+{ yyval.a_type = ASN_STRING_ObjectDescriptor; ;
+ break;}
+case 195:
+#line 1644 "asn1p_y.y"
+{ yyval.a_constr = 0; ;
+ break;}
+case 196:
+#line 1645 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 197:
+#line 1651 "asn1p_y.y"
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[0].a_constr, 0);
+ ;
+ break;}
+case 198:
#line 1654 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[0].a_constr), 0);
- }
- break;
-
- case 199:
-#line 1657 "asn1p_y.y"
- {
+{
/*
* This is a special case, for compatibility purposes.
* It goes without parentheses.
*/
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_SIZE, (yyvsp[-1].a_constr), 0);
- }
- break;
-
- case 200:
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_SIZE, yyvsp[-1].a_constr, 0);
+ ;
+ break;}
+case 199:
+#line 1664 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[-1].a_constr;
+ ;
+ break;}
+case 200:
#line 1667 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[-1].a_constr);
- }
- break;
-
- case 201:
-#line 1670 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_SET, (yyvsp[-3].a_constr), (yyvsp[-1].a_constr));
- }
- break;
-
- case 202:
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_SET, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
+ ;
+ break;}
+case 201:
+#line 1673 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 202:
#line 1676 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 203:
-#line 1679 "asn1p_y.y"
- {
+{
asn1p_constraint_t *ct;
ct = asn1p_constraint_new(yylineno);
ct->type = ACT_EL_EXT;
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[-2].a_constr), ct);
- }
- break;
-
- case 204:
-#line 1685 "asn1p_y.y"
- {
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
+ ;
+ break;}
+case 203:
+#line 1682 "asn1p_y.y"
+{
asn1p_constraint_t *ct;
ct = asn1p_constraint_new(yylineno);
ct->type = ACT_EL_EXT;
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[-4].a_constr), ct);
- ct = (yyval.a_constr);
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, ct, (yyvsp[0].a_constr));
- }
- break;
-
- case 205:
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-4].a_constr, ct);
+ ct = yyval.a_constr;
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, ct, yyvsp[0].a_constr);
+ ;
+ break;}
+case 204:
+#line 1693 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 205:
#line 1696 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 206:
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_AEX, yyvsp[0].a_constr, 0);
+ ;
+ break;}
+case 206:
#line 1699 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_AEX, (yyvsp[0].a_constr), 0);
- }
- break;
-
- case 207:
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_UNI, yyvsp[-2].a_constr, yyvsp[0].a_constr);
+ ;
+ break;}
+case 207:
#line 1702 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_UNI, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
- }
- break;
-
- case 208:
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_INT, yyvsp[-2].a_constr, yyvsp[0].a_constr);
+ ;
+ break;}
+case 208:
#line 1705 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_INT, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
- }
- break;
-
- case 209:
-#line 1708 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_EXC, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
- }
- break;
-
- case 210:
-#line 1714 "asn1p_y.y"
- {
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_EXC, yyvsp[-2].a_constr, yyvsp[0].a_constr);
+ ;
+ break;}
+case 209:
+#line 1711 "asn1p_y.y"
+{
int ret;
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = (yyvsp[-3].a_ctype);
- ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[-1].a_constr));
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = yyvsp[-3].a_ctype;
+ ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
checkmem(ret == 0);
- }
- break;
-
- case 211:
-#line 1722 "asn1p_y.y"
- {
+ ;
+ break;}
+case 210:
+#line 1719 "asn1p_y.y"
+{
int ret;
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_CA_SET;
- ret = asn1p_constraint_insert((yyval.a_constr), (yyvsp[-1].a_constr));
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_CA_SET;
+ ret = asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
checkmem(ret == 0);
- }
- break;
-
- case 212:
-#line 1730 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_EL_VALUE;
- (yyval.a_constr)->value = (yyvsp[0].a_value);
- }
- break;
-
- case 213:
-#line 1736 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_EL_TYPE;
- (yyval.a_constr)->containedSubtype = (yyvsp[0].a_value);
- }
- break;
-
- case 214:
-#line 1742 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
- (yyval.a_constr)->range_start = (yyvsp[-2].a_value);
- (yyval.a_constr)->range_stop = (yyvsp[0].a_value);
- }
- break;
-
- case 215:
-#line 1749 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
- (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
- (yyval.a_constr)->range_stop = (yyvsp[0].a_value);
- (yyval.a_constr)->range_start->type = ATV_MIN;
- }
- break;
-
- case 216:
-#line 1757 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
- (yyval.a_constr)->range_start = (yyvsp[-2].a_value);
- (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
- (yyval.a_constr)->range_stop->type = ATV_MAX;
- }
- break;
-
- case 217:
-#line 1765 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = (yyvsp[-1].a_ctype);
- (yyval.a_constr)->range_start = asn1p_value_fromint(-123);
- (yyval.a_constr)->range_stop = asn1p_value_fromint(321);
- (yyval.a_constr)->range_start->type = ATV_MIN;
- (yyval.a_constr)->range_stop->type = ATV_MAX;
- }
- break;
-
- case 218:
+ ;
+ break;}
+case 211:
+#line 1727 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_EL_VALUE;
+ yyval.a_constr->value = yyvsp[0].a_value;
+ ;
+ break;}
+case 212:
+#line 1733 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_EL_TYPE;
+ yyval.a_constr->containedSubtype = yyvsp[0].a_value;
+ ;
+ break;}
+case 213:
+#line 1739 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = yyvsp[-1].a_ctype;
+ yyval.a_constr->range_start = yyvsp[-2].a_value;
+ yyval.a_constr->range_stop = yyvsp[0].a_value;
+ ;
+ break;}
+case 214:
+#line 1746 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = yyvsp[-1].a_ctype;
+ yyval.a_constr->range_start = asn1p_value_fromint(-123);
+ yyval.a_constr->range_stop = yyvsp[0].a_value;
+ yyval.a_constr->range_start->type = ATV_MIN;
+ ;
+ break;}
+case 215:
+#line 1754 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = yyvsp[-1].a_ctype;
+ yyval.a_constr->range_start = yyvsp[-2].a_value;
+ yyval.a_constr->range_stop = asn1p_value_fromint(321);
+ yyval.a_constr->range_stop->type = ATV_MAX;
+ ;
+ break;}
+case 216:
+#line 1762 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = yyvsp[-1].a_ctype;
+ yyval.a_constr->range_start = asn1p_value_fromint(-123);
+ yyval.a_constr->range_stop = asn1p_value_fromint(321);
+ yyval.a_constr->range_start->type = ATV_MIN;
+ yyval.a_constr->range_stop->type = ATV_MAX;
+ ;
+ break;}
+case 217:
+#line 1771 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 218:
#line 1774 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 219:
-#line 1777 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 220:
-#line 1781 "asn1p_y.y"
- { asn1p_lexer_hack_push_opaque_state(); }
- break;
-
- case 221:
-#line 1781 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_CT_CTDBY;
- (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[0].tv_opaque).buf, (yyvsp[0].tv_opaque).len, 0);
- checkmem((yyval.a_constr)->value);
- (yyval.a_constr)->value->type = ATV_UNPARSED;
- }
- break;
-
- case 222:
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 219:
+#line 1778 "asn1p_y.y"
+{ asn1p_lexer_hack_push_opaque_state(); ;
+ break;}
+case 220:
+#line 1778 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_CT_CTDBY;
+ yyval.a_constr->value = asn1p_value_frombuf(yyvsp[0].tv_opaque.buf, yyvsp[0].tv_opaque.len, 0);
+ checkmem(yyval.a_constr->value);
+ yyval.a_constr->value->type = ATV_UNPARSED;
+ ;
+ break;}
+case 221:
+#line 1789 "asn1p_y.y"
+{ yyval.a_ctype = ACT_EL_RANGE; ;
+ break;}
+case 222:
+#line 1790 "asn1p_y.y"
+{ yyval.a_ctype = ACT_EL_RLRANGE; ;
+ break;}
+case 223:
+#line 1791 "asn1p_y.y"
+{ yyval.a_ctype = ACT_EL_LLRANGE; ;
+ break;}
+case 224:
#line 1792 "asn1p_y.y"
- { (yyval.a_ctype) = ACT_EL_RANGE; }
- break;
-
- case 223:
-#line 1793 "asn1p_y.y"
- { (yyval.a_ctype) = ACT_EL_RLRANGE; }
- break;
-
- case 224:
-#line 1794 "asn1p_y.y"
- { (yyval.a_ctype) = ACT_EL_LLRANGE; }
- break;
-
- case 225:
-#line 1795 "asn1p_y.y"
- { (yyval.a_ctype) = ACT_EL_ULRANGE; }
- break;
-
- case 226:
+{ yyval.a_ctype = ACT_EL_ULRANGE; ;
+ break;}
+case 225:
+#line 1796 "asn1p_y.y"
+{
+ yyval.a_ctype = ACT_CT_SIZE;
+ ;
+ break;}
+case 226:
#line 1799 "asn1p_y.y"
- {
- (yyval.a_ctype) = ACT_CT_SIZE;
- }
- break;
-
- case 227:
-#line 1802 "asn1p_y.y"
- {
- (yyval.a_ctype) = ACT_CT_FROM;
- }
- break;
-
- case 228:
-#line 1808 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint(0);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_FALSE;
- }
- break;
-
- case 229:
-#line 1813 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint(1);
- checkmem((yyval.a_value));
- (yyval.a_value)->type = ATV_TRUE;
- }
- break;
-
- case 230:
+{
+ yyval.a_ctype = ACT_CT_FROM;
+ ;
+ break;}
+case 227:
+#line 1805 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(0);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_FALSE;
+ ;
+ break;}
+case 228:
+#line 1810 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(1);
+ checkmem(yyval.a_value);
+ yyval.a_value->type = ATV_TRUE;
+ ;
+ break;}
+case 229:
+#line 1815 "asn1p_y.y"
+{
+ yyval.a_value = yyvsp[0].a_value;
+ ;
+ break;}
+case 230:
#line 1818 "asn1p_y.y"
- {
- (yyval.a_value) = (yyvsp[0].a_value);
- }
- break;
-
- case 231:
+{
+ yyval.a_value = yyvsp[0].a_value;
+ ;
+ break;}
+case 231:
#line 1821 "asn1p_y.y"
- {
- (yyval.a_value) = (yyvsp[0].a_value);
- }
- break;
-
- case 232:
-#line 1824 "asn1p_y.y"
- {
+{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
- ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_lowercase);
+ ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_lowercase);
checkmem(ret == 0);
- (yyval.a_value) = asn1p_value_fromref(ref, 0);
- checkmem((yyval.a_value));
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 233:
-#line 1838 "asn1p_y.y"
- {
+ yyval.a_value = asn1p_value_fromref(ref, 0);
+ checkmem(yyval.a_value);
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 232:
+#line 1835 "asn1p_y.y"
+{
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno);
checkmem(ref);
- ret = asn1p_ref_add_component(ref, (yyvsp[0].tv_str), RLT_UNKNOWN);
+ ret = asn1p_ref_add_component(ref, yyvsp[0].tv_str, RLT_UNKNOWN);
checkmem(ret == 0);
- (yyval.a_value) = asn1p_value_fromref(ref, 0);
- checkmem((yyval.a_value));
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 234:
+ yyval.a_value = asn1p_value_fromref(ref, 0);
+ checkmem(yyval.a_value);
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 233:
+#line 1849 "asn1p_y.y"
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMP, yyvsp[0].a_constr, 0);
+ ;
+ break;}
+case 234:
#line 1852 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMP, (yyvsp[0].a_constr), 0);
- }
- break;
-
- case 235:
-#line 1855 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[-1].a_constr), 0);
- }
- break;
-
- case 236:
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-1].a_constr, 0);
+ ;
+ break;}
+case 235:
+#line 1858 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 236:
#line 1861 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 237:
-#line 1864 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CT_WCOMPS, (yyvsp[-2].a_constr), (yyvsp[0].a_constr));
- }
- break;
-
- case 238:
-#line 1870 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_EL_EXT;
- (yyval.a_constr)->value = asn1p_value_frombuf("...", 3, 0);
- }
- break;
-
- case 239:
-#line 1876 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_EL_VALUE;
- (yyval.a_constr)->value = asn1p_value_frombuf((yyvsp[-2].tv_str), strlen((yyvsp[-2].tv_str)), 0);
- (yyval.a_constr)->presence = (yyvsp[0].a_pres);
- if((yyvsp[-1].a_constr)) asn1p_constraint_insert((yyval.a_constr), (yyvsp[-1].a_constr));
- }
- break;
-
- case 240:
-#line 1890 "asn1p_y.y"
- { (yyval.a_pres) = ACPRES_DEFAULT; }
- break;
-
- case 241:
-#line 1891 "asn1p_y.y"
- { (yyval.a_pres) = (yyvsp[0].a_pres); }
- break;
-
- case 242:
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CT_WCOMPS, yyvsp[-2].a_constr, yyvsp[0].a_constr);
+ ;
+ break;}
+case 237:
+#line 1867 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_EL_EXT;
+ yyval.a_constr->value = asn1p_value_frombuf("...", 3, 0);
+ ;
+ break;}
+case 238:
+#line 1873 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_EL_VALUE;
+ yyval.a_constr->value = asn1p_value_frombuf(yyvsp[-2].tv_str, strlen(yyvsp[-2].tv_str), 0);
+ yyval.a_constr->presence = yyvsp[0].a_pres;
+ if(yyvsp[-1].a_constr) asn1p_constraint_insert(yyval.a_constr, yyvsp[-1].a_constr);
+ ;
+ break;}
+case 239:
+#line 1887 "asn1p_y.y"
+{ yyval.a_pres = ACPRES_DEFAULT; ;
+ break;}
+case 240:
+#line 1888 "asn1p_y.y"
+{ yyval.a_pres = yyvsp[0].a_pres; ;
+ break;}
+case 241:
+#line 1892 "asn1p_y.y"
+{
+ yyval.a_pres = ACPRES_PRESENT;
+ ;
+ break;}
+case 242:
#line 1895 "asn1p_y.y"
- {
- (yyval.a_pres) = ACPRES_PRESENT;
- }
- break;
-
- case 243:
+{
+ yyval.a_pres = ACPRES_ABSENT;
+ ;
+ break;}
+case 243:
#line 1898 "asn1p_y.y"
- {
- (yyval.a_pres) = ACPRES_ABSENT;
- }
- break;
-
- case 244:
-#line 1901 "asn1p_y.y"
- {
- (yyval.a_pres) = ACPRES_OPTIONAL;
- }
- break;
-
- case 245:
+{
+ yyval.a_pres = ACPRES_OPTIONAL;
+ ;
+ break;}
+case 244:
+#line 1904 "asn1p_y.y"
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 245:
#line 1907 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 246:
-#line 1910 "asn1p_y.y"
- {
- (yyval.a_constr) = (yyvsp[0].a_constr);
- }
- break;
-
- case 247:
-#line 1919 "asn1p_y.y"
- {
+{
+ yyval.a_constr = yyvsp[0].a_constr;
+ ;
+ break;}
+case 246:
+#line 1916 "asn1p_y.y"
+{
asn1p_ref_t *ref = asn1p_ref_new(yylineno);
asn1p_constraint_t *ct;
int ret;
- ret = asn1p_ref_add_component(ref, (yyvsp[-1].tv_str), 0);
+ ret = asn1p_ref_add_component(ref, yyvsp[-1].tv_str, 0);
checkmem(ret == 0);
ct = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
+ checkmem(yyval.a_constr);
ct->type = ACT_EL_VALUE;
ct->value = asn1p_value_fromref(ref, 0);
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, ct, 0);
- }
- break;
-
- case 248:
-#line 1934 "asn1p_y.y"
- {
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CRC, (yyvsp[-3].a_constr), (yyvsp[-1].a_constr));
- }
- break;
-
- case 249:
-#line 1940 "asn1p_y.y"
- {
- (yyval.a_constr) = asn1p_constraint_new(yylineno);
- checkmem((yyval.a_constr));
- (yyval.a_constr)->type = ACT_EL_VALUE;
- (yyval.a_constr)->value = asn1p_value_fromref((yyvsp[0].a_ref), 0);
- }
- break;
-
- case 250:
-#line 1946 "asn1p_y.y"
- {
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, ct, 0);
+ ;
+ break;}
+case 247:
+#line 1931 "asn1p_y.y"
+{
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CRC, yyvsp[-3].a_constr, yyvsp[-1].a_constr);
+ ;
+ break;}
+case 248:
+#line 1937 "asn1p_y.y"
+{
+ yyval.a_constr = asn1p_constraint_new(yylineno);
+ checkmem(yyval.a_constr);
+ yyval.a_constr->type = ACT_EL_VALUE;
+ yyval.a_constr->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
+ ;
+ break;}
+case 249:
+#line 1943 "asn1p_y.y"
+{
asn1p_constraint_t *ct;
ct = asn1p_constraint_new(yylineno);
checkmem(ct);
ct->type = ACT_EL_VALUE;
- ct->value = asn1p_value_fromref((yyvsp[0].a_ref), 0);
- CONSTRAINT_INSERT((yyval.a_constr), ACT_CA_CSV, (yyvsp[-2].a_constr), ct);
- }
- break;
-
- case 251:
-#line 1960 "asn1p_y.y"
- {
- char *p = malloc(strlen((yyvsp[0].tv_str)) + 2);
+ ct->value = asn1p_value_fromref(yyvsp[0].a_ref, 0);
+ CONSTRAINT_INSERT(yyval.a_constr, ACT_CA_CSV, yyvsp[-2].a_constr, ct);
+ ;
+ break;}
+case 250:
+#line 1957 "asn1p_y.y"
+{
+ char *p = malloc(strlen(yyvsp[0].tv_str) + 2);
int ret;
*p = '@';
- strcpy(p + 1, (yyvsp[0].tv_str));
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
+ strcpy(p + 1, yyvsp[0].tv_str);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
checkmem(ret == 0);
free(p);
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 252:
-#line 1971 "asn1p_y.y"
- {
- char *p = malloc(strlen((yyvsp[0].tv_str)) + 3);
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 251:
+#line 1968 "asn1p_y.y"
+{
+ char *p = malloc(strlen(yyvsp[0].tv_str) + 3);
int ret;
p[0] = '@';
p[1] = '.';
- strcpy(p + 2, (yyvsp[0].tv_str));
- (yyval.a_ref) = asn1p_ref_new(yylineno);
- ret = asn1p_ref_add_component((yyval.a_ref), p, 0);
+ strcpy(p + 2, yyvsp[0].tv_str);
+ yyval.a_ref = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component(yyval.a_ref, p, 0);
checkmem(ret == 0);
free(p);
- free((yyvsp[0].tv_str));
- }
- break;
-
- case 253:
+ free(yyvsp[0].tv_str);
+ ;
+ break;}
+case 252:
+#line 1984 "asn1p_y.y"
+{
+ yyval.tv_str = yyvsp[0].tv_str;
+ ;
+ break;}
+case 253:
#line 1987 "asn1p_y.y"
- {
- (yyval.tv_str) = (yyvsp[0].tv_str);
- }
- break;
-
- case 254:
-#line 1990 "asn1p_y.y"
- {
- int l1 = strlen((yyvsp[-2].tv_str));
- int l3 = strlen((yyvsp[0].tv_str));
- (yyval.tv_str) = malloc(l1 + 1 + l3 + 1);
- memcpy((yyval.tv_str), (yyvsp[-2].tv_str), l1);
- (yyval.tv_str)[l1] = '.';
- memcpy((yyval.tv_str) + l1 + 1, (yyvsp[0].tv_str), l3);
- (yyval.tv_str)[l1 + 1 + l3] = '\0';
- }
- break;
-
- case 255:
-#line 2008 "asn1p_y.y"
- {
- (yyval.a_marker).flags = EM_NOMARK;
- (yyval.a_marker).default_value = 0;
- }
- break;
-
- case 256:
-#line 2012 "asn1p_y.y"
- { (yyval.a_marker) = (yyvsp[0].a_marker); }
- break;
-
- case 257:
-#line 2016 "asn1p_y.y"
- {
- (yyval.a_marker).flags = EM_OPTIONAL | EM_INDIRECT;
- (yyval.a_marker).default_value = 0;
- }
- break;
-
- case 258:
-#line 2020 "asn1p_y.y"
- {
- (yyval.a_marker).flags = EM_DEFAULT;
- (yyval.a_marker).default_value = (yyvsp[0].a_value);
- }
- break;
-
- case 259:
-#line 2043 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- }
- break;
-
- case 260:
-#line 2047 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-1].a_expr);
- }
- break;
-
- case 261:
-#line 2053 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 262:
-#line 2058 "asn1p_y.y"
- {
- (yyval.a_expr) = (yyvsp[-2].a_expr);
- asn1p_expr_add((yyval.a_expr), (yyvsp[0].a_expr));
- }
- break;
-
- case 263:
-#line 2065 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
- (yyval.a_expr)->meta_type = AMT_VALUE;
- (yyval.a_expr)->Identifier = (yyvsp[0].tv_str);
- }
- break;
-
- case 264:
-#line 2072 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
- (yyval.a_expr)->meta_type = AMT_VALUE;
- (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
- (yyval.a_expr)->value = (yyvsp[-1].a_value);
- }
- break;
-
- case 265:
-#line 2080 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
- (yyval.a_expr)->meta_type = AMT_VALUE;
- (yyval.a_expr)->Identifier = (yyvsp[-3].tv_str);
- (yyval.a_expr)->value = (yyvsp[-1].a_value);
- }
- break;
-
- case 266:
-#line 2088 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->expr_type = A1TC_UNIVERVAL;
- (yyval.a_expr)->meta_type = AMT_VALUE;
- (yyval.a_expr)->value = (yyvsp[0].a_value);
- }
- break;
-
- case 267:
-#line 2095 "asn1p_y.y"
- {
- (yyval.a_expr) = asn1p_expr_new(yylineno);
- checkmem((yyval.a_expr));
- (yyval.a_expr)->Identifier = strdup("...");
- checkmem((yyval.a_expr)->Identifier);
- (yyval.a_expr)->expr_type = A1TC_EXTENSIBLE;
- (yyval.a_expr)->meta_type = AMT_VALUE;
- }
- break;
-
- case 268:
-#line 2106 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
- checkmem((yyval.a_value));
- }
- break;
-
- case 269:
-#line 2110 "asn1p_y.y"
- {
- (yyval.a_value) = asn1p_value_fromint((yyvsp[0].a_int));
- checkmem((yyval.a_value));
- }
- break;
-
- case 270:
-#line 2141 "asn1p_y.y"
- { memset(&(yyval.a_tag), 0, sizeof((yyval.a_tag))); }
- break;
-
- case 271:
-#line 2142 "asn1p_y.y"
- { (yyval.a_tag) = (yyvsp[0].a_tag); }
- break;
-
- case 272:
-#line 2146 "asn1p_y.y"
- {
- (yyval.a_tag) = (yyvsp[-1].a_tag);
- (yyval.a_tag).tag_mode = (yyvsp[0].a_tag).tag_mode;
- }
- break;
-
- case 273:
-#line 2153 "asn1p_y.y"
- {
- (yyval.a_tag) = (yyvsp[-2].a_tag);
- (yyval.a_tag).tag_value = (yyvsp[-1].a_int);
- }
- break;
-
- case 274:
+{
+ int l1 = strlen(yyvsp[-2].tv_str);
+ int l3 = strlen(yyvsp[0].tv_str);
+ yyval.tv_str = malloc(l1 + 1 + l3 + 1);
+ memcpy(yyval.tv_str, yyvsp[-2].tv_str, l1);
+ yyval.tv_str[l1] = '.';
+ memcpy(yyval.tv_str + l1 + 1, yyvsp[0].tv_str, l3);
+ yyval.tv_str[l1 + 1 + l3] = '\0';
+ ;
+ break;}
+case 254:
+#line 2005 "asn1p_y.y"
+{
+ yyval.a_marker.flags = EM_NOMARK;
+ yyval.a_marker.default_value = 0;
+ ;
+ break;}
+case 255:
+#line 2009 "asn1p_y.y"
+{ yyval.a_marker = yyvsp[0].a_marker; ;
+ break;}
+case 256:
+#line 2013 "asn1p_y.y"
+{
+ yyval.a_marker.flags = EM_OPTIONAL | EM_INDIRECT;
+ yyval.a_marker.default_value = 0;
+ ;
+ break;}
+case 257:
+#line 2017 "asn1p_y.y"
+{
+ yyval.a_marker.flags = EM_DEFAULT;
+ yyval.a_marker.default_value = yyvsp[0].a_value;
+ ;
+ break;}
+case 258:
+#line 2040 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ ;
+ break;}
+case 259:
+#line 2044 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-1].a_expr;
+ ;
+ break;}
+case 260:
+#line 2050 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 261:
+#line 2055 "asn1p_y.y"
+{
+ yyval.a_expr = yyvsp[-2].a_expr;
+ asn1p_expr_add(yyval.a_expr, yyvsp[0].a_expr);
+ ;
+ break;}
+case 262:
+#line 2062 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = A1TC_UNIVERVAL;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ yyval.a_expr->Identifier = yyvsp[0].tv_str;
+ ;
+ break;}
+case 263:
+#line 2069 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = A1TC_UNIVERVAL;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ yyval.a_expr->Identifier = yyvsp[-3].tv_str;
+ yyval.a_expr->value = yyvsp[-1].a_value;
+ ;
+ break;}
+case 264:
+#line 2077 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = A1TC_UNIVERVAL;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ yyval.a_expr->Identifier = yyvsp[-3].tv_str;
+ yyval.a_expr->value = yyvsp[-1].a_value;
+ ;
+ break;}
+case 265:
+#line 2085 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->expr_type = A1TC_UNIVERVAL;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ yyval.a_expr->value = yyvsp[0].a_value;
+ ;
+ break;}
+case 266:
+#line 2092 "asn1p_y.y"
+{
+ yyval.a_expr = asn1p_expr_new(yylineno);
+ checkmem(yyval.a_expr);
+ yyval.a_expr->Identifier = strdup("...");
+ checkmem(yyval.a_expr->Identifier);
+ yyval.a_expr->expr_type = A1TC_EXTENSIBLE;
+ yyval.a_expr->meta_type = AMT_VALUE;
+ ;
+ break;}
+case 267:
+#line 2103 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
+ checkmem(yyval.a_value);
+ ;
+ break;}
+case 268:
+#line 2107 "asn1p_y.y"
+{
+ yyval.a_value = asn1p_value_fromint(yyvsp[0].a_int);
+ checkmem(yyval.a_value);
+ ;
+ break;}
+case 269:
+#line 2138 "asn1p_y.y"
+{ memset(&yyval.a_tag, 0, sizeof(yyval.a_tag)); ;
+ break;}
+case 270:
+#line 2139 "asn1p_y.y"
+{ yyval.a_tag = yyvsp[0].a_tag; ;
+ break;}
+case 271:
+#line 2143 "asn1p_y.y"
+{
+ yyval.a_tag = yyvsp[-1].a_tag;
+ yyval.a_tag.tag_mode = yyvsp[0].a_tag.tag_mode;
+ ;
+ break;}
+case 272:
+#line 2150 "asn1p_y.y"
+{
+ yyval.a_tag = yyvsp[-2].a_tag;
+ yyval.a_tag.tag_value = yyvsp[-1].a_int;
+ ;
+ break;}
+case 273:
+#line 2156 "asn1p_y.y"
+{ yyval.a_tag.tag_class = TC_CONTEXT_SPECIFIC; ;
+ break;}
+case 274:
+#line 2157 "asn1p_y.y"
+{ yyval.a_tag.tag_class = TC_UNIVERSAL; ;
+ break;}
+case 275:
+#line 2158 "asn1p_y.y"
+{ yyval.a_tag.tag_class = TC_APPLICATION; ;
+ break;}
+case 276:
#line 2159 "asn1p_y.y"
- { (yyval.a_tag).tag_class = TC_CONTEXT_SPECIFIC; }
- break;
-
- case 275:
-#line 2160 "asn1p_y.y"
- { (yyval.a_tag).tag_class = TC_UNIVERSAL; }
- break;
-
- case 276:
-#line 2161 "asn1p_y.y"
- { (yyval.a_tag).tag_class = TC_APPLICATION; }
- break;
-
- case 277:
-#line 2162 "asn1p_y.y"
- { (yyval.a_tag).tag_class = TC_PRIVATE; }
- break;
-
- case 278:
-#line 2166 "asn1p_y.y"
- { (yyval.a_tag).tag_mode = TM_DEFAULT; }
- break;
-
- case 279:
-#line 2167 "asn1p_y.y"
- { (yyval.a_tag).tag_mode = TM_IMPLICIT; }
- break;
-
- case 280:
-#line 2168 "asn1p_y.y"
- { (yyval.a_tag).tag_mode = TM_EXPLICIT; }
- break;
-
- case 281:
-#line 2172 "asn1p_y.y"
- {
- checkmem((yyvsp[0].tv_str));
- (yyval.tv_str) = (yyvsp[0].tv_str);
- }
- break;
-
- case 282:
-#line 2176 "asn1p_y.y"
- {
- checkmem((yyvsp[0].tv_str));
- (yyval.tv_str) = (yyvsp[0].tv_str);
- }
- break;
-
- case 283:
-#line 2184 "asn1p_y.y"
- {
- checkmem((yyvsp[0].tv_str));
- (yyval.tv_str) = (yyvsp[0].tv_str);
- }
- break;
-
- case 284:
-#line 2191 "asn1p_y.y"
- { (yyval.tv_str) = 0; }
- break;
-
- case 285:
-#line 2192 "asn1p_y.y"
- {
- (yyval.tv_str) = (yyvsp[0].tv_str);
- }
- break;
-
- case 286:
-#line 2198 "asn1p_y.y"
- {
- checkmem((yyvsp[0].tv_str));
- (yyval.tv_str) = (yyvsp[0].tv_str);
- }
- break;
-
-
- default: break;
- }
-
-/* Line 1126 of yacc.c. */
-#line 4429 "asn1p_y.c"
+{ yyval.a_tag.tag_class = TC_PRIVATE; ;
+ break;}
+case 277:
+#line 2163 "asn1p_y.y"
+{ yyval.a_tag.tag_mode = TM_DEFAULT; ;
+ break;}
+case 278:
+#line 2164 "asn1p_y.y"
+{ yyval.a_tag.tag_mode = TM_IMPLICIT; ;
+ break;}
+case 279:
+#line 2165 "asn1p_y.y"
+{ yyval.a_tag.tag_mode = TM_EXPLICIT; ;
+ break;}
+case 280:
+#line 2169 "asn1p_y.y"
+{
+ checkmem(yyvsp[0].tv_str);
+ yyval.tv_str = yyvsp[0].tv_str;
+ ;
+ break;}
+case 281:
+#line 2173 "asn1p_y.y"
+{
+ checkmem(yyvsp[0].tv_str);
+ yyval.tv_str = yyvsp[0].tv_str;
+ ;
+ break;}
+case 282:
+#line 2181 "asn1p_y.y"
+{
+ checkmem(yyvsp[0].tv_str);
+ yyval.tv_str = yyvsp[0].tv_str;
+ ;
+ break;}
+case 283:
+#line 2188 "asn1p_y.y"
+{ yyval.tv_str = 0; ;
+ break;}
+case 284:
+#line 2189 "asn1p_y.y"
+{
+ yyval.tv_str = yyvsp[0].tv_str;
+ ;
+ break;}
+case 285:
+#line 2195 "asn1p_y.y"
+{
+ checkmem(yyvsp[0].tv_str);
+ yyval.tv_str = yyvsp[0].tv_str;
+ ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 543 "/usr/share/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
-
- YY_STACK_PRINT (yyss, yyssp);
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
*++yyvsp = yyval;
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
+yyerrlab: /* here on detecting error */
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
-yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
{
++yynerrs;
-#if YYERROR_VERBOSE
+
+#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
- if (YYPACT_NINF < yyn && yyn < YYLAST)
+ if (yyn > YYFLAG && yyn < YYLAST)
{
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- char *yymsg = 0;
-# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-#if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-#endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= yysize1 < yysize;
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= yysize1 < yysize;
- yysize = yysize1;
-
- if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg)
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (int)(sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
{
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yymsg;
- int yyi = 0;
- while ((*yyp = *yyf))
+ strcpy(msg, "parse error");
+
+ if (count < 5)
{
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (int)(sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
}
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
+ yyerror(msg);
+ free(msg);
}
else
- {
- yyerror (YY_("syntax error"));
- goto yyexhaustedlab;
- }
+ yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
- yyerror (YY_("syntax error"));
+ yyerror("parse error");
}
-
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
-
- if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
- else
- {
- yydestruct ("Error: discarding", yytoken, &yylval);
- yychar = YYEMPTY;
- }
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
}
- /* Else will try to reuse look-ahead token after shifting the error
- token. */
- goto yyerrlab1;
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+ yyerrstatus = 3; /* Each real token shifted decrements this */
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR. |
-`---------------------------------------------------*/
-yyerrorlab:
+ goto yyerrhandle;
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (0)
- goto yyerrorlab;
+yyerrdefault: /* current state does not do anything special for the error token. */
-yyvsp -= yylen;
- yyssp -= yylen;
- yystate = *yyssp;
- goto yyerrlab1;
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+yyerrpop: /* pop the current state because it cannot handle the error token */
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR. |
-`-------------------------------------------------------------*/
-yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
- for (;;)
+#if YYDEBUG != 0
+ if (yydebug)
{
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
+yyerrhandle:
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
- yydestruct ("Error: popping", yystos[yystate], yyvsp);
- YYPOPSTACK;
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
}
+ else if (yyn == 0)
+ goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
- *++yyvsp = yylval;
-
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
- /* Shift the error token. */
- YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
yystate = yyn;
goto yynewstate;
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here. |
-`-------------------------------------*/
-yyacceptlab:
- yyresult = 0;
- goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here. |
-`-----------------------------------*/
-yyabortlab:
- yyresult = 1;
- goto yyreturn;
-
-#ifndef yyoverflow
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here. |
-`-------------------------------------------------*/
-yyexhaustedlab:
- yyerror (YY_("memory exhausted"));
- yyresult = 2;
- /* Fall through. */
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
#endif
+ }
+ return 0;
-yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- while (yyssp != yyss)
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
{
- yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
- YYPOPSTACK;
- }
-#ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
#endif
- return yyresult;
+ }
+ return 1;
}
-
-
-#line 2204 "asn1p_y.y"
+#line 2201 "asn1p_y.y"
@@ -4843,4 +3924,3 @@ yyerror(const char *msg) {
return -1;
}
-
diff --git a/libasn1parser/asn1p_y.h b/libasn1parser/asn1p_y.h
index ca5410ec..41f312ee 100644
--- a/libasn1parser/asn1p_y.h
+++ b/libasn1parser/asn1p_y.h
@@ -1,248 +1,4 @@
-/* A Bison parser, made by GNU Bison 2.1. */
-
-/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, when this file is copied by Bison into a
- Bison output file, you may use that output file without restriction.
- This special exception was added by the Free Software Foundation
- in version 1.24 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- TOK_PPEQ = 258,
- TOK_whitespace = 259,
- TOK_opaque = 260,
- TOK_bstring = 261,
- TOK_cstring = 262,
- TOK_hstring = 263,
- TOK_identifier = 264,
- TOK_number = 265,
- TOK_tuple = 266,
- TOK_quadruple = 267,
- TOK_number_negative = 268,
- TOK_typereference = 269,
- TOK_capitalreference = 270,
- TOK_typefieldreference = 271,
- TOK_valuefieldreference = 272,
- TOK_Literal = 273,
- TOK_ABSENT = 274,
- TOK_ABSTRACT_SYNTAX = 275,
- TOK_ALL = 276,
- TOK_ANY = 277,
- TOK_APPLICATION = 278,
- TOK_AUTOMATIC = 279,
- TOK_BEGIN = 280,
- TOK_BIT = 281,
- TOK_BMPString = 282,
- TOK_BOOLEAN = 283,
- TOK_BY = 284,
- TOK_CHARACTER = 285,
- TOK_CHOICE = 286,
- TOK_CLASS = 287,
- TOK_COMPONENT = 288,
- TOK_COMPONENTS = 289,
- TOK_CONSTRAINED = 290,
- TOK_CONTAINING = 291,
- TOK_DEFAULT = 292,
- TOK_DEFINITIONS = 293,
- TOK_DEFINED = 294,
- TOK_EMBEDDED = 295,
- TOK_ENCODED = 296,
- TOK_ENCODING_CONTROL = 297,
- TOK_END = 298,
- TOK_ENUMERATED = 299,
- TOK_EXPLICIT = 300,
- TOK_EXPORTS = 301,
- TOK_EXTENSIBILITY = 302,
- TOK_EXTERNAL = 303,
- TOK_FALSE = 304,
- TOK_FROM = 305,
- TOK_GeneralizedTime = 306,
- TOK_GeneralString = 307,
- TOK_GraphicString = 308,
- TOK_IA5String = 309,
- TOK_IDENTIFIER = 310,
- TOK_IMPLICIT = 311,
- TOK_IMPLIED = 312,
- TOK_IMPORTS = 313,
- TOK_INCLUDES = 314,
- TOK_INSTANCE = 315,
- TOK_INSTRUCTIONS = 316,
- TOK_INTEGER = 317,
- TOK_ISO646String = 318,
- TOK_MAX = 319,
- TOK_MIN = 320,
- TOK_MINUS_INFINITY = 321,
- TOK_NULL = 322,
- TOK_NumericString = 323,
- TOK_OBJECT = 324,
- TOK_ObjectDescriptor = 325,
- TOK_OCTET = 326,
- TOK_OF = 327,
- TOK_OPTIONAL = 328,
- TOK_PATTERN = 329,
- TOK_PDV = 330,
- TOK_PLUS_INFINITY = 331,
- TOK_PRESENT = 332,
- TOK_PrintableString = 333,
- TOK_PRIVATE = 334,
- TOK_REAL = 335,
- TOK_RELATIVE_OID = 336,
- TOK_SEQUENCE = 337,
- TOK_SET = 338,
- TOK_SIZE = 339,
- TOK_STRING = 340,
- TOK_SYNTAX = 341,
- TOK_T61String = 342,
- TOK_TAGS = 343,
- TOK_TeletexString = 344,
- TOK_TRUE = 345,
- TOK_TYPE_IDENTIFIER = 346,
- TOK_UNIQUE = 347,
- TOK_UNIVERSAL = 348,
- TOK_UniversalString = 349,
- TOK_UTCTime = 350,
- TOK_UTF8String = 351,
- TOK_VideotexString = 352,
- TOK_VisibleString = 353,
- TOK_WITH = 354,
- TOK_EXCEPT = 355,
- TOK_INTERSECTION = 356,
- TOK_UNION = 357,
- TOK_TwoDots = 358,
- TOK_ThreeDots = 359
- };
-#endif
-/* Tokens. */
-#define TOK_PPEQ 258
-#define TOK_whitespace 259
-#define TOK_opaque 260
-#define TOK_bstring 261
-#define TOK_cstring 262
-#define TOK_hstring 263
-#define TOK_identifier 264
-#define TOK_number 265
-#define TOK_tuple 266
-#define TOK_quadruple 267
-#define TOK_number_negative 268
-#define TOK_typereference 269
-#define TOK_capitalreference 270
-#define TOK_typefieldreference 271
-#define TOK_valuefieldreference 272
-#define TOK_Literal 273
-#define TOK_ABSENT 274
-#define TOK_ABSTRACT_SYNTAX 275
-#define TOK_ALL 276
-#define TOK_ANY 277
-#define TOK_APPLICATION 278
-#define TOK_AUTOMATIC 279
-#define TOK_BEGIN 280
-#define TOK_BIT 281
-#define TOK_BMPString 282
-#define TOK_BOOLEAN 283
-#define TOK_BY 284
-#define TOK_CHARACTER 285
-#define TOK_CHOICE 286
-#define TOK_CLASS 287
-#define TOK_COMPONENT 288
-#define TOK_COMPONENTS 289
-#define TOK_CONSTRAINED 290
-#define TOK_CONTAINING 291
-#define TOK_DEFAULT 292
-#define TOK_DEFINITIONS 293
-#define TOK_DEFINED 294
-#define TOK_EMBEDDED 295
-#define TOK_ENCODED 296
-#define TOK_ENCODING_CONTROL 297
-#define TOK_END 298
-#define TOK_ENUMERATED 299
-#define TOK_EXPLICIT 300
-#define TOK_EXPORTS 301
-#define TOK_EXTENSIBILITY 302
-#define TOK_EXTERNAL 303
-#define TOK_FALSE 304
-#define TOK_FROM 305
-#define TOK_GeneralizedTime 306
-#define TOK_GeneralString 307
-#define TOK_GraphicString 308
-#define TOK_IA5String 309
-#define TOK_IDENTIFIER 310
-#define TOK_IMPLICIT 311
-#define TOK_IMPLIED 312
-#define TOK_IMPORTS 313
-#define TOK_INCLUDES 314
-#define TOK_INSTANCE 315
-#define TOK_INSTRUCTIONS 316
-#define TOK_INTEGER 317
-#define TOK_ISO646String 318
-#define TOK_MAX 319
-#define TOK_MIN 320
-#define TOK_MINUS_INFINITY 321
-#define TOK_NULL 322
-#define TOK_NumericString 323
-#define TOK_OBJECT 324
-#define TOK_ObjectDescriptor 325
-#define TOK_OCTET 326
-#define TOK_OF 327
-#define TOK_OPTIONAL 328
-#define TOK_PATTERN 329
-#define TOK_PDV 330
-#define TOK_PLUS_INFINITY 331
-#define TOK_PRESENT 332
-#define TOK_PrintableString 333
-#define TOK_PRIVATE 334
-#define TOK_REAL 335
-#define TOK_RELATIVE_OID 336
-#define TOK_SEQUENCE 337
-#define TOK_SET 338
-#define TOK_SIZE 339
-#define TOK_STRING 340
-#define TOK_SYNTAX 341
-#define TOK_T61String 342
-#define TOK_TAGS 343
-#define TOK_TeletexString 344
-#define TOK_TRUE 345
-#define TOK_TYPE_IDENTIFIER 346
-#define TOK_UNIQUE 347
-#define TOK_UNIVERSAL 348
-#define TOK_UniversalString 349
-#define TOK_UTCTime 350
-#define TOK_UTF8String 351
-#define TOK_VideotexString 352
-#define TOK_VisibleString 353
-#define TOK_WITH 354
-#define TOK_EXCEPT 355
-#define TOK_INTERSECTION 356
-#define TOK_UNION 357
-#define TOK_TwoDots 358
-#define TOK_ThreeDots 359
-
-
-
-
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 72 "asn1p_y.y"
-typedef union YYSTYPE {
+typedef union {
asn1p_t *a_grammar;
asn1p_module_flags_e a_module_flags;
asn1p_module_t *a_module;
@@ -275,14 +31,108 @@ typedef union YYSTYPE {
struct asn1p_type_tag_s tag;
} tv_nametag;
} YYSTYPE;
-/* Line 1447 of yacc.c. */
-#line 280 "y.tab.h"
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
-
-extern YYSTYPE asn1p_lval;
-
+#define TOK_PPEQ 257
+#define TOK_whitespace 258
+#define TOK_opaque 259
+#define TOK_bstring 260
+#define TOK_cstring 261
+#define TOK_hstring 262
+#define TOK_identifier 263
+#define TOK_number 264
+#define TOK_tuple 265
+#define TOK_quadruple 266
+#define TOK_number_negative 267
+#define TOK_typereference 268
+#define TOK_capitalreference 269
+#define TOK_typefieldreference 270
+#define TOK_valuefieldreference 271
+#define TOK_Literal 272
+#define TOK_ABSENT 273
+#define TOK_ABSTRACT_SYNTAX 274
+#define TOK_ALL 275
+#define TOK_ANY 276
+#define TOK_APPLICATION 277
+#define TOK_AUTOMATIC 278
+#define TOK_BEGIN 279
+#define TOK_BIT 280
+#define TOK_BMPString 281
+#define TOK_BOOLEAN 282
+#define TOK_BY 283
+#define TOK_CHARACTER 284
+#define TOK_CHOICE 285
+#define TOK_CLASS 286
+#define TOK_COMPONENT 287
+#define TOK_COMPONENTS 288
+#define TOK_CONSTRAINED 289
+#define TOK_CONTAINING 290
+#define TOK_DEFAULT 291
+#define TOK_DEFINITIONS 292
+#define TOK_DEFINED 293
+#define TOK_EMBEDDED 294
+#define TOK_ENCODED 295
+#define TOK_ENCODING_CONTROL 296
+#define TOK_END 297
+#define TOK_ENUMERATED 298
+#define TOK_EXPLICIT 299
+#define TOK_EXPORTS 300
+#define TOK_EXTENSIBILITY 301
+#define TOK_EXTERNAL 302
+#define TOK_FALSE 303
+#define TOK_FROM 304
+#define TOK_GeneralizedTime 305
+#define TOK_GeneralString 306
+#define TOK_GraphicString 307
+#define TOK_IA5String 308
+#define TOK_IDENTIFIER 309
+#define TOK_IMPLICIT 310
+#define TOK_IMPLIED 311
+#define TOK_IMPORTS 312
+#define TOK_INCLUDES 313
+#define TOK_INSTANCE 314
+#define TOK_INSTRUCTIONS 315
+#define TOK_INTEGER 316
+#define TOK_ISO646String 317
+#define TOK_MAX 318
+#define TOK_MIN 319
+#define TOK_MINUS_INFINITY 320
+#define TOK_NULL 321
+#define TOK_NumericString 322
+#define TOK_OBJECT 323
+#define TOK_ObjectDescriptor 324
+#define TOK_OCTET 325
+#define TOK_OF 326
+#define TOK_OPTIONAL 327
+#define TOK_PATTERN 328
+#define TOK_PDV 329
+#define TOK_PLUS_INFINITY 330
+#define TOK_PRESENT 331
+#define TOK_PrintableString 332
+#define TOK_PRIVATE 333
+#define TOK_REAL 334
+#define TOK_RELATIVE_OID 335
+#define TOK_SEQUENCE 336
+#define TOK_SET 337
+#define TOK_SIZE 338
+#define TOK_STRING 339
+#define TOK_SYNTAX 340
+#define TOK_T61String 341
+#define TOK_TAGS 342
+#define TOK_TeletexString 343
+#define TOK_TRUE 344
+#define TOK_TYPE_IDENTIFIER 345
+#define TOK_UNIQUE 346
+#define TOK_UNIVERSAL 347
+#define TOK_UniversalString 348
+#define TOK_UTCTime 349
+#define TOK_UTF8String 350
+#define TOK_VideotexString 351
+#define TOK_VisibleString 352
+#define TOK_WITH 353
+#define TOK_EXCEPT 354
+#define TOK_INTERSECTION 355
+#define TOK_UNION 356
+#define TOK_TwoDots 357
+#define TOK_ThreeDots 358
+extern YYSTYPE asn1p_lval;
diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y
index cb24e8ff..e119f172 100644
--- a/libasn1parser/asn1p_y.y
+++ b/libasn1parser/asn1p_y.y
@@ -270,8 +270,8 @@ static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
%type <tv_str> optIdentifier
%type <a_parg> ParameterArgumentName
%type <a_plist> ParameterArgumentList
-%type <a_expr> ActualParameter
-%type <a_expr> ActualParameterList
+%type <a_expr> Specialization
+%type <a_expr> Specializations
%type <a_aid> AssignedIdentifier /* OID/DefinedValue */
%type <a_oid> ObjectIdentifier /* OID */
%type <a_oid> optObjectIdentifier /* Optional OID */
@@ -774,8 +774,7 @@ DataTypeReference:
$$ = $6;
assert($$->Identifier == 0);
$$->Identifier = $1;
- $$->params = $3;
- $$->meta_type = AMT_PARAMTYPE;
+ $$->lhs_params = $3;
}
;
@@ -828,33 +827,37 @@ ParameterArgumentName:
}
;
-ActualParameterList:
- ActualParameter {
+Specializations:
+ Specialization {
$$ = asn1p_expr_new(yylineno);
checkmem($$);
asn1p_expr_add($$, $1);
}
- | ActualParameterList ',' ActualParameter {
+ | Specializations ',' Specialization {
$$ = $1;
asn1p_expr_add($$, $3);
}
;
-ActualParameter:
+Specialization:
Type {
$$ = $1;
}
| Identifier {
+ asn1p_ref_t *ref;
$$ = asn1p_expr_new(yylineno);
checkmem($$);
$$->Identifier = $1;
$$->expr_type = A1TC_REFERENCE;
$$->meta_type = AMT_VALUE;
+ ref = asn1p_ref_new(yylineno);
+ asn1p_ref_add_component(ref, $1, RLT_lowercase);
+ $$->value = asn1p_value_fromref(ref, 0);
}
;
/*
- | '{' ActualParameter '}' {
+ | '{' Specialization '}' {
$$ = asn1p_expr_new(yylineno);
checkmem($$);
asn1p_expr_add($$, $2);
@@ -1224,23 +1227,6 @@ TypeDeclarationSet:
$$->meta_type = AMT_TYPE;
}
/*
- * A parametrized assignment.
- */
- | TypeRefName '{' ActualParameterList '}' {
- int ret;
- $$ = $3;
- assert($$->expr_type == 0);
- assert($$->meta_type == 0);
- assert($$->reference == 0);
- $$->reference = asn1p_ref_new(yylineno);
- checkmem($$->reference);
- ret = asn1p_ref_add_component($$->reference, $1, RLT_UNKNOWN);
- checkmem(ret == 0);
- free($1);
- $$->expr_type = A1TC_PARAMETRIZED;
- $$->meta_type = AMT_TYPE;
- }
- /*
* A DefinedType reference.
* "CLASS1.&id.&id2"
* or
@@ -1257,6 +1243,17 @@ TypeDeclarationSet:
$$->expr_type = A1TC_REFERENCE;
$$->meta_type = AMT_TYPEREF;
}
+ /*
+ * A parametrized assignment.
+ */
+ | ComplexTypeReference '{' Specializations '}' {
+ $$ = asn1p_expr_new(yylineno);
+ checkmem($$);
+ $$->reference = $1;
+ $$->rhs_pspecs = $3;
+ $$->expr_type = A1TC_REFERENCE;
+ $$->meta_type = AMT_TYPEREF;
+ }
| TOK_INSTANCE TOK_OF ComplexTypeReference {
$$ = asn1p_expr_new(yylineno);
checkmem($$);
diff --git a/libasn1parser/asn1parser.c b/libasn1parser/asn1parser.c
index bd712b3c..6c8faf00 100644
--- a/libasn1parser/asn1parser.c
+++ b/libasn1parser/asn1parser.c
@@ -165,6 +165,15 @@ _asn1p_apply_module2expr(asn1p_expr_t *expr, asn1p_module_t *mod) {
TQ_FOR(e, &(expr->members), next) {
_asn1p_apply_module2expr(e, mod);
}
+
+ /*
+ * Do to parameterization.
+ */
+ if(expr->rhs_pspecs) {
+ TQ_FOR(e, &(expr->rhs_pspecs->members), next) {
+ _asn1p_apply_module2expr(e, mod);
+ }
+ }
}
static int
diff --git a/libasn1parser/asn1parser.h b/libasn1parser/asn1parser.h
index ceb099e7..e83b747f 100644
--- a/libasn1parser/asn1parser.h
+++ b/libasn1parser/asn1parser.h
@@ -42,7 +42,7 @@ typedef intmax_t asn1c_integer_t;
#include "asn1p_oid.h" /* Object identifiers (OIDs) */
#include "asn1p_ref.h" /* References to custom types */
#include "asn1p_value.h" /* Value definition */
-#include "asn1p_param.h" /* Parametrization */
+#include "asn1p_param.h" /* Parameterization */
#include "asn1p_constr.h" /* Type Constraints */
#include "asn1p_xports.h" /* IMports/EXports */
#include "asn1p_module.h" /* ASN.1 definition module */
diff --git a/libasn1print/asn1print.c b/libasn1print/asn1print.c
index ced31db3..df3a93f2 100644
--- a/libasn1print/asn1print.c
+++ b/libasn1print/asn1print.c
@@ -525,11 +525,13 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
INDENT("--<ASN1C.RepresentAsPointer>--\n");
}
- if(tc->Identifier)
+ if(tc->Identifier
+ && (!(tc->meta_type == AMT_VALUE && tc->expr_type == A1TC_REFERENCE)
+ || level == 0))
INDENT("%s", tc->Identifier);
- if(tc->params) {
- asn1print_params(tc->params, flags);
+ if(tc->lhs_params) {
+ asn1print_params(tc->lhs_params, flags);
}
if(tc->meta_type != AMT_VALUE
@@ -559,8 +561,6 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
SEQ_OF = 1; /* Equivalent to SET OF for printint purposes */
printf(" COMPONENTS OF");
break;
- case A1TC_PARAMETRIZED:
- flags |= APF_NOINDENT;
case A1TC_REFERENCE:
case A1TC_UNIVERVAL:
break;
@@ -662,6 +662,16 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
printf("}\n");
}
+ /* Right hand specialization */
+ if(tc->rhs_pspecs) {
+ asn1p_expr_t *se;
+ printf("{");
+ TQ_FOR(se, &(tc->rhs_pspecs->members), next) {
+ asn1print_expr(asn, mod, se, flags, level + 1);
+ }
+ printf("}");
+ }
+
if(!SEQ_OF && tc->constraints) {
printf(" ");
asn1print_constraint(tc->constraints, flags);
@@ -680,7 +690,7 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
printf(")");
}
} else {
- printf(" ::= ");
+ if(level == 0) printf(" ::= ");
asn1print_value(tc->value, flags);
}
}
@@ -746,6 +756,28 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
}
} while(0);
+ if(flags & APF_PRINT_CLASS_MATRIX
+ && tc->lhs_params) do {
+ int i;
+ if(tc->specializations.pspecs_count == 0) {
+ printf("\n-- No specializations found\n");
+ break;
+ }
+ printf("\n-- Specializations list has %d entr%s:\n",
+ tc->specializations.pspecs_count,
+ tc->specializations.pspecs_count == 1 ? "y" : "ies");
+ for(i = 0; i < tc->specializations.pspecs_count; i++) {
+ asn1p_expr_t *se;
+ struct asn1p_pspec_s *pspec;
+ pspec = &tc->specializations.pspec[i];
+ printf("-- ");
+ TQ_FOR(se, &(pspec->rhs_pspecs->members), next) {
+ asn1print_expr(asn, mod, se, flags, level+1);
+ }
+ printf("\n");
+ }
+ } while(0);
+
return 0;
}
diff --git a/tests/104-param-1-OK.asn1 b/tests/104-param-1-OK.asn1
new file mode 100644
index 00000000..4ffb603b
--- /dev/null
+++ b/tests/104-param-1-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .104
+
+ModuleParametrization1
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 104 }
+ DEFINITIONS ::=
+BEGIN
+
+ Collection {T} ::= SET OF T
+
+ Bunch ::= SEQUENCE {
+ field-REAL Collection {REAL},
+ field-IA5String Collection {IA5String}
+ }
+
+END
diff --git a/tests/104-param-1-OK.asn1.-EFprint-class-matrix b/tests/104-param-1-OK.asn1.-EFprint-class-matrix
new file mode 100644
index 00000000..26a81ef3
--- /dev/null
+++ b/tests/104-param-1-OK.asn1.-EFprint-class-matrix
@@ -0,0 +1,17 @@
+ModuleParametrization1 { iso org(3) dod(6) internet(1) private(4)
+ enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 104 }
+DEFINITIONS ::=
+BEGIN
+
+Collection{T} ::= SET OF T
+-- Specializations list has 2 entries:
+-- REAL
+-- IA5String
+
+
+Bunch ::= SEQUENCE {
+ field-REAL Collection{ REAL},
+ field-IA5String Collection{ IA5String}
+}
+
+END
diff --git a/tests/104-param-1-OK.asn1.-P b/tests/104-param-1-OK.asn1.-P
new file mode 100644
index 00000000..4d741e47
--- /dev/null
+++ b/tests/104-param-1-OK.asn1.-P
@@ -0,0 +1,198 @@
+
+/*** <<< INCLUDES [Collection] >>> ***/
+
+#include <REAL.h>
+#include <asn_SET_OF.h>
+#include <constr_SET_OF.h>
+#include <IA5String.h>
+
+/*** <<< TYPE-DECLS [Collection] >>> ***/
+
+typedef struct Collection_16P0 {
+ A_SET_OF(REAL_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Collection_16P0_t;
+typedef struct Collection_16P1 {
+ A_SET_OF(IA5String_t) list;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Collection_16P1_t;
+
+/*** <<< FUNC-DECLS [Collection] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Collection_16P0;
+extern asn_TYPE_descriptor_t asn_DEF_Collection_16P1;
+
+/*** <<< STAT-DEFS [Collection] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Collection_16P0_1[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static ber_tlv_tag_t asn_DEF_Collection_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_Collection_16P0_specs_1 = {
+ sizeof(struct Collection_16P0),
+ offsetof(struct Collection_16P0, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Collection_16P0 = {
+ "Collection",
+ "Collection",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Collection_16P0_tags_1,
+ sizeof(asn_DEF_Collection_16P0_tags_1)
+ /sizeof(asn_DEF_Collection_16P0_tags_1[0]), /* 1 */
+ asn_DEF_Collection_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Collection_16P0_tags_1)
+ /sizeof(asn_DEF_Collection_16P0_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_Collection_16P0_1,
+ 1, /* Single element */
+ &asn_SPC_Collection_16P0_specs_1 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_Collection_16P1_3[] = {
+ { ATF_POINTER, 0, 0,
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_IA5String,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = ""
+ },
+};
+static ber_tlv_tag_t asn_DEF_Collection_16P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_SET_OF_specifics_t asn_SPC_Collection_16P1_specs_3 = {
+ sizeof(struct Collection_16P1),
+ offsetof(struct Collection_16P1, _asn_ctx),
+ 0, /* XER encoding is XMLDelimitedItemList */
+};
+asn_TYPE_descriptor_t asn_DEF_Collection_16P1 = {
+ "Collection",
+ "Collection",
+ SET_OF_free,
+ SET_OF_print,
+ SET_OF_constraint,
+ SET_OF_decode_ber,
+ SET_OF_encode_der,
+ SET_OF_decode_xer,
+ SET_OF_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Collection_16P1_tags_3,
+ sizeof(asn_DEF_Collection_16P1_tags_3)
+ /sizeof(asn_DEF_Collection_16P1_tags_3[0]), /* 1 */
+ asn_DEF_Collection_16P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_Collection_16P1_tags_3)
+ /sizeof(asn_DEF_Collection_16P1_tags_3[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_Collection_16P1_3,
+ 1, /* Single element */
+ &asn_SPC_Collection_16P1_specs_3 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Bunch] >>> ***/
+
+#include <Collection.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Bunch] >>> ***/
+
+typedef struct Bunch {
+ Collection_16P0_t field_REAL;
+ Collection_16P1_t field_IA5String;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Bunch_t;
+
+/*** <<< FUNC-DECLS [Bunch] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Bunch;
+
+/*** <<< STAT-DEFS [Bunch] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Bunch_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Bunch, field_REAL),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Collection_16P0,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "field-REAL"
+ },
+ { ATF_NOFLAGS, 0, offsetof(struct Bunch, field_IA5String),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_Collection_16P1,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "field-IA5String"
+ },
+};
+static ber_tlv_tag_t asn_DEF_Bunch_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_TYPE_tag2member_t asn_MAP_Bunch_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 1 }, /* field-REAL at 17 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, -1, 0 } /* field-IA5String at 18 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Bunch_specs_1 = {
+ sizeof(struct Bunch),
+ offsetof(struct Bunch, _asn_ctx),
+ asn_MAP_Bunch_tag2el_1,
+ 2, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Bunch = {
+ "Bunch",
+ "Bunch",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Bunch_tags_1,
+ sizeof(asn_DEF_Bunch_tags_1)
+ /sizeof(asn_DEF_Bunch_tags_1[0]), /* 1 */
+ asn_DEF_Bunch_tags_1, /* Same as above */
+ sizeof(asn_DEF_Bunch_tags_1)
+ /sizeof(asn_DEF_Bunch_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_Bunch_1,
+ 2, /* Elements count */
+ &asn_SPC_Bunch_specs_1 /* Additional specs */
+};
+
diff --git a/tests/105-param-2-OK.asn1 b/tests/105-param-2-OK.asn1
new file mode 100644
index 00000000..eeee4c47
--- /dev/null
+++ b/tests/105-param-2-OK.asn1
@@ -0,0 +1,21 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .105
+
+ModuleParametrization2
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 105 }
+ DEFINITIONS ::=
+BEGIN
+
+ SIGNED {Type} ::= SEQUENCE {
+ signed Type
+ }
+
+ SignedREAL ::= SIGNED {REAL}
+ SignedSET ::= SIGNED { SET { a INTEGER } }
+
+END
diff --git a/tests/105-param-2-OK.asn1.-P b/tests/105-param-2-OK.asn1.-P
new file mode 100644
index 00000000..009a0773
--- /dev/null
+++ b/tests/105-param-2-OK.asn1.-P
@@ -0,0 +1,451 @@
+
+/*** <<< INCLUDES [SIGNED] >>> ***/
+
+#include <REAL.h>
+#include <constr_SEQUENCE.h>
+#include <INTEGER.h>
+#include <constr_SET.h>
+
+/*** <<< DEPS [SIGNED] >>> ***/
+
+
+/*
+ * Method of determining the components presence
+ */
+typedef enum signed_PR {
+ signed_PR_a, /* Member a is present */
+} signed_PR;
+
+/*** <<< TYPE-DECLS [SIGNED] >>> ***/
+
+typedef struct SIGNED_16P0 {
+ REAL_t Signed;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SIGNED_16P0_t;
+typedef struct SIGNED_16P1 {
+ struct Signed {
+ INTEGER_t a;
+
+ /* Presence bitmask: ASN_SET_ISPRESENT(psigned, signed_PR_x) */
+ unsigned int _presence_map
+ [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+ } Signed;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} SIGNED_16P1_t;
+
+/*** <<< FUNC-DECLS [SIGNED] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0;
+extern asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1;
+
+/*** <<< STAT-DEFS [SIGNED] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_SIGNED_16P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P0, Signed),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_REAL,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed"
+ },
+};
+static ber_tlv_tag_t asn_DEF_SIGNED_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_TYPE_tag2member_t asn_MAP_SIGNED_16P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 0, 0, 0 } /* signed at 18 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P0_specs_1 = {
+ sizeof(struct SIGNED_16P0),
+ offsetof(struct SIGNED_16P0, _asn_ctx),
+ asn_MAP_SIGNED_16P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SIGNED_16P0 = {
+ "SIGNED",
+ "SIGNED",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIGNED_16P0_tags_1,
+ sizeof(asn_DEF_SIGNED_16P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
+ asn_DEF_SIGNED_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIGNED_16P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_16P0_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_SIGNED_16P0_specs_1 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_signed_4[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Signed, a),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_INTEGER,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "a"
+ },
+};
+static ber_tlv_tag_t asn_DEF_signed_tags_4[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
+};
+static asn_TYPE_tag2member_t asn_MAP_signed_tag2el_4[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* a at 19 */
+};
+static uint8_t asn_MAP_signed_mmap_4[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
+ (1 << 7)
+};
+static asn_SET_specifics_t asn_SPC_signed_specs_4 = {
+ sizeof(struct Signed),
+ offsetof(struct Signed, _asn_ctx),
+ offsetof(struct Signed, _presence_map),
+ asn_MAP_signed_tag2el_4,
+ 1, /* Count of tags in the map */
+ asn_MAP_signed_tag2el_4, /* Same as above */
+ 1, /* Count of tags in the CXER map */
+ 0, /* Whether extensible */
+ (unsigned int *)asn_MAP_signed_mmap_4 /* Mandatory elements map */
+};
+static /* Use -fall-defs-global to expose */
+asn_TYPE_descriptor_t asn_DEF_signed_4 = {
+ "signed",
+ "signed",
+ SET_free,
+ SET_print,
+ SET_constraint,
+ SET_decode_ber,
+ SET_encode_der,
+ SET_decode_xer,
+ SET_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_signed_tags_4,
+ sizeof(asn_DEF_signed_tags_4)
+ /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
+ asn_DEF_signed_tags_4, /* Same as above */
+ sizeof(asn_DEF_signed_tags_4)
+ /sizeof(asn_DEF_signed_tags_4[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_signed_4,
+ 1, /* Elements count */
+ &asn_SPC_signed_specs_4 /* Additional specs */
+};
+
+static asn_TYPE_member_t asn_MBR_SIGNED_16P1_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_16P1, Signed),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_signed_4,
+ .memb_constraints = 0, /* Defer constraints checking to the member type */
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "signed"
+ },
+};
+static ber_tlv_tag_t asn_DEF_SIGNED_16P1_tags_3[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_TYPE_tag2member_t asn_MAP_SIGNED_16P1_tag2el_3[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 } /* signed at 19 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_16P1_specs_3 = {
+ sizeof(struct SIGNED_16P1),
+ offsetof(struct SIGNED_16P1, _asn_ctx),
+ asn_MAP_SIGNED_16P1_tag2el_3,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_SIGNED_16P1 = {
+ "SIGNED",
+ "SIGNED",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIGNED_16P1_tags_3,
+ sizeof(asn_DEF_SIGNED_16P1_tags_3)
+ /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
+ asn_DEF_SIGNED_16P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_SIGNED_16P1_tags_3)
+ /sizeof(asn_DEF_SIGNED_16P1_tags_3[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_16P1_3,
+ 1, /* Elements count */
+ &asn_SPC_SIGNED_16P1_specs_3 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [SignedREAL] >>> ***/
+
+#include <SIGNED.h>
+
+/*** <<< TYPE-DECLS [SignedREAL] >>> ***/
+
+typedef SIGNED_16P0_t SignedREAL_t;
+
+/*** <<< FUNC-DECLS [SignedREAL] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SignedREAL;
+asn_struct_free_f SignedREAL_free;
+asn_struct_print_f SignedREAL_print;
+asn_constr_check_f SignedREAL_constraint;
+ber_type_decoder_f SignedREAL_decode_ber;
+der_type_encoder_f SignedREAL_encode_der;
+xer_type_decoder_f SignedREAL_decode_xer;
+xer_type_encoder_f SignedREAL_encode_xer;
+
+/*** <<< CODE [SignedREAL] >>> ***/
+
+int
+SignedREAL_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_consume_bytes_f *app_errlog, void *app_key) {
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_SIGNED_16P0.check_constraints;
+ return td->check_constraints(td, sptr, app_errlog, app_key);
+}
+
+/*
+ * This type is implemented using SIGNED_16P0,
+ * so here we adjust the DEF accordingly.
+ */
+static void
+SignedREAL_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
+ td->free_struct = asn_DEF_SIGNED_16P0.free_struct;
+ td->print_struct = asn_DEF_SIGNED_16P0.print_struct;
+ td->ber_decoder = asn_DEF_SIGNED_16P0.ber_decoder;
+ td->der_encoder = asn_DEF_SIGNED_16P0.der_encoder;
+ td->xer_decoder = asn_DEF_SIGNED_16P0.xer_decoder;
+ td->xer_encoder = asn_DEF_SIGNED_16P0.xer_encoder;
+ td->uper_decoder = asn_DEF_SIGNED_16P0.uper_decoder;
+ if(!td->per_constraints)
+ td->per_constraints = asn_DEF_SIGNED_16P0.per_constraints;
+ td->elements = asn_DEF_SIGNED_16P0.elements;
+ td->elements_count = asn_DEF_SIGNED_16P0.elements_count;
+ td->specifics = asn_DEF_SIGNED_16P0.specifics;
+}
+
+void
+SignedREAL_free(asn_TYPE_descriptor_t *td,
+ void *struct_ptr, int contents_only) {
+ SignedREAL_1_inherit_TYPE_descriptor(td);
+ td->free_struct(td, struct_ptr, contents_only);
+}
+
+int
+SignedREAL_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
+ int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+ SignedREAL_1_inherit_TYPE_descriptor(td);
+ return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
+}
+
+asn_dec_rval_t
+SignedREAL_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const void *bufptr, size_t size, int tag_mode) {
+ SignedREAL_1_inherit_TYPE_descriptor(td);
+ return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
+}
+
+asn_enc_rval_t
+SignedREAL_encode_der(asn_TYPE_descriptor_t *td,
+ void *structure, int tag_mode, ber_tlv_tag_t tag,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ SignedREAL_1_inherit_TYPE_descriptor(td);
+ return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
+}
+
+asn_dec_rval_t
+SignedREAL_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const char *opt_mname, const void *bufptr, size_t size) {
+ SignedREAL_1_inherit_TYPE_descriptor(td);
+ return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
+}
+
+asn_enc_rval_t
+SignedREAL_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
+ int ilevel, enum xer_encoder_flags_e flags,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ SignedREAL_1_inherit_TYPE_descriptor(td);
+ return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [SignedREAL] >>> ***/
+
+static ber_tlv_tag_t asn_DEF_SignedREAL_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SignedREAL = {
+ "SignedREAL",
+ "SignedREAL",
+ SignedREAL_free,
+ SignedREAL_print,
+ SignedREAL_constraint,
+ SignedREAL_decode_ber,
+ SignedREAL_encode_der,
+ SignedREAL_decode_xer,
+ SignedREAL_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SignedREAL_tags_1,
+ sizeof(asn_DEF_SignedREAL_tags_1)
+ /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
+ asn_DEF_SignedREAL_tags_1, /* Same as above */
+ sizeof(asn_DEF_SignedREAL_tags_1)
+ /sizeof(asn_DEF_SignedREAL_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
+
+/*** <<< INCLUDES [SignedSET] >>> ***/
+
+#include <SIGNED.h>
+
+/*** <<< TYPE-DECLS [SignedSET] >>> ***/
+
+typedef SIGNED_16P1_t SignedSET_t;
+
+/*** <<< FUNC-DECLS [SignedSET] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_SignedSET;
+asn_struct_free_f SignedSET_free;
+asn_struct_print_f SignedSET_print;
+asn_constr_check_f SignedSET_constraint;
+ber_type_decoder_f SignedSET_decode_ber;
+der_type_encoder_f SignedSET_encode_der;
+xer_type_decoder_f SignedSET_decode_xer;
+xer_type_encoder_f SignedSET_encode_xer;
+
+/*** <<< CODE [SignedSET] >>> ***/
+
+int
+SignedSET_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_consume_bytes_f *app_errlog, void *app_key) {
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_SIGNED_16P1.check_constraints;
+ return td->check_constraints(td, sptr, app_errlog, app_key);
+}
+
+/*
+ * This type is implemented using SIGNED_16P1,
+ * so here we adjust the DEF accordingly.
+ */
+static void
+SignedSET_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
+ td->free_struct = asn_DEF_SIGNED_16P1.free_struct;
+ td->print_struct = asn_DEF_SIGNED_16P1.print_struct;
+ td->ber_decoder = asn_DEF_SIGNED_16P1.ber_decoder;
+ td->der_encoder = asn_DEF_SIGNED_16P1.der_encoder;
+ td->xer_decoder = asn_DEF_SIGNED_16P1.xer_decoder;
+ td->xer_encoder = asn_DEF_SIGNED_16P1.xer_encoder;
+ td->uper_decoder = asn_DEF_SIGNED_16P1.uper_decoder;
+ if(!td->per_constraints)
+ td->per_constraints = asn_DEF_SIGNED_16P1.per_constraints;
+ td->elements = asn_DEF_SIGNED_16P1.elements;
+ td->elements_count = asn_DEF_SIGNED_16P1.elements_count;
+ td->specifics = asn_DEF_SIGNED_16P1.specifics;
+}
+
+void
+SignedSET_free(asn_TYPE_descriptor_t *td,
+ void *struct_ptr, int contents_only) {
+ SignedSET_1_inherit_TYPE_descriptor(td);
+ td->free_struct(td, struct_ptr, contents_only);
+}
+
+int
+SignedSET_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
+ int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+ SignedSET_1_inherit_TYPE_descriptor(td);
+ return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
+}
+
+asn_dec_rval_t
+SignedSET_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const void *bufptr, size_t size, int tag_mode) {
+ SignedSET_1_inherit_TYPE_descriptor(td);
+ return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
+}
+
+asn_enc_rval_t
+SignedSET_encode_der(asn_TYPE_descriptor_t *td,
+ void *structure, int tag_mode, ber_tlv_tag_t tag,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ SignedSET_1_inherit_TYPE_descriptor(td);
+ return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
+}
+
+asn_dec_rval_t
+SignedSET_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const char *opt_mname, const void *bufptr, size_t size) {
+ SignedSET_1_inherit_TYPE_descriptor(td);
+ return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
+}
+
+asn_enc_rval_t
+SignedSET_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
+ int ilevel, enum xer_encoder_flags_e flags,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ SignedSET_1_inherit_TYPE_descriptor(td);
+ return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [SignedSET] >>> ***/
+
+static ber_tlv_tag_t asn_DEF_SignedSET_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_SignedSET = {
+ "SignedSET",
+ "SignedSET",
+ SignedSET_free,
+ SignedSET_print,
+ SignedSET_constraint,
+ SignedSET_decode_ber,
+ SignedSET_encode_der,
+ SignedSET_decode_xer,
+ SignedSET_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_SignedSET_tags_1,
+ sizeof(asn_DEF_SignedSET_tags_1)
+ /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
+ asn_DEF_SignedSET_tags_1, /* Same as above */
+ sizeof(asn_DEF_SignedSET_tags_1)
+ /sizeof(asn_DEF_SignedSET_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
diff --git a/tests/106-param-constr-OK.asn1 b/tests/106-param-constr-OK.asn1
new file mode 100644
index 00000000..196b3d7d
--- /dev/null
+++ b/tests/106-param-constr-OK.asn1
@@ -0,0 +1,20 @@
+
+-- OK: Everything is fine
+
+-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
+-- .spelio.software.asn1c.test (9363.1.5.1)
+-- .106
+
+ModuleParametrizationWithConstraints
+ { iso org(3) dod(6) internet (1) private(4) enterprise(1)
+ spelio(9363) software(1) asn1c(5) test(1) 106 }
+ DEFINITIONS ::=
+BEGIN
+
+ Narrow {Type} ::= SEQUENCE {
+ narrower Type (2..5)
+ }
+
+ NarrowInteger ::= Narrow {INTEGER (0..10)}
+
+END
diff --git a/tests/106-param-constr-OK.asn1.-P b/tests/106-param-constr-OK.asn1.-P
new file mode 100644
index 00000000..49046200
--- /dev/null
+++ b/tests/106-param-constr-OK.asn1.-P
@@ -0,0 +1,222 @@
+
+/*** <<< INCLUDES [Narrow] >>> ***/
+
+#include <NativeInteger.h>
+#include <constr_SEQUENCE.h>
+
+/*** <<< TYPE-DECLS [Narrow] >>> ***/
+
+typedef struct Narrow_16P0 {
+ long narrower;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} Narrow_16P0_t;
+
+/*** <<< FUNC-DECLS [Narrow] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Narrow_16P0;
+
+/*** <<< CODE [Narrow] >>> ***/
+
+static int
+memb_narrower_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_consume_bytes_f *app_errlog, void *app_key) {
+ long value;
+
+ if(!sptr) {
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+
+ value = *(const long *)sptr;
+
+ if((value >= 2 && value <= 5)) {
+ /* Constraint check succeeded */
+ return 0;
+ } else {
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: constraint failed (%s:%d)",
+ td->name, __FILE__, __LINE__);
+ return -1;
+ }
+}
+
+
+/*** <<< STAT-DEFS [Narrow] >>> ***/
+
+static asn_TYPE_member_t asn_MBR_Narrow_16P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct Narrow_16P0, narrower),
+ .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
+ .tag_mode = 0,
+ .type = &asn_DEF_NativeInteger,
+ .memb_constraints = memb_narrower_constraint_1,
+ .per_constraints = 0, /* PER is not compiled, use -gen-PER */
+ .default_value = 0,
+ .name = "narrower"
+ },
+};
+static ber_tlv_tag_t asn_DEF_Narrow_16P0_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+static asn_TYPE_tag2member_t asn_MAP_Narrow_16P0_tag2el_1[] = {
+ { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* narrower at 18 */
+};
+static asn_SEQUENCE_specifics_t asn_SPC_Narrow_16P0_specs_1 = {
+ sizeof(struct Narrow_16P0),
+ offsetof(struct Narrow_16P0, _asn_ctx),
+ asn_MAP_Narrow_16P0_tag2el_1,
+ 1, /* Count of tags in the map */
+ 0, 0, 0, /* Optional elements (not needed) */
+ -1, /* Start extensions */
+ -1 /* Stop extensions */
+};
+asn_TYPE_descriptor_t asn_DEF_Narrow_16P0 = {
+ "Narrow",
+ "Narrow",
+ SEQUENCE_free,
+ SEQUENCE_print,
+ SEQUENCE_constraint,
+ SEQUENCE_decode_ber,
+ SEQUENCE_encode_der,
+ SEQUENCE_decode_xer,
+ SEQUENCE_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_Narrow_16P0_tags_1,
+ sizeof(asn_DEF_Narrow_16P0_tags_1)
+ /sizeof(asn_DEF_Narrow_16P0_tags_1[0]), /* 1 */
+ asn_DEF_Narrow_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_Narrow_16P0_tags_1)
+ /sizeof(asn_DEF_Narrow_16P0_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_Narrow_16P0_1,
+ 1, /* Elements count */
+ &asn_SPC_Narrow_16P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [NarrowInteger] >>> ***/
+
+#include <Narrow.h>
+
+/*** <<< TYPE-DECLS [NarrowInteger] >>> ***/
+
+typedef Narrow_16P0_t NarrowInteger_t;
+
+/*** <<< FUNC-DECLS [NarrowInteger] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_NarrowInteger;
+asn_struct_free_f NarrowInteger_free;
+asn_struct_print_f NarrowInteger_print;
+asn_constr_check_f NarrowInteger_constraint;
+ber_type_decoder_f NarrowInteger_decode_ber;
+der_type_encoder_f NarrowInteger_encode_der;
+xer_type_decoder_f NarrowInteger_decode_xer;
+xer_type_encoder_f NarrowInteger_encode_xer;
+
+/*** <<< CODE [NarrowInteger] >>> ***/
+
+int
+NarrowInteger_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_consume_bytes_f *app_errlog, void *app_key) {
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_Narrow_16P0.check_constraints;
+ return td->check_constraints(td, sptr, app_errlog, app_key);
+}
+
+/*
+ * This type is implemented using Narrow_16P0,
+ * so here we adjust the DEF accordingly.
+ */
+static void
+NarrowInteger_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
+ td->free_struct = asn_DEF_Narrow_16P0.free_struct;
+ td->print_struct = asn_DEF_Narrow_16P0.print_struct;
+ td->ber_decoder = asn_DEF_Narrow_16P0.ber_decoder;
+ td->der_encoder = asn_DEF_Narrow_16P0.der_encoder;
+ td->xer_decoder = asn_DEF_Narrow_16P0.xer_decoder;
+ td->xer_encoder = asn_DEF_Narrow_16P0.xer_encoder;
+ td->uper_decoder = asn_DEF_Narrow_16P0.uper_decoder;
+ if(!td->per_constraints)
+ td->per_constraints = asn_DEF_Narrow_16P0.per_constraints;
+ td->elements = asn_DEF_Narrow_16P0.elements;
+ td->elements_count = asn_DEF_Narrow_16P0.elements_count;
+ td->specifics = asn_DEF_Narrow_16P0.specifics;
+}
+
+void
+NarrowInteger_free(asn_TYPE_descriptor_t *td,
+ void *struct_ptr, int contents_only) {
+ NarrowInteger_1_inherit_TYPE_descriptor(td);
+ td->free_struct(td, struct_ptr, contents_only);
+}
+
+int
+NarrowInteger_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
+ int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+ NarrowInteger_1_inherit_TYPE_descriptor(td);
+ return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
+}
+
+asn_dec_rval_t
+NarrowInteger_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const void *bufptr, size_t size, int tag_mode) {
+ NarrowInteger_1_inherit_TYPE_descriptor(td);
+ return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
+}
+
+asn_enc_rval_t
+NarrowInteger_encode_der(asn_TYPE_descriptor_t *td,
+ void *structure, int tag_mode, ber_tlv_tag_t tag,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ NarrowInteger_1_inherit_TYPE_descriptor(td);
+ return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
+}
+
+asn_dec_rval_t
+NarrowInteger_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const char *opt_mname, const void *bufptr, size_t size) {
+ NarrowInteger_1_inherit_TYPE_descriptor(td);
+ return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
+}
+
+asn_enc_rval_t
+NarrowInteger_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
+ int ilevel, enum xer_encoder_flags_e flags,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ NarrowInteger_1_inherit_TYPE_descriptor(td);
+ return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [NarrowInteger] >>> ***/
+
+static ber_tlv_tag_t asn_DEF_NarrowInteger_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_NarrowInteger = {
+ "NarrowInteger",
+ "NarrowInteger",
+ NarrowInteger_free,
+ NarrowInteger_print,
+ NarrowInteger_constraint,
+ NarrowInteger_decode_ber,
+ NarrowInteger_encode_der,
+ NarrowInteger_decode_xer,
+ NarrowInteger_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
+ asn_DEF_NarrowInteger_tags_1,
+ sizeof(asn_DEF_NarrowInteger_tags_1)
+ /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */
+ asn_DEF_NarrowInteger_tags_1, /* Same as above */
+ sizeof(asn_DEF_NarrowInteger_tags_1)
+ /sizeof(asn_DEF_NarrowInteger_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
+};
+
diff --git a/tests/19-param-OK.asn1.-EF b/tests/19-param-OK.asn1.-EF
index c5792127..da640152 100644
--- a/tests/19-param-OK.asn1.-EF
+++ b/tests/19-param-OK.asn1.-EF
@@ -9,15 +9,11 @@ SIGNED{ToBeSigned} ::= SEQUENCE {
signature BIT STRING SIZE(0..256)
}
-Certificate ::= SEQUENCE {
- toBeSigned SEQUENCE {
+Certificate ::= SIGNED{ SEQUENCE {
version INTEGER,
signature OBJECT IDENTIFIER,
issuer Name
- },
- algorithm OBJECT IDENTIFIER,
- signature BIT STRING SIZE(0..256)
-}
+ }}
Name ::= SEQUENCE OF RelativeDistinguishedName
diff --git a/tests/19-param-OK.asn1.-P b/tests/19-param-OK.asn1.-P
index 321e71a2..272cceec 100644
--- a/tests/19-param-OK.asn1.-P
+++ b/tests/19-param-OK.asn1.-P
@@ -1,5 +1,5 @@
-/*** <<< INCLUDES [Certificate] >>> ***/
+/*** <<< INCLUDES [SIGNED] >>> ***/
#include <OBJECT_IDENTIFIER.h>
#include <BIT_STRING.h>
@@ -7,9 +7,9 @@
#include <Name.h>
#include <constr_SEQUENCE.h>
-/*** <<< TYPE-DECLS [Certificate] >>> ***/
+/*** <<< TYPE-DECLS [SIGNED] >>> ***/
-typedef struct Certificate {
+typedef struct SIGNED_15P0 {
struct toBeSigned {
INTEGER_t version;
OBJECT_IDENTIFIER_t signature;
@@ -23,13 +23,13 @@ typedef struct Certificate {
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
-} Certificate_t;
+} SIGNED_15P0_t;
-/*** <<< FUNC-DECLS [Certificate] >>> ***/
+/*** <<< FUNC-DECLS [SIGNED] >>> ***/
-extern asn_TYPE_descriptor_t asn_DEF_Certificate;
+extern asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0;
-/*** <<< CODE [Certificate] >>> ***/
+/*** <<< CODE [SIGNED] >>> ***/
static int
memb_signature_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
@@ -63,7 +63,7 @@ memb_signature_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
}
-/*** <<< STAT-DEFS [Certificate] >>> ***/
+/*** <<< STAT-DEFS [SIGNED] >>> ***/
static asn_TYPE_member_t asn_MBR_toBeSigned_2[] = {
{ ATF_NOFLAGS, 0, offsetof(struct toBeSigned, version),
@@ -136,8 +136,8 @@ asn_TYPE_descriptor_t asn_DEF_toBeSigned_2 = {
&asn_SPC_toBeSigned_specs_2 /* Additional specs */
};
-static asn_TYPE_member_t asn_MBR_Certificate_1[] = {
- { ATF_NOFLAGS, 0, offsetof(struct Certificate, toBeSigned),
+static asn_TYPE_member_t asn_MBR_SIGNED_15P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, toBeSigned),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
.type = &asn_DEF_toBeSigned_2,
@@ -146,7 +146,7 @@ static asn_TYPE_member_t asn_MBR_Certificate_1[] = {
.default_value = 0,
.name = "toBeSigned"
},
- { ATF_NOFLAGS, 0, offsetof(struct Certificate, algorithm),
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, algorithm),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
.tag_mode = 0,
.type = &asn_DEF_OBJECT_IDENTIFIER,
@@ -155,7 +155,7 @@ static asn_TYPE_member_t asn_MBR_Certificate_1[] = {
.default_value = 0,
.name = "algorithm"
},
- { ATF_NOFLAGS, 0, offsetof(struct Certificate, signature),
+ { ATF_NOFLAGS, 0, offsetof(struct SIGNED_15P0, signature),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)),
.tag_mode = 0,
.type = &asn_DEF_BIT_STRING,
@@ -165,26 +165,26 @@ static asn_TYPE_member_t asn_MBR_Certificate_1[] = {
.name = "signature"
},
};
-static ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = {
+static ber_tlv_tag_t asn_DEF_SIGNED_15P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
-static asn_TYPE_tag2member_t asn_MAP_Certificate_tag2el_1[] = {
+static asn_TYPE_tag2member_t asn_MAP_SIGNED_15P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 2, 0, 0 }, /* signature at 17 */
{ (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 1, 0, 0 }, /* algorithm at 16 */
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* toBeSigned at 21 */
};
-static asn_SEQUENCE_specifics_t asn_SPC_Certificate_specs_1 = {
- sizeof(struct Certificate),
- offsetof(struct Certificate, _asn_ctx),
- asn_MAP_Certificate_tag2el_1,
+static asn_SEQUENCE_specifics_t asn_SPC_SIGNED_15P0_specs_1 = {
+ sizeof(struct SIGNED_15P0),
+ offsetof(struct SIGNED_15P0, _asn_ctx),
+ asn_MAP_SIGNED_15P0_tag2el_1,
3, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
-asn_TYPE_descriptor_t asn_DEF_Certificate = {
- "Certificate",
- "Certificate",
+asn_TYPE_descriptor_t asn_DEF_SIGNED_15P0 = {
+ "SIGNED",
+ "SIGNED",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
@@ -194,6 +194,130 @@ asn_TYPE_descriptor_t asn_DEF_Certificate = {
SEQUENCE_encode_xer,
0, /* No PER decoder, -gen-PER to enable */
0, /* Use generic outmost tag fetcher */
+ asn_DEF_SIGNED_15P0_tags_1,
+ sizeof(asn_DEF_SIGNED_15P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
+ asn_DEF_SIGNED_15P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_SIGNED_15P0_tags_1)
+ /sizeof(asn_DEF_SIGNED_15P0_tags_1[0]), /* 1 */
+ 0, /* No PER visible constraints */
+ asn_MBR_SIGNED_15P0_1,
+ 3, /* Elements count */
+ &asn_SPC_SIGNED_15P0_specs_1 /* Additional specs */
+};
+
+
+/*** <<< INCLUDES [Certificate] >>> ***/
+
+#include <SIGNED.h>
+
+/*** <<< TYPE-DECLS [Certificate] >>> ***/
+
+typedef SIGNED_15P0_t Certificate_t;
+
+/*** <<< FUNC-DECLS [Certificate] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_Certificate;
+asn_struct_free_f Certificate_free;
+asn_struct_print_f Certificate_print;
+asn_constr_check_f Certificate_constraint;
+ber_type_decoder_f Certificate_decode_ber;
+der_type_encoder_f Certificate_encode_der;
+xer_type_decoder_f Certificate_decode_xer;
+xer_type_encoder_f Certificate_encode_xer;
+
+/*** <<< CODE [Certificate] >>> ***/
+
+int
+Certificate_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
+ asn_app_consume_bytes_f *app_errlog, void *app_key) {
+ /* Replace with underlying type checker */
+ td->check_constraints = asn_DEF_SIGNED_15P0.check_constraints;
+ return td->check_constraints(td, sptr, app_errlog, app_key);
+}
+
+/*
+ * This type is implemented using SIGNED_15P0,
+ * so here we adjust the DEF accordingly.
+ */
+static void
+Certificate_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
+ td->free_struct = asn_DEF_SIGNED_15P0.free_struct;
+ td->print_struct = asn_DEF_SIGNED_15P0.print_struct;
+ td->ber_decoder = asn_DEF_SIGNED_15P0.ber_decoder;
+ td->der_encoder = asn_DEF_SIGNED_15P0.der_encoder;
+ td->xer_decoder = asn_DEF_SIGNED_15P0.xer_decoder;
+ td->xer_encoder = asn_DEF_SIGNED_15P0.xer_encoder;
+ td->uper_decoder = asn_DEF_SIGNED_15P0.uper_decoder;
+ if(!td->per_constraints)
+ td->per_constraints = asn_DEF_SIGNED_15P0.per_constraints;
+ td->elements = asn_DEF_SIGNED_15P0.elements;
+ td->elements_count = asn_DEF_SIGNED_15P0.elements_count;
+ td->specifics = asn_DEF_SIGNED_15P0.specifics;
+}
+
+void
+Certificate_free(asn_TYPE_descriptor_t *td,
+ void *struct_ptr, int contents_only) {
+ Certificate_1_inherit_TYPE_descriptor(td);
+ td->free_struct(td, struct_ptr, contents_only);
+}
+
+int
+Certificate_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
+ int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
+ Certificate_1_inherit_TYPE_descriptor(td);
+ return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
+}
+
+asn_dec_rval_t
+Certificate_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const void *bufptr, size_t size, int tag_mode) {
+ Certificate_1_inherit_TYPE_descriptor(td);
+ return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
+}
+
+asn_enc_rval_t
+Certificate_encode_der(asn_TYPE_descriptor_t *td,
+ void *structure, int tag_mode, ber_tlv_tag_t tag,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ Certificate_1_inherit_TYPE_descriptor(td);
+ return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
+}
+
+asn_dec_rval_t
+Certificate_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
+ void **structure, const char *opt_mname, const void *bufptr, size_t size) {
+ Certificate_1_inherit_TYPE_descriptor(td);
+ return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
+}
+
+asn_enc_rval_t
+Certificate_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
+ int ilevel, enum xer_encoder_flags_e flags,
+ asn_app_consume_bytes_f *cb, void *app_key) {
+ Certificate_1_inherit_TYPE_descriptor(td);
+ return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
+}
+
+
+/*** <<< STAT-DEFS [Certificate] >>> ***/
+
+static ber_tlv_tag_t asn_DEF_Certificate_tags_1[] = {
+ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
+};
+asn_TYPE_descriptor_t asn_DEF_Certificate = {
+ "Certificate",
+ "Certificate",
+ Certificate_free,
+ Certificate_print,
+ Certificate_constraint,
+ Certificate_decode_ber,
+ Certificate_encode_der,
+ Certificate_decode_xer,
+ Certificate_encode_xer,
+ 0, /* No PER decoder, -gen-PER to enable */
+ 0, /* Use generic outmost tag fetcher */
asn_DEF_Certificate_tags_1,
sizeof(asn_DEF_Certificate_tags_1)
/sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
@@ -201,9 +325,8 @@ asn_TYPE_descriptor_t asn_DEF_Certificate = {
sizeof(asn_DEF_Certificate_tags_1)
/sizeof(asn_DEF_Certificate_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
- asn_MBR_Certificate_1,
- 3, /* Elements count */
- &asn_SPC_Certificate_specs_1 /* Additional specs */
+ 0, 0, /* Defined elsewhere */
+ 0 /* No specifics */
};
diff --git a/tests/58-param-OK.asn1.-EF b/tests/58-param-OK.asn1.-EF
index c07b79d4..9258e5b2 100644
--- a/tests/58-param-OK.asn1.-EF
+++ b/tests/58-param-OK.asn1.-EF
@@ -8,10 +8,7 @@ DirectoryString{INTEGER:maxSize} ::= CHOICE {
utf8String UTF8String (SIZE(1..maxSize))
}
-DS1 ::= CHOICE {
- teletexString TeletexString (SIZE(1..128)),
- utf8String UTF8String (SIZE(1..128))
-}
+DS1 ::= DirectoryString{ub-name}
ub-name INTEGER ::= 128
diff --git a/tests/84-param-tags-OK.asn1.-EF b/tests/84-param-tags-OK.asn1.-EF
index 0a902fb0..b5889ae1 100644
--- a/tests/84-param-tags-OK.asn1.-EF
+++ b/tests/84-param-tags-OK.asn1.-EF
@@ -8,12 +8,8 @@ TestType{Parameter} ::= SEQUENCE {
}
TestChoice ::= CHOICE {
- type1 SEQUENCE {
- common INTEGER (1..10) DEFAULT 0
- },
- type2 [0] IMPLICIT SEQUENCE {
- common BOOLEAN DEFAULT 0
- }
+ type1 TestType{ INTEGER (1..10)},
+ type2 [0] IMPLICIT TestType{ BOOLEAN}
}
END
@@ -28,12 +24,8 @@ AutoType{Parameter} ::= SEQUENCE {
}
AutoChoice ::= CHOICE {
- type1 [0] IMPLICIT SEQUENCE {
- common [0] IMPLICIT INTEGER ((0..1))((0))
- },
- type2 [1] IMPLICIT SEQUENCE {
- common [0] IMPLICIT BOOLEAN (0)
- }
+ type1 [0] IMPLICIT AutoType{ INTEGER (0..1)},
+ type2 [1] IMPLICIT AutoType{ BOOLEAN}
}
END
diff --git a/tests/84-param-tags-OK.asn1.-P b/tests/84-param-tags-OK.asn1.-P
index f7353dbf..8e48c258 100644
--- a/tests/84-param-tags-OK.asn1.-P
+++ b/tests/84-param-tags-OK.asn1.-P
@@ -1,50 +1,34 @@
-/*** <<< INCLUDES [TestChoice] >>> ***/
+/*** <<< INCLUDES [TestType] >>> ***/
#include <NativeInteger.h>
#include <constr_SEQUENCE.h>
#include <BOOLEAN.h>
-#include <constr_CHOICE.h>
-/*** <<< DEPS [TestChoice] >>> ***/
+/*** <<< TYPE-DECLS [TestType] >>> ***/
-typedef enum TestChoice_PR {
- TestChoice_PR_NOTHING, /* No components present */
- TestChoice_PR_type1,
- TestChoice_PR_type2,
-} TestChoice_PR;
-
-/*** <<< TYPE-DECLS [TestChoice] >>> ***/
-
-typedef struct TestChoice {
- TestChoice_PR present;
- union TestChoice_u {
- struct type1 {
- long common /* DEFAULT 0 */;
-
- /* Context for parsing across buffer boundaries */
- asn_struct_ctx_t _asn_ctx;
- } type1;
- struct type2 {
- BOOLEAN_t common /* DEFAULT 0 */;
-
- /* Context for parsing across buffer boundaries */
- asn_struct_ctx_t _asn_ctx;
- } type2;
- } choice;
+typedef struct TestType_16P0 {
+ long common;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
-} TestChoice_t;
+} TestType_16P0_t;
+typedef struct TestType_16P1 {
+ BOOLEAN_t common;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TestType_16P1_t;
-/*** <<< FUNC-DECLS [TestChoice] >>> ***/
+/*** <<< FUNC-DECLS [TestType] >>> ***/
-extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
+extern asn_TYPE_descriptor_t asn_DEF_TestType_16P0;
+extern asn_TYPE_descriptor_t asn_DEF_TestType_16P1;
-/*** <<< CODE [TestChoice] >>> ***/
+/*** <<< CODE [TestType] >>> ***/
static int
-memb_common_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
+memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_consume_bytes_f *app_errlog, void *app_key) {
long value;
@@ -69,50 +53,37 @@ memb_common_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
}
-/*** <<< STAT-DEFS [TestChoice] >>> ***/
+/*** <<< STAT-DEFS [TestType] >>> ***/
-static int asn_DFL_3_set_0(void **sptr) {
- long *st = *sptr;
-
- if(!st) {
- st = (*sptr = CALLOC(1, sizeof(*st)));
- if(!st) return -1;
- }
-
- /* Install default value 0 */
- *st = 0;
- return 0;
-}
-static asn_TYPE_member_t asn_MBR_type1_2[] = {
- { ATF_NOFLAGS, 1, offsetof(struct type1, common),
+static asn_TYPE_member_t asn_MBR_TestType_16P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct TestType_16P0, common),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
- .memb_constraints = memb_common_constraint_2,
+ .memb_constraints = memb_common_constraint_1,
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
- .default_value = asn_DFL_3_set_0, /* DEFAULT 0 */
+ .default_value = 0,
.name = "common"
},
};
-static ber_tlv_tag_t asn_DEF_type1_tags_2[] = {
+static ber_tlv_tag_t asn_DEF_TestType_16P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
-static asn_TYPE_tag2member_t asn_MAP_type1_tag2el_2[] = {
+static asn_TYPE_tag2member_t asn_MAP_TestType_16P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* common at 20 */
};
-static asn_SEQUENCE_specifics_t asn_SPC_type1_specs_2 = {
- sizeof(struct type1),
- offsetof(struct type1, _asn_ctx),
- asn_MAP_type1_tag2el_2,
+static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P0_specs_1 = {
+ sizeof(struct TestType_16P0),
+ offsetof(struct TestType_16P0, _asn_ctx),
+ asn_MAP_TestType_16P0_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
-static /* Use -fall-defs-global to expose */
-asn_TYPE_descriptor_t asn_DEF_type1_2 = {
- "type1",
- "type1",
+asn_TYPE_descriptor_t asn_DEF_TestType_16P0 = {
+ "TestType",
+ "TestType",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
@@ -122,61 +93,47 @@ asn_TYPE_descriptor_t asn_DEF_type1_2 = {
SEQUENCE_encode_xer,
0, /* No PER decoder, -gen-PER to enable */
0, /* Use generic outmost tag fetcher */
- asn_DEF_type1_tags_2,
- sizeof(asn_DEF_type1_tags_2)
- /sizeof(asn_DEF_type1_tags_2[0]), /* 1 */
- asn_DEF_type1_tags_2, /* Same as above */
- sizeof(asn_DEF_type1_tags_2)
- /sizeof(asn_DEF_type1_tags_2[0]), /* 1 */
+ asn_DEF_TestType_16P0_tags_1,
+ sizeof(asn_DEF_TestType_16P0_tags_1)
+ /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
+ asn_DEF_TestType_16P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_TestType_16P0_tags_1)
+ /sizeof(asn_DEF_TestType_16P0_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
- asn_MBR_type1_2,
+ asn_MBR_TestType_16P0_1,
1, /* Elements count */
- &asn_SPC_type1_specs_2 /* Additional specs */
+ &asn_SPC_TestType_16P0_specs_1 /* Additional specs */
};
-static int asn_DFL_5_set_0(void **sptr) {
- BOOLEAN_t *st = *sptr;
-
- if(!st) {
- st = (*sptr = CALLOC(1, sizeof(*st)));
- if(!st) return -1;
- }
-
- /* Install default value 0 */
- *st = 0;
- return 0;
-}
-static asn_TYPE_member_t asn_MBR_type2_4[] = {
- { ATF_NOFLAGS, 1, offsetof(struct type2, common),
+static asn_TYPE_member_t asn_MBR_TestType_16P1_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct TestType_16P1, common),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)),
.tag_mode = 0,
.type = &asn_DEF_BOOLEAN,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
- .default_value = asn_DFL_5_set_0, /* DEFAULT 0 */
+ .default_value = 0,
.name = "common"
},
};
-static ber_tlv_tag_t asn_DEF_type2_tags_4[] = {
- (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+static ber_tlv_tag_t asn_DEF_TestType_16P1_tags_3[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
-static asn_TYPE_tag2member_t asn_MAP_type2_tag2el_4[] = {
+static asn_TYPE_tag2member_t asn_MAP_TestType_16P1_tag2el_3[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 } /* common at 21 */
};
-static asn_SEQUENCE_specifics_t asn_SPC_type2_specs_4 = {
- sizeof(struct type2),
- offsetof(struct type2, _asn_ctx),
- asn_MAP_type2_tag2el_4,
+static asn_SEQUENCE_specifics_t asn_SPC_TestType_16P1_specs_3 = {
+ sizeof(struct TestType_16P1),
+ offsetof(struct TestType_16P1, _asn_ctx),
+ asn_MAP_TestType_16P1_tag2el_3,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
-static /* Use -fall-defs-global to expose */
-asn_TYPE_descriptor_t asn_DEF_type2_4 = {
- "type2",
- "type2",
+asn_TYPE_descriptor_t asn_DEF_TestType_16P1 = {
+ "TestType",
+ "TestType",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
@@ -186,23 +143,56 @@ asn_TYPE_descriptor_t asn_DEF_type2_4 = {
SEQUENCE_encode_xer,
0, /* No PER decoder, -gen-PER to enable */
0, /* Use generic outmost tag fetcher */
- asn_DEF_type2_tags_4,
- sizeof(asn_DEF_type2_tags_4)
- /sizeof(asn_DEF_type2_tags_4[0]) - 1, /* 1 */
- asn_DEF_type2_tags_4, /* Same as above */
- sizeof(asn_DEF_type2_tags_4)
- /sizeof(asn_DEF_type2_tags_4[0]), /* 2 */
+ asn_DEF_TestType_16P1_tags_3,
+ sizeof(asn_DEF_TestType_16P1_tags_3)
+ /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
+ asn_DEF_TestType_16P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_TestType_16P1_tags_3)
+ /sizeof(asn_DEF_TestType_16P1_tags_3[0]), /* 1 */
0, /* No PER visible constraints */
- asn_MBR_type2_4,
+ asn_MBR_TestType_16P1_3,
1, /* Elements count */
- &asn_SPC_type2_specs_4 /* Additional specs */
+ &asn_SPC_TestType_16P1_specs_3 /* Additional specs */
};
+
+/*** <<< INCLUDES [TestChoice] >>> ***/
+
+#include <TestType.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [TestChoice] >>> ***/
+
+typedef enum TestChoice_PR {
+ TestChoice_PR_NOTHING, /* No components present */
+ TestChoice_PR_type1,
+ TestChoice_PR_type2,
+} TestChoice_PR;
+
+/*** <<< TYPE-DECLS [TestChoice] >>> ***/
+
+typedef struct TestChoice {
+ TestChoice_PR present;
+ union TestChoice_u {
+ TestType_16P0_t type1;
+ TestType_16P1_t type2;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} TestChoice_t;
+
+/*** <<< FUNC-DECLS [TestChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_TestChoice;
+
+/*** <<< STAT-DEFS [TestChoice] >>> ***/
+
static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type1),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
.tag_mode = 0,
- .type = &asn_DEF_type1_2,
+ .type = &asn_DEF_TestType_16P0,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
@@ -211,7 +201,7 @@ static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct TestChoice, choice.type2),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
- .type = &asn_DEF_type2_4,
+ .type = &asn_DEF_TestType_16P1,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
@@ -219,8 +209,8 @@ static asn_TYPE_member_t asn_MBR_TestChoice_1[] = {
},
};
static asn_TYPE_tag2member_t asn_MAP_TestChoice_tag2el_1[] = {
- { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 at 16 */
- { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 at 16 */
+ { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* type1 at 20 */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 1, 0, 0 } /* type2 at 21 */
};
static asn_CHOICE_specifics_t asn_SPC_TestChoice_specs_1 = {
sizeof(struct TestChoice),
@@ -255,52 +245,36 @@ asn_TYPE_descriptor_t asn_DEF_TestChoice = {
};
-/*** <<< INCLUDES [AutoChoice] >>> ***/
+/*** <<< INCLUDES [AutoType] >>> ***/
#include <NativeInteger.h>
#include <constr_SEQUENCE.h>
#include <BOOLEAN.h>
-#include <constr_CHOICE.h>
-/*** <<< DEPS [AutoChoice] >>> ***/
+/*** <<< TYPE-DECLS [AutoType] >>> ***/
-typedef enum AutoChoice_PR {
- AutoChoice_PR_NOTHING, /* No components present */
- AutoChoice_PR_type1,
- AutoChoice_PR_type2,
-} AutoChoice_PR;
-
-/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
-
-typedef struct AutoChoice {
- AutoChoice_PR present;
- union AutoChoice_u {
- struct type1 {
- long common;
-
- /* Context for parsing across buffer boundaries */
- asn_struct_ctx_t _asn_ctx;
- } type1;
- struct type2 {
- BOOLEAN_t common;
-
- /* Context for parsing across buffer boundaries */
- asn_struct_ctx_t _asn_ctx;
- } type2;
- } choice;
+typedef struct AutoType_34P0 {
+ long common;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
-} AutoChoice_t;
+} AutoType_34P0_t;
+typedef struct AutoType_34P1 {
+ BOOLEAN_t common;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} AutoType_34P1_t;
-/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
+/*** <<< FUNC-DECLS [AutoType] >>> ***/
-extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
+extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P0;
+extern asn_TYPE_descriptor_t asn_DEF_AutoType_34P1;
-/*** <<< CODE [AutoChoice] >>> ***/
+/*** <<< CODE [AutoType] >>> ***/
static int
-memb_common_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
+memb_common_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_consume_bytes_f *app_errlog, void *app_key) {
long value;
@@ -325,7 +299,7 @@ memb_common_constraint_2(asn_TYPE_descriptor_t *td, const void *sptr,
}
static int
-memb_common_constraint_4(asn_TYPE_descriptor_t *td, const void *sptr,
+memb_common_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_consume_bytes_f *app_errlog, void *app_key) {
BOOLEAN_t value;
@@ -350,39 +324,37 @@ memb_common_constraint_4(asn_TYPE_descriptor_t *td, const void *sptr,
}
-/*** <<< STAT-DEFS [AutoChoice] >>> ***/
+/*** <<< STAT-DEFS [AutoType] >>> ***/
-static asn_TYPE_member_t asn_MBR_type1_2[] = {
- { ATF_NOFLAGS, 0, offsetof(struct type1, common),
+static asn_TYPE_member_t asn_MBR_AutoType_34P0_1[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P0, common),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_NativeInteger,
- .memb_constraints = memb_common_constraint_2,
+ .memb_constraints = memb_common_constraint_1,
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
.name = "common"
},
};
-static ber_tlv_tag_t asn_DEF_type1_tags_2[] = {
- (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+static ber_tlv_tag_t asn_DEF_AutoType_34P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
-static asn_TYPE_tag2member_t asn_MAP_type1_tag2el_2[] = {
+static asn_TYPE_tag2member_t asn_MAP_AutoType_34P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common at 37 */
};
-static asn_SEQUENCE_specifics_t asn_SPC_type1_specs_2 = {
- sizeof(struct type1),
- offsetof(struct type1, _asn_ctx),
- asn_MAP_type1_tag2el_2,
+static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P0_specs_1 = {
+ sizeof(struct AutoType_34P0),
+ offsetof(struct AutoType_34P0, _asn_ctx),
+ asn_MAP_AutoType_34P0_tag2el_1,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
-static /* Use -fall-defs-global to expose */
-asn_TYPE_descriptor_t asn_DEF_type1_2 = {
- "type1",
- "type1",
+asn_TYPE_descriptor_t asn_DEF_AutoType_34P0 = {
+ "AutoType",
+ "AutoType",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
@@ -392,49 +364,47 @@ asn_TYPE_descriptor_t asn_DEF_type1_2 = {
SEQUENCE_encode_xer,
0, /* No PER decoder, -gen-PER to enable */
0, /* Use generic outmost tag fetcher */
- asn_DEF_type1_tags_2,
- sizeof(asn_DEF_type1_tags_2)
- /sizeof(asn_DEF_type1_tags_2[0]) - 1, /* 1 */
- asn_DEF_type1_tags_2, /* Same as above */
- sizeof(asn_DEF_type1_tags_2)
- /sizeof(asn_DEF_type1_tags_2[0]), /* 2 */
+ asn_DEF_AutoType_34P0_tags_1,
+ sizeof(asn_DEF_AutoType_34P0_tags_1)
+ /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
+ asn_DEF_AutoType_34P0_tags_1, /* Same as above */
+ sizeof(asn_DEF_AutoType_34P0_tags_1)
+ /sizeof(asn_DEF_AutoType_34P0_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
- asn_MBR_type1_2,
+ asn_MBR_AutoType_34P0_1,
1, /* Elements count */
- &asn_SPC_type1_specs_2 /* Additional specs */
+ &asn_SPC_AutoType_34P0_specs_1 /* Additional specs */
};
-static asn_TYPE_member_t asn_MBR_type2_4[] = {
- { ATF_NOFLAGS, 0, offsetof(struct type2, common),
+static asn_TYPE_member_t asn_MBR_AutoType_34P1_3[] = {
+ { ATF_NOFLAGS, 0, offsetof(struct AutoType_34P1, common),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
.type = &asn_DEF_BOOLEAN,
- .memb_constraints = memb_common_constraint_4,
+ .memb_constraints = memb_common_constraint_3,
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
.name = "common"
},
};
-static ber_tlv_tag_t asn_DEF_type2_tags_4[] = {
- (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
+static ber_tlv_tag_t asn_DEF_AutoType_34P1_tags_3[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
-static asn_TYPE_tag2member_t asn_MAP_type2_tag2el_4[] = {
+static asn_TYPE_tag2member_t asn_MAP_AutoType_34P1_tag2el_3[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 } /* common at 38 */
};
-static asn_SEQUENCE_specifics_t asn_SPC_type2_specs_4 = {
- sizeof(struct type2),
- offsetof(struct type2, _asn_ctx),
- asn_MAP_type2_tag2el_4,
+static asn_SEQUENCE_specifics_t asn_SPC_AutoType_34P1_specs_3 = {
+ sizeof(struct AutoType_34P1),
+ offsetof(struct AutoType_34P1, _asn_ctx),
+ asn_MAP_AutoType_34P1_tag2el_3,
1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
-static /* Use -fall-defs-global to expose */
-asn_TYPE_descriptor_t asn_DEF_type2_4 = {
- "type2",
- "type2",
+asn_TYPE_descriptor_t asn_DEF_AutoType_34P1 = {
+ "AutoType",
+ "AutoType",
SEQUENCE_free,
SEQUENCE_print,
SEQUENCE_constraint,
@@ -444,23 +414,56 @@ asn_TYPE_descriptor_t asn_DEF_type2_4 = {
SEQUENCE_encode_xer,
0, /* No PER decoder, -gen-PER to enable */
0, /* Use generic outmost tag fetcher */
- asn_DEF_type2_tags_4,
- sizeof(asn_DEF_type2_tags_4)
- /sizeof(asn_DEF_type2_tags_4[0]) - 1, /* 1 */
- asn_DEF_type2_tags_4, /* Same as above */
- sizeof(asn_DEF_type2_tags_4)
- /sizeof(asn_DEF_type2_tags_4[0]), /* 2 */
+ asn_DEF_AutoType_34P1_tags_3,
+ sizeof(asn_DEF_AutoType_34P1_tags_3)
+ /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
+ asn_DEF_AutoType_34P1_tags_3, /* Same as above */
+ sizeof(asn_DEF_AutoType_34P1_tags_3)
+ /sizeof(asn_DEF_AutoType_34P1_tags_3[0]), /* 1 */
0, /* No PER visible constraints */
- asn_MBR_type2_4,
+ asn_MBR_AutoType_34P1_3,
1, /* Elements count */
- &asn_SPC_type2_specs_4 /* Additional specs */
+ &asn_SPC_AutoType_34P1_specs_3 /* Additional specs */
};
+
+/*** <<< INCLUDES [AutoChoice] >>> ***/
+
+#include <AutoType.h>
+#include <constr_CHOICE.h>
+
+/*** <<< DEPS [AutoChoice] >>> ***/
+
+typedef enum AutoChoice_PR {
+ AutoChoice_PR_NOTHING, /* No components present */
+ AutoChoice_PR_type1,
+ AutoChoice_PR_type2,
+} AutoChoice_PR;
+
+/*** <<< TYPE-DECLS [AutoChoice] >>> ***/
+
+typedef struct AutoChoice {
+ AutoChoice_PR present;
+ union AutoChoice_u {
+ AutoType_34P0_t type1;
+ AutoType_34P1_t type2;
+ } choice;
+
+ /* Context for parsing across buffer boundaries */
+ asn_struct_ctx_t _asn_ctx;
+} AutoChoice_t;
+
+/*** <<< FUNC-DECLS [AutoChoice] >>> ***/
+
+extern asn_TYPE_descriptor_t asn_DEF_AutoChoice;
+
+/*** <<< STAT-DEFS [AutoChoice] >>> ***/
+
static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type1),
.tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
- .type = &asn_DEF_type1_2,
+ .type = &asn_DEF_AutoType_34P0,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
@@ -469,7 +472,7 @@ static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct AutoChoice, choice.type2),
.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
.tag_mode = -1, /* IMPLICIT tag at current level */
- .type = &asn_DEF_type2_4,
+ .type = &asn_DEF_AutoType_34P1,
.memb_constraints = 0, /* Defer constraints checking to the member type */
.per_constraints = 0, /* PER is not compiled, use -gen-PER */
.default_value = 0,
@@ -477,8 +480,8 @@ static asn_TYPE_member_t asn_MBR_AutoChoice_1[] = {
},
};
static asn_TYPE_tag2member_t asn_MAP_AutoChoice_tag2el_1[] = {
- { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 at 34 */
- { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 at 34 */
+ { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* type1 at 37 */
+ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* type2 at 38 */
};
static asn_CHOICE_specifics_t asn_SPC_AutoChoice_specs_1 = {
sizeof(struct AutoChoice),