aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1parser/asn1p_y.y
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-10-12 23:26:53 +0000
committerLev Walkin <vlm@lionet.info>2004-10-12 23:26:53 +0000
commit144db9ba4ff5b048fa49274ef5d25d67f216deb3 (patch)
tree133a6387c9b703c3d3982c6a800ec153521d4eea /libasn1parser/asn1p_y.y
parentbbd9325d2e67d0b6881a6716d2dcf538833e6320 (diff)
small fixes
Diffstat (limited to 'libasn1parser/asn1p_y.y')
-rw-r--r--libasn1parser/asn1p_y.y23
1 files changed, 20 insertions, 3 deletions
diff --git a/libasn1parser/asn1p_y.y b/libasn1parser/asn1p_y.y
index 1fe3c910..922f937a 100644
--- a/libasn1parser/asn1p_y.y
+++ b/libasn1parser/asn1p_y.y
@@ -76,7 +76,7 @@ static asn1p_value_t *
asn1p_paramlist_t *a_plist; /* A pargs list */
struct asn1p_expr_marker_s a_marker; /* OPTIONAL/DEFAULT */
enum asn1p_constr_pres_e a_pres; /* PRESENT/ABSENT/OPTIONAL */
- asn1_integer_t a_int;
+ asn1c_integer_t a_int;
char *tv_str;
struct {
char *buf;
@@ -239,6 +239,7 @@ static asn1p_value_t *
%type <a_value> Value
%type <a_value> DefinedValue
%type <a_value> SignedNumber
+%type <a_expr> optComponentTypeLists
%type <a_expr> ComponentTypeLists
%type <a_expr> ComponentType
%type <a_expr> AlternativeTypeLists
@@ -618,6 +619,12 @@ ImportsElement:
$$->Identifier = $1;
$$->expr_type = A1TC_REFERENCE;
}
+ | TypeRefName '{' '}' { /* Completely equivalent to above */
+ $$ = asn1p_expr_new(yylineno);
+ checkmem($$);
+ $$->Identifier = $1;
+ $$->expr_type = A1TC_REFERENCE;
+ }
| Identifier {
$$ = asn1p_expr_new(yylineno);
checkmem($$);
@@ -659,6 +666,12 @@ ExportsElement:
$$->Identifier = $1;
$$->expr_type = A1TC_EXPORTVAR;
}
+ | TypeRefName '{' '}' {
+ $$ = asn1p_expr_new(yylineno);
+ checkmem($$);
+ $$->Identifier = $1;
+ $$->expr_type = A1TC_EXPORTVAR;
+ }
| Identifier {
$$ = asn1p_expr_new(yylineno);
checkmem($$);
@@ -841,6 +854,10 @@ ActualParameter:
/*
* A collection of constructed data type members.
*/
+optComponentTypeLists:
+ { $$ = asn1p_expr_new(yylineno); }
+ | ComponentTypeLists { $$ = $1; };
+
ComponentTypeLists:
ComponentType {
$$ = asn1p_expr_new(yylineno);
@@ -1065,13 +1082,13 @@ TypeDeclaration:
$$->expr_type = ASN_CONSTR_CHOICE;
$$->meta_type = AMT_TYPE;
}
- | TOK_SEQUENCE '{' ComponentTypeLists '}' {
+ | TOK_SEQUENCE '{' optComponentTypeLists '}' {
$$ = $3;
assert($$->expr_type == A1TC_INVALID);
$$->expr_type = ASN_CONSTR_SEQUENCE;
$$->meta_type = AMT_TYPE;
}
- | TOK_SET '{' ComponentTypeLists '}' {
+ | TOK_SET '{' optComponentTypeLists '}' {
$$ = $3;
assert($$->expr_type == A1TC_INVALID);
$$->expr_type = ASN_CONSTR_SET;