WITH COMPONENT[S] pretty-printing
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@839 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y
index 815423d..a4842e2 100644
--- a/libasn1parser/asn1p_y.y
+++ b/libasn1parser/asn1p_y.y
@@ -278,7 +278,7 @@
%type <a_constr> ConstraintSubtypeElement /* 1..2 */
%type <a_constr> SimpleTableConstraint
%type <a_constr> TableConstraint
-%type <a_constr> WithComponents
+%type <a_constr> InnerTypeConstraint
%type <a_constr> WithComponentsList
%type <a_constr> WithComponentsElement
%type <a_constr> ComponentRelationConstraint
@@ -1668,7 +1668,7 @@
| TableConstraint {
$$ = $1;
}
- | WithComponents {
+ | InnerTypeConstraint {
$$ = $1;
}
| TOK_CONSTRAINED TOK_BY '{'
@@ -1742,8 +1742,11 @@
}
;
-WithComponents:
- TOK_WITH TOK_COMPONENTS '{' WithComponentsList '}' {
+InnerTypeConstraint:
+ TOK_WITH TOK_COMPONENT SetOfConstraints {
+ CONSTRAINT_INSERT($$, ACT_CT_WCOMP, $3, 0);
+ }
+ | TOK_WITH TOK_COMPONENTS '{' WithComponentsList '}' {
CONSTRAINT_INSERT($$, ACT_CT_WCOMPS, $4, 0);
}
;
@@ -1762,6 +1765,7 @@
$$ = asn1p_constraint_new(yylineno);
checkmem($$);
$$->type = ACT_EL_EXT;
+ $$->value = asn1p_value_frombuf("...", 3, 0);
}
| Identifier optConstraints optPresenceConstraint {
$$ = asn1p_constraint_new(yylineno);
@@ -1769,6 +1773,7 @@
$$->type = ACT_EL_VALUE;
$$->value = asn1p_value_frombuf($1, strlen($1), 0);
$$->presence = $3;
+ if($2) asn1p_constraint_insert($$, $2);
}
;