diff options
author | Lev Walkin <vlm@lionet.info> | 2005-02-18 16:34:21 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2005-02-18 16:34:21 +0000 |
commit | c8092cb2609dcb57396fe27c2adfcdba59d9d901 (patch) | |
tree | d7ecf24559c5bbaf9a6e1a12e1fa95c3e4b422e4 /libasn1parser/asn1p_y.y | |
parent | 843a24604b3ed5631cce24a13e925c7bfc76f821 (diff) |
ContainedSubtype parsing
Diffstat (limited to 'libasn1parser/asn1p_y.y')
-rw-r--r-- | libasn1parser/asn1p_y.y | 55 |
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); } ; |