ContainedSubtype parsing

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@674 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2005-02-18 16:34:21 +00:00
parent 422e4ce615
commit 4053ca50b2
3 changed files with 909 additions and 846 deletions

View File

@ -31,7 +31,6 @@ typedef enum asn1p_expr_type {
A1TC_REFERENCE, /* Reference to the type defined elsewhere */
A1TC_EXPORTVAR, /* We're exporting this definition */
A1TC_UNIVERVAL, /* A value of an ENUMERATED, INTEGER or BS */
A1TC_BOOLBITPOS, /* A bit position in a BIT STRING */
A1TC_BITVECTOR, /* A plain collection of bits */
A1TC_OPAQUE, /* Opaque data encoded as a bitvector */
A1TC_EXTENSIBLE, /* An extension marker "..." */
@ -122,7 +121,7 @@ typedef struct asn1p_expr_s {
asn1p_expr_type_e expr_type;
/*
* Referenced type, if defined elsewhere.
* Referenced type, defined elsewhere.
* (If expr_type == A1TC_REFERENCE)
*/
asn1p_ref_t *reference;

File diff suppressed because it is too large Load Diff

View File

@ -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);
@ -851,6 +858,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.
*/
@ -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);
| 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($$);
}
| TOK_FALSE {
$$ = asn1p_value_fromint(0);
checkmem($$);
$$->type = ATV_FALSE;
}
| TOK_TRUE {
$$ = asn1p_value_fromint(1);
checkmem($$);
$$->type = ATV_TRUE;
free($1);
}
;