mirror of https://gerrit.osmocom.org/asn1c
bit string value constraints parsing
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1265 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
parent
cf3584e9a8
commit
64aaa9ef29
File diff suppressed because it is too large
Load Diff
|
@ -281,6 +281,7 @@ static asn1p_module_t *currentModule;
|
|||
%type <a_value> DefinedValue
|
||||
%type <a_value> SignedNumber
|
||||
%type <a_value> RealValue
|
||||
%type <a_value> BitStringValue
|
||||
%type <a_expr> optComponentTypeLists
|
||||
%type <a_expr> ComponentTypeLists
|
||||
%type <a_expr> ComponentType
|
||||
|
@ -1566,32 +1567,6 @@ RestrictedCharacterStringValue:
|
|||
checkmem($$);
|
||||
$$->type = ATV_QUADRUPLE;
|
||||
}
|
||||
/*
|
||||
| '{' TOK_number ',' TOK_number '}' {
|
||||
asn1c_integer_t v = ($2 << 4) + $4;
|
||||
if($2 > 7) return yyerror("X.680:2003, #37.14 "
|
||||
"mandates 0..7 range for Tuple's TableColumn");
|
||||
if($4 > 15) return yyerror("X.680:2003, #37.14 "
|
||||
"mandates 0..15 range for Tuple's TableRow");
|
||||
$$ = asn1p_value_fromint(v);
|
||||
checkmem($$);
|
||||
$$->type = ATV_TUPLE;
|
||||
}
|
||||
| '{' TOK_number ',' TOK_number ',' TOK_number ',' TOK_number '}' {
|
||||
asn1c_integer_t v = ($2 << 24) | ($4 << 16) | ($6 << 8) | $8;
|
||||
if($2 > 127) return yyerror("X.680:2003, #37.12 "
|
||||
"mandates 0..127 range for Quadruple's Group");
|
||||
if($4 > 255) return yyerror("X.680:2003, #37.12 "
|
||||
"mandates 0..255 range for Quadruple's Plane");
|
||||
if($6 > 255) return yyerror("X.680:2003, #37.12 "
|
||||
"mandates 0..255 range for Quadruple's Row");
|
||||
if($8 > 255) return yyerror("X.680:2003, #37.12 "
|
||||
"mandates 0..255 range for Quadruple's Cell");
|
||||
$$ = asn1p_value_fromint(v);
|
||||
checkmem($$);
|
||||
$$->type = ATV_QUADRUPLE;
|
||||
}
|
||||
*/
|
||||
;
|
||||
|
||||
Opaque:
|
||||
|
@ -1894,6 +1869,7 @@ SingleValue:
|
|||
}
|
||||
| RealValue
|
||||
| RestrictedCharacterStringValue
|
||||
| BitStringValue
|
||||
| Identifier {
|
||||
asn1p_ref_t *ref;
|
||||
int ret;
|
||||
|
@ -1907,6 +1883,17 @@ SingleValue:
|
|||
}
|
||||
;
|
||||
|
||||
BitStringValue:
|
||||
TOK_bstring {
|
||||
$$ = _convert_bitstring2binary($1, 'B');
|
||||
checkmem($$);
|
||||
}
|
||||
| TOK_hstring {
|
||||
$$ = _convert_bitstring2binary($1, 'H');
|
||||
checkmem($$);
|
||||
}
|
||||
;
|
||||
|
||||
ContainedSubtype:
|
||||
TypeRefName {
|
||||
asn1p_ref_t *ref;
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
-- OK: Everything is fine
|
||||
|
||||
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
|
||||
-- .spelio.software.asn1c.test (9363.1.5.1)
|
||||
-- .125
|
||||
|
||||
ModuleBitStringConstraint
|
||||
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
|
||||
spelio(9363) software(1) asn1c(5) test(1) 125 }
|
||||
DEFINITIONS ::=
|
||||
BEGIN
|
||||
|
||||
T ::= BIT STRING { flag1(0), flag2(1), flag3(2) }
|
||||
('000'B | '001'B | '010'B | '011'B)
|
||||
|
||||
|
||||
END
|
Loading…
Reference in New Issue