aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1parser/asn1p_y.y
diff options
context:
space:
mode:
Diffstat (limited to 'libasn1parser/asn1p_y.y')
-rw-r--r--libasn1parser/asn1p_y.y55
1 files changed, 42 insertions, 13 deletions
diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y
index 3eb38c1b..e316119a 100644
--- a/libasn1parser/asn1p_y.y
+++ b/libasn1parser/asn1p_y.y
@@ -816,6 +816,13 @@ ParameterArgumentName:
checkmem(ret == 0);
$$.argument = $3;
}
+ | TypeRefName ':' TypeRefName {
+ int ret;
+ $$.governor = asn1p_ref_new(yylineno);
+ ret = asn1p_ref_add_component($$.governor, $1, 0);
+ checkmem(ret == 0);
+ $$.argument = $3;
+ }
| BasicTypeId ':' Identifier {
int ret;
$$.governor = asn1p_ref_new(yylineno);
@@ -852,6 +859,17 @@ ActualParameter:
;
/*
+ | '{' ActualParameter '}' {
+ $$ = asn1p_expr_new(yylineno);
+ checkmem($$);
+ asn1p_expr_add($$, $2);
+ $$->expr_type = A1TC_PARAMETRIZED;
+ $$->meta_type = AMT_TYPE;
+ }
+ ;
+*/
+
+/*
* A collection of constructed data type members.
*/
optComponentTypeLists:
@@ -1622,9 +1640,23 @@ ConstraintSpec:
;
ConstraintValue:
- SignedNumber {
+ TOK_FALSE {
+ $$ = asn1p_value_fromint(0);
+ checkmem($$);
+ $$->type = ATV_FALSE;
+ }
+ | TOK_TRUE {
+ $$ = asn1p_value_fromint(1);
+ checkmem($$);
+ $$->type = ATV_TRUE;
+ }
+ | SignedNumber {
$$ = $1;
}
+ | TOK_cstring {
+ $$ = asn1p_value_frombuf($1.buf, $1.len, 0);
+ checkmem($$);
+ }
| Identifier {
asn1p_ref_t *ref;
int ret;
@@ -1636,19 +1668,16 @@ ConstraintValue:
checkmem($$);
free($1);
}
- | TOK_cstring {
- $$ = asn1p_value_frombuf($1.buf, $1.len, 0);
- checkmem($$);
- }
- | TOK_FALSE {
- $$ = asn1p_value_fromint(0);
- checkmem($$);
- $$->type = ATV_FALSE;
- }
- | TOK_TRUE {
- $$ = asn1p_value_fromint(1);
+ | TypeRefName {
+ asn1p_ref_t *ref;
+ int ret;
+ ref = asn1p_ref_new(yylineno);
+ checkmem(ref);
+ ret = asn1p_ref_add_component(ref, $1, RLT_UNKNOWN);
+ checkmem(ret == 0);
+ $$ = asn1p_value_fromref(ref, 0);
checkmem($$);
- $$->type = ATV_TRUE;
+ free($1);
}
;