Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
59165cf2
Commit
59165cf2
authored
7 years ago
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reorganized parsing around constraints
parent
2701dc2a
vlm_master
velichkov_s1ap_plus_option_group
No related merge requests found
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1517 additions
and
1536 deletions
+1517
-1536
libasn1parser/asn1p_y.c
libasn1parser/asn1p_y.c
+1221
-1326
libasn1parser/asn1p_y.h
libasn1parser/asn1p_y.h
+1
-1
libasn1parser/asn1p_y.y
libasn1parser/asn1p_y.y
+119
-146
tests/tests-asn1c-compiler/110-param-3-OK.asn1.-Pfcompound-names
...ests-asn1c-compiler/110-param-3-OK.asn1.-Pfcompound-names
+62
-62
tests/tests-asn1c-compiler/149-with-components-SE.asn1.-E
tests/tests-asn1c-compiler/149-with-components-SE.asn1.-E
+1
-1
tests/tests-asn1c-compiler/151-per-b2110-OK.asn1
tests/tests-asn1c-compiler/151-per-b2110-OK.asn1
+18
-0
tests/tests-asn1c-compiler/151-per-b2110-OK.asn1.-EFprint-constraints
...asn1c-compiler/151-per-b2110-OK.asn1.-EFprint-constraints
+12
-0
tests/tests-asn1c-compiler/152-value-and-type-references-OK.asn1
...ests-asn1c-compiler/152-value-and-type-references-OK.asn1
+43
-0
tests/tests-asn1c-compiler/152-value-and-type-references-OK.asn1.-EF
...-asn1c-compiler/152-value-and-type-references-OK.asn1.-EF
+40
-0
No files found.
libasn1parser/asn1p_y.c
View file @
59165cf2
This source diff could not be displayed because it is too large. You can
view the blob
instead.
This diff is collapsed.
Click to expand it.
libasn1parser/asn1p_y.h
View file @
59165cf2
...
...
@@ -262,7 +262,7 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef
union
YYSTYPE
#line 11
5
"asn1p_y.y"
#line 11
6
"asn1p_y.y"
{
asn1p_t
*
a_grammar
;
asn1p_module_flags_e
a_module_flags
;
...
...
This diff is collapsed.
Click to expand it.
libasn1parser/asn1p_y.y
View file @
59165cf2
...
...
@@ -38,7 +38,8 @@ prefixed_fprintf(FILE *f, const char *fmt, ...) {
}
int yylex(void);
int yyerror(const char *msg);
static int yyerror(const char *msg);
#ifdef YYBYACC
int yyparse(void **param); /* byacc does not produce a prototype */
#endif
...
...
@@ -294,8 +295,13 @@ static asn1p_module_t *currentModule;
%type <a_expr> ExportsElement
%type <a_expr> ExtensionAndException
%type <a_expr> Type
%type <a_expr> TaggedType
%type <a_expr> MaybeIndirectTaggedType
%type <a_expr> UntaggedType
%type <a_expr> DefinedUntaggedType
%type <a_expr> ConcreteTypeDeclaration "concrete TypeDeclaration"
%type <a_expr> TypeDeclaration
%type <a_expr>
TypeDeclarationSet
%type <a_expr>
MaybeIndirectTypeDeclaration
%type <a_ref> ComplexTypeReference
%type <a_ref> ComplexTypeReferenceAmpList
%type <a_refcomp> ComplexTypeReferenceElement
...
...
@@ -331,7 +337,6 @@ static asn1p_module_t *currentModule;
%type <a_expr> IdentifierElement
%type <a_expr> UniverationElement
%type <tv_str> TypeRefName
%type <tv_str> ObjectClassReference
%type <tv_str> Identifier
%type <a_ref> IdentifierAsReference
%type <a_value> IdentifierAsValue
...
...
@@ -345,7 +350,7 @@ static asn1p_module_t *currentModule;
%type <a_oid> optObjectIdentifier /* Optional OID */
%type <a_oid> ObjectIdentifierBody
%type <a_oid_arc> ObjectIdentifierElement
%type <a_expr> B
asic
Type
%type <a_expr> B
uiltin
Type
%type <a_type> BasicTypeId
%type <a_type> BasicTypeId_UniverationCompatible
%type <a_type> BasicString
...
...
@@ -399,7 +404,6 @@ static asn1p_module_t *currentModule;
%type <a_wchunk> WithSyntaxToken
%type <a_marker> optMarker Marker
%type <a_int> optUNIQUE
%type <a_int> optINCLUDES
%type <a_pres> optPresenceConstraint PresenceConstraint
%type <tv_str> ComponentIdList
%type <a_int> NSTD_IndirectMarker
...
...
@@ -818,7 +822,7 @@ ExportsElement:
ValueSet: '{' ElementSetSpecs '}' { $$ = $2; };
ValueSetTypeAssignment:
TypeRefName
Defined
Type TOK_PPEQ ValueSet {
TypeRefName Type TOK_PPEQ ValueSet {
$$ = $2;
assert($$->Identifier == 0);
$$->Identifier = $1;
...
...
@@ -828,9 +832,6 @@ ValueSetTypeAssignment:
;
DefinedType:
BasicType {
$$ = $1;
}
/*
* A DefinedType reference.
* "CLASS1.&id.&id2"
...
...
@@ -841,7 +842,7 @@ DefinedType:
* or
* "Type"
*/
|
ComplexTypeReference {
ComplexTypeReference {
$$ = NEW_EXPR();
checkmem($$);
$$->reference = $1;
...
...
@@ -978,9 +979,7 @@ ActualParameterList:
;
ActualParameter:
Type {
$$ = $1;
}
UntaggedType /* act. Type */
| SimpleValue {
$$ = NEW_EXPR();
checkmem($$);
...
...
@@ -989,16 +988,13 @@ ActualParameter:
$$->meta_type = AMT_VALUE;
$$->value = $1;
}
| Identifier {
asn1p_ref_t *ref;
| DefinedValue {
$$ = NEW_EXPR();
checkmem($$);
$$->Identifier =
$1
;
$$->Identifier =
strdup("?")
;
$$->expr_type = A1TC_REFERENCE;
$$->meta_type = AMT_VALUE;
ref = asn1p_ref_new(yylineno, currentModule);
asn1p_ref_add_component(ref, $1, RLT_lowercase);
$$->value = asn1p_value_fromref(ref, 0);
$$->value = $1;
}
| ValueSet {
$$ = NEW_EXPR();
...
...
@@ -1044,20 +1040,20 @@ ComponentTypeLists:
;
ComponentType:
Identifier Type optMarker {
Identifier
MaybeIndirectTagged
Type optMarker {
$$ = $2;
assert($$->Identifier == 0);
$$->Identifier = $1;
$3.flags |= $$->marker.flags;
$$->marker = $3;
}
| Type optMarker {
|
MaybeIndirectTagged
Type optMarker {
$$ = $1;
$2.flags |= $$->marker.flags;
$$->marker = $2;
_fixup_anonymous_identifier($$);
}
| TOK_COMPONENTS TOK_OF Type {
| TOK_COMPONENTS TOK_OF
MaybeIndirectTagged
Type {
$$ = NEW_EXPR();
checkmem($$);
$$->meta_type = $3->meta_type;
...
...
@@ -1082,7 +1078,7 @@ AlternativeTypeLists:
;
AlternativeType:
Identifier Type {
Identifier
MaybeIndirectTagged
Type {
$$ = $2;
assert($$->Identifier == 0);
$$->Identifier = $1;
...
...
@@ -1090,7 +1086,7 @@ AlternativeType:
| ExtensionAndException {
$$ = $1;
}
| Type {
|
MaybeIndirectTagged
Type {
$$ = $1;
_fixup_anonymous_identifier($$);
}
...
...
@@ -1276,8 +1272,63 @@ ExtensionAndException:
}
;
Type:
optTag TypeDeclaration optManyConstraints {
Type: TaggedType;
TaggedType:
optTag UntaggedType {
$$ = $2;
$$->tag = $1;
}
;
DefinedUntaggedType:
DefinedType optManyConstraints {
$$ = $1;
/*
* Outer constraint for SEQUENCE OF and SET OF applies
* to the inner type.
*/
if($$->expr_type == ASN_CONSTR_SEQUENCE_OF
|| $$->expr_type == ASN_CONSTR_SET_OF) {
assert(!TQ_FIRST(&($$->members))->constraints);
TQ_FIRST(&($$->members))->constraints = $2;
} else {
if($$->constraints) {
assert(!$2);
/* Check this : optManyConstraints is not used ?! */
asn1p_constraint_free($2);
} else {
$$->constraints = $2;
}
}
}
;
UntaggedType:
TypeDeclaration optManyConstraints {
$$ = $1;
/*
* Outer constraint for SEQUENCE OF and SET OF applies
* to the inner type.
*/
if($$->expr_type == ASN_CONSTR_SEQUENCE_OF
|| $$->expr_type == ASN_CONSTR_SET_OF) {
assert(!TQ_FIRST(&($$->members))->constraints);
TQ_FIRST(&($$->members))->constraints = $2;
} else {
if($$->constraints) {
assert(!$2);
/* Check this : optManyConstraints is not used ?! */
asn1p_constraint_free($2);
} else {
$$->constraints = $2;
}
}
}
;
MaybeIndirectTaggedType:
optTag MaybeIndirectTypeDeclaration optManyConstraints {
$$ = $2;
$$->tag = $1;
/*
...
...
@@ -1298,7 +1349,7 @@ Type:
}
}
}
;
;
NSTD_IndirectMarker:
{
...
...
@@ -1307,9 +1358,9 @@ NSTD_IndirectMarker:
}
;
TypeDeclaration:
NSTD_IndirectMarker TypeDeclarationSet
{
$$ = $2;
MaybeIndirect
TypeDeclaration:
NSTD_IndirectMarker TypeDeclaration
{
$$ = $2;
$$->marker.flags |= $1;
if(($$->marker.flags & EM_INDIRECT)
...
...
@@ -1323,13 +1374,15 @@ TypeDeclaration:
ASN_FILENAME, $$->_lineno
);
}
}
;
}
;
TypeDeclarationSet:
DefinedType {
$$ = $1;
}
TypeDeclaration:
ConcreteTypeDeclaration
| DefinedType;
ConcreteTypeDeclaration:
BuiltinType
| TOK_CHOICE '{' AlternativeTypeLists '}' {
$$ = $3;
assert($$->expr_type == A1TC_INVALID);
...
...
@@ -1348,7 +1401,7 @@ TypeDeclarationSet:
$$->expr_type = ASN_CONSTR_SET;
$$->meta_type = AMT_TYPE;
}
| TOK_SEQUENCE optSizeOrConstraint TOK_OF optIdentifier optTag TypeDeclaration {
| TOK_SEQUENCE optSizeOrConstraint TOK_OF optIdentifier optTag
MaybeIndirect
TypeDeclaration {
$$ = NEW_EXPR();
checkmem($$);
$$->constraints = $2;
...
...
@@ -1358,7 +1411,7 @@ TypeDeclarationSet:
$6->tag = $5;
asn1p_expr_add($$, $6);
}
| TOK_SET optSizeOrConstraint TOK_OF optIdentifier optTag TypeDeclaration {
| TOK_SET optSizeOrConstraint TOK_OF optIdentifier optTag
MaybeIndirect
TypeDeclaration {
$$ = NEW_EXPR();
checkmem($$);
$$->constraints = $2;
...
...
@@ -1409,18 +1462,15 @@ ComplexTypeReference:
checkmem(ret == 0);
free($1);
}
| TOK_
typereference '.' TypeRefNam
e {
| TOK_
capitalreferenc
e {
int ret;
$$ = asn1p_ref_new(yylineno, currentModule);
checkmem($$);
ret = asn1p_ref_add_component($$, $1, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component($$, $3, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component($$, $1, RLT_CAPITALS);
free($1);
free($3
);
checkmem(ret == 0
);
}
|
ObjectClassR
eference '.' TypeRefName {
|
TOK_typer
eference '.' TypeRefName {
int ret;
$$ = asn1p_ref_new(yylineno, currentModule);
checkmem($$);
...
...
@@ -1431,26 +1481,18 @@ ComplexTypeReference:
free($1);
free($3);
}
| TOK_
typereference '.' Identifier
{
| TOK_
capitalreference '.' TypeRefName
{
int ret;
$$ = asn1p_ref_new(yylineno, currentModule);
checkmem($$);
ret = asn1p_ref_add_component($$, $1, RLT_UNKNOWN);
checkmem(ret == 0);
ret = asn1p_ref_add_component($$, $3, RLT_
lowercase
);
ret = asn1p_ref_add_component($$, $3, RLT_
UNKNOWN
);
checkmem(ret == 0);
free($1);
free($3);
}
| ObjectClassReference {
int ret;
$$ = asn1p_ref_new(yylineno, currentModule);
checkmem($$);
ret = asn1p_ref_add_component($$, $1, RLT_CAPITALS);
free($1);
checkmem(ret == 0);
}
| ObjectClassReference '.' ComplexTypeReferenceAmpList {
| TOK_capitalreference '.' ComplexTypeReferenceAmpList {
int ret;
$$ = $3;
ret = asn1p_ref_add_component($$, $1, RLT_CAPITALS);
...
...
@@ -1560,66 +1602,37 @@ ValueAssignment:
Value:
SimpleValue
| DefinedValue
| Identifier ':' Value {
$$ = asn1p_value_fromint(0);
checkmem($$);
$$->type = ATV_CHOICE_IDENTIFIER;
$$->value.choice_identifier.identifier = $1;
$$->value.choice_identifier.value = $3;
}
| '{' { asn1p_lexer_hack_push_opaque_state(); } Opaque {
$$ = asn1p_value_frombuf($3.buf, $3.len, 0);
checkmem($$);
$$->type = ATV_UNPARSED;
}
| TOK_NULL {
;
SimpleValue:
TOK_NULL {
$$ = asn1p_value_fromint(0);
checkmem($$);
$$->type = ATV_NULL;
}
;
SimpleValue:
TOK_FALSE {
| TOK_FALSE {
$$ = asn1p_value_fromint(0);
checkmem($$);
$$->type = ATV_FALSE;
}
| TOK_TRUE {
$$ = asn1p_value_fromint(
0
);
$$ = asn1p_value_fromint(
1
);
checkmem($$);
$$->type = ATV_TRUE;
}
| TOK_bstring {
$$ = _convert_bitstring2binary($1, 'B');
checkmem($$);
free($1);
}
| TOK_hstring {
$$ = _convert_bitstring2binary($1, 'H');
checkmem($$);
free($1);
}
| RestrictedCharacterStringValue {
$$ = $$;
}
| SignedNumber {
$$ = $1;
}
| SignedNumber
| RealValue
| RestrictedCharacterStringValue
| BitStringValue
;
DefinedValue:
Identifier {
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno, currentModule);
checkmem(ref);
ret = asn1p_ref_add_component(ref, $1, RLT_lowercase);
checkmem(ret == 0);
$$ = asn1p_value_fromref(ref, 0);
checkmem($$);
free($1);
}
IdentifierAsValue
| TypeRefName '.' Identifier {
asn1p_ref_t *ref;
int ret;
...
...
@@ -1710,7 +1723,7 @@ BasicTypeId_UniverationCompatible:
| TOK_BIT TOK_STRING { $$ = ASN_BASIC_BIT_STRING; }
;
B
asic
Type:
B
uiltin
Type:
BasicTypeId {
$$ = NEW_EXPR();
checkmem($$);
...
...
@@ -1901,13 +1914,6 @@ SubtypeElements:
| InnerTypeConstraints /* WITH COMPONENT[S] ... */
| PatternConstraint /* PATTERN ... */
| ValueRange
| '{' { asn1p_lexer_hack_push_opaque_state(); } Opaque {
$$ = asn1p_constraint_new(yylineno, currentModule);
checkmem($$);
$$->type = ACT_EL_VALUE;
$$->value = asn1p_value_frombuf($3.buf, $3.len, 0);
$$->value->type = ATV_UNPARSED;
}
;
...
...
@@ -1961,32 +1967,7 @@ UpperEndValue:
$$->type = ATV_MAX;
};
SingleValue:
TOK_FALSE {
$$ = asn1p_value_fromint(0);
checkmem($$);
$$->type = ATV_FALSE;
}
| TOK_TRUE {
$$ = asn1p_value_fromint(1);
checkmem($$);
$$->type = ATV_TRUE;
}
| RealValue
| RestrictedCharacterStringValue
| BitStringValue
| Identifier {
asn1p_ref_t *ref;
int ret;
ref = asn1p_ref_new(yylineno, currentModule);
checkmem(ref);
ret = asn1p_ref_add_component(ref, $1, RLT_lowercase);
checkmem(ret == 0);
$$ = asn1p_value_fromref(ref, 0);
checkmem($$);
free($1);
}
;
SingleValue: Value;
BitStringValue:
TOK_bstring {
...
...
@@ -2002,15 +1983,15 @@ BitStringValue:
;
ContainedSubtype:
opt
INCLUDES Type {
TOK_
INCLUDES Type {
$$ = asn1p_value_fromtype($2);
checkmem($$);
}
;
optINCLUDES:
{ $$ = 0; }
| TOK_INCLUDES { $$ = 1;
}
/* Can't put Type here because of conflicts. Simplified subset */
| DefinedUntaggedType {
$$ = asn1p_value_fromtype($1);
checkmem($$);
}
;
/*
...
...
@@ -2403,8 +2384,7 @@ SignedNumber:
;
RealValue:
SignedNumber
| TOK_realnumber {
TOK_realnumber {
$$ = asn1p_value_fromdouble($1);
checkmem($$);
}
...
...
@@ -2477,13 +2457,6 @@ TypeRefName:
;
ObjectClassReference:
TOK_capitalreference {
checkmem($1);
$$ = $1;
}
;
optIdentifier:
{ $$ = 0; }
| Identifier {
...
...
@@ -2648,7 +2621,7 @@ _fixup_anonymous_identifier(asn1p_expr_t *expr) {
expr->Identifier);
}
int
static
int
yyerror(const char *msg) {
extern char *asn1p_text;
fprintf(stderr,
...
...
This diff is collapsed.
Click to expand it.
tests/tests-asn1c-compiler/110-param-3-OK.asn1.-Pfcompound-names
View file @
59165cf2
...
...
@@ -7,41 +7,41 @@
/*** <<< DEPS [Flag] >>> ***/
typedef enum Flag_1
6
P0__field {
Flag_1
6
P0__field_red = 0,
Flag_1
6
P0__field_green = 1,
Flag_1
6
P0__field_blue = 5
} e_Flag_1
6
P0__field;
typedef enum Flag_1
6
P1__field {
Flag_1
6
P1__field_red = 3,
Flag_1
6
P1__field_green = 4,
Flag_1
6
P1__field_blue = 5
} e_Flag_1
6
P1__field;
typedef enum Flag_1
5
P0__field {
Flag_1
5
P0__field_red = 0,
Flag_1
5
P0__field_green = 1,
Flag_1
5
P0__field_blue = 5
} e_Flag_1
5
P0__field;
typedef enum Flag_1
5
P1__field {
Flag_1
5
P1__field_red = 3,
Flag_1
5
P1__field_green = 4,
Flag_1
5
P1__field_blue = 5
} e_Flag_1
5
P1__field;
/*** <<< TYPE-DECLS [Flag] >>> ***/
typedef struct Flag_1
6
P0 {
typedef struct Flag_1
5
P0 {
long *field /* DEFAULT 5 */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Flag_1
6
P0_t;
typedef struct Flag_1
6
P1 {
} Flag_1
5
P0_t;
typedef struct Flag_1
5
P1 {
long *field /* DEFAULT 5 */;
/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} Flag_1
6
P1_t;
} Flag_1
5
P1_t;
/*** <<< FUNC-DECLS [Flag] >>> ***/
extern asn_TYPE_descriptor_t asn_DEF_Flag_1
6
P0;
extern asn_SEQUENCE_specifics_t asn_SPC_Flag_1
6
P0_specs_1;
extern asn_TYPE_member_t asn_MBR_Flag_1
6
P0_1[1];
extern asn_TYPE_descriptor_t asn_DEF_Flag_1
5
P0;
extern asn_SEQUENCE_specifics_t asn_SPC_Flag_1
5
P0_specs_1;
extern asn_TYPE_member_t asn_MBR_Flag_1
5
P0_1[1];
/* extern asn_TYPE_descriptor_t asn_DEF_field_7; // (Use -fall-defs-global to expose) */
extern asn_TYPE_descriptor_t asn_DEF_Flag_1
6
P1;
extern asn_SEQUENCE_specifics_t asn_SPC_Flag_1
6
P1_specs_6;
extern asn_TYPE_member_t asn_MBR_Flag_1
6
P1_6[1];
extern asn_TYPE_descriptor_t asn_DEF_Flag_1
5
P1;
extern asn_SEQUENCE_specifics_t asn_SPC_Flag_1
5
P1_specs_6;
extern asn_TYPE_member_t asn_MBR_Flag_1
5
P1_6[1];
/*** <<< CODE [Flag] >>> ***/
...
...
@@ -70,8 +70,8 @@ static int asn_DFL_2_set_5(int set_value, void **sptr) {
return (*st == 5);
}
}
asn_TYPE_member_t asn_MBR_Flag_1
6
P0_1[] = {
{ ATF_POINTER, 1, offsetof(struct Flag_1
6
P0, field),
asn_TYPE_member_t asn_MBR_Flag_1
5
P0_1[] = {
{ ATF_POINTER, 1, offsetof(struct Flag_1
5
P0, field),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = &asn_DEF_NativeInteger,
...
...
@@ -83,37 +83,37 @@ asn_TYPE_member_t asn_MBR_Flag_16P0_1[] = {
.name = "field"
},
};
static const ber_tlv_tag_t asn_DEF_Flag_1
6
P0_tags_1[] = {
static const ber_tlv_tag_t asn_DEF_Flag_1
5
P0_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Flag_1
6
P0_tag2el_1[] = {
static const asn_TYPE_tag2member_t asn_MAP_Flag_1
5
P0_tag2el_1[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 } /* field */
};
asn_SEQUENCE_specifics_t asn_SPC_Flag_1
6
P0_specs_1 = {
sizeof(struct Flag_1
6
P0),
offsetof(struct Flag_1
6
P0, _asn_ctx),
.tag2el = asn_MAP_Flag_1
6
P0_tag2el_1,
asn_SEQUENCE_specifics_t asn_SPC_Flag_1
5
P0_specs_1 = {
sizeof(struct Flag_1
5
P0),
offsetof(struct Flag_1
5
P0, _asn_ctx),
.tag2el = asn_MAP_Flag_1
5
P0_tag2el_1,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_Flag_1
6
P0 = {
asn_TYPE_descriptor_t asn_DEF_Flag_1
5
P0 = {
"Flag",
"Flag",
&asn_OP_SEQUENCE,
SEQUENCE_constraint,
asn_DEF_Flag_1
6
P0_tags_1,
sizeof(asn_DEF_Flag_1
6
P0_tags_1)
/sizeof(asn_DEF_Flag_1
6
P0_tags_1[0]), /* 1 */
asn_DEF_Flag_1
6
P0_tags_1, /* Same as above */
sizeof(asn_DEF_Flag_1
6
P0_tags_1)
/sizeof(asn_DEF_Flag_1
6
P0_tags_1[0]), /* 1 */
asn_DEF_Flag_1
5
P0_tags_1,
sizeof(asn_DEF_Flag_1
5
P0_tags_1)
/sizeof(asn_DEF_Flag_1
5
P0_tags_1[0]), /* 1 */
asn_DEF_Flag_1
5
P0_tags_1, /* Same as above */
sizeof(asn_DEF_Flag_1
5
P0_tags_1)
/sizeof(asn_DEF_Flag_1
5
P0_tags_1[0]), /* 1 */
0, /* No OER visible constraints */
0, /* No PER visible constraints */
asn_MBR_Flag_1
6
P0_1,
asn_MBR_Flag_1
5
P0_1,
1, /* Elements count */
&asn_SPC_Flag_1
6
P0_specs_1 /* Additional specs */
&asn_SPC_Flag_1
5
P0_specs_1 /* Additional specs */
};
static int asn_DFL_7_set_5(int set_value, void **sptr) {
...
...
@@ -174,8 +174,8 @@ asn_TYPE_descriptor_t asn_DEF_field_7 = {
&asn_SPC_field_specs_7 /* Additional specs */
};
asn_TYPE_member_t asn_MBR_Flag_1
6
P1_6[] = {
{ ATF_POINTER, 1, offsetof(struct Flag_1
6
P1, field),
asn_TYPE_member_t asn_MBR_Flag_1
5
P1_6[] = {
{ ATF_POINTER, 1, offsetof(struct Flag_1
5
P1, field),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
.tag_mode = 0,
.type = &asn_DEF_field_7,
...
...
@@ -187,37 +187,37 @@ asn_TYPE_member_t asn_MBR_Flag_16P1_6[] = {
.name = "field"
},
};
static const ber_tlv_tag_t asn_DEF_Flag_1
6
P1_tags_6[] = {
static const ber_tlv_tag_t asn_DEF_Flag_1
5
P1_tags_6[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Flag_1
6
P1_tag2el_6[] = {
static const asn_TYPE_tag2member_t asn_MAP_Flag_1
5
P1_tag2el_6[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 } /* field */
};
asn_SEQUENCE_specifics_t asn_SPC_Flag_1
6
P1_specs_6 = {
sizeof(struct Flag_1
6
P1),
offsetof(struct Flag_1
6
P1, _asn_ctx),
.tag2el = asn_MAP_Flag_1
6
P1_tag2el_6,
asn_SEQUENCE_specifics_t asn_SPC_Flag_1
5
P1_specs_6 = {
sizeof(struct Flag_1
5
P1),
offsetof(struct Flag_1
5
P1, _asn_ctx),
.tag2el = asn_MAP_Flag_1
5
P1_tag2el_6,
.tag2el_count = 1, /* Count of tags in the map */
0, 0, 0, /* Optional elements (not needed) */
-1, /* Start extensions */
-1 /* Stop extensions */
};
asn_TYPE_descriptor_t asn_DEF_Flag_1
6
P1 = {
asn_TYPE_descriptor_t asn_DEF_Flag_1
5
P1 = {
"Flag",
"Flag",
&asn_OP_SEQUENCE,
SEQUENCE_constraint,
asn_DEF_Flag_1
6
P1_tags_6,
sizeof(asn_DEF_Flag_1
6
P1_tags_6)
/sizeof(asn_DEF_Flag_1
6
P1_tags_6[0]), /* 1 */
asn_DEF_Flag_1
6
P1_tags_6, /* Same as above */
sizeof(asn_DEF_Flag_1
6
P1_tags_6)
/sizeof(asn_DEF_Flag_1
6
P1_tags_6[0]), /* 1 */
asn_DEF_Flag_1
5
P1_tags_6,
sizeof(asn_DEF_Flag_1
5
P1_tags_6)
/sizeof(asn_DEF_Flag_1
5
P1_tags_6[0]), /* 1 */
asn_DEF_Flag_1
5
P1_tags_6, /* Same as above */
sizeof(asn_DEF_Flag_1
5
P1_tags_6)
/sizeof(asn_DEF_Flag_1
5
P1_tags_6[0]), /* 1 */
0, /* No OER visible constraints */
0, /* No PER visible constraints */
asn_MBR_Flag_1
6
P1_6,
asn_MBR_Flag_1
5
P1_6,
1, /* Elements count */
&asn_SPC_Flag_1
6
P1_specs_6 /* Additional specs */
&asn_SPC_Flag_1
5
P1_specs_6 /* Additional specs */
};
...
...
@@ -227,7 +227,7 @@ asn_TYPE_descriptor_t asn_DEF_Flag_16P1 = {
/*** <<< TYPE-DECLS [IntegerColorFlag] >>> ***/
typedef Flag_1
6
P0_t IntegerColorFlag_t;
typedef Flag_1
5
P0_t IntegerColorFlag_t;
/*** <<< FUNC-DECLS [IntegerColorFlag] >>> ***/
...
...
@@ -243,7 +243,7 @@ xer_type_encoder_f IntegerColorFlag_encode_xer;
/*** <<< CODE [IntegerColorFlag] >>> ***/
/*
* This type is implemented using Flag_1
6
P0,
* This type is implemented using Flag_1
5
P0,
* so here we adjust the DEF accordingly.
*/
...
...
@@ -265,9 +265,9 @@ asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag = {
/sizeof(asn_DEF_IntegerColorFlag_tags_1[0]), /* 1 */
0, /* No OER visible constraints */
0, /* No PER visible constraints */
asn_MBR_Flag_1
6
P0_1,
asn_MBR_Flag_1
5
P0_1,
1, /* Elements count */
&asn_SPC_Flag_1
6
P0_specs_1 /* Additional specs */
&asn_SPC_Flag_1
5
P0_specs_1 /* Additional specs */
};
...
...
@@ -277,7 +277,7 @@ asn_TYPE_descriptor_t asn_DEF_IntegerColorFlag = {
/*** <<< TYPE-DECLS [EnumeratedColorFlag] >>> ***/
typedef Flag_1
6
P1_t EnumeratedColorFlag_t;
typedef Flag_1
5
P1_t EnumeratedColorFlag_t;
/*** <<< FUNC-DECLS [EnumeratedColorFlag] >>> ***/
...
...
@@ -293,7 +293,7 @@ xer_type_encoder_f EnumeratedColorFlag_encode_xer;
/*** <<< CODE [EnumeratedColorFlag] >>> ***/
/*
* This type is implemented using Flag_1
6
P1,
* This type is implemented using Flag_1
5
P1,
* so here we adjust the DEF accordingly.
*/
...
...
@@ -315,8 +315,8 @@ asn_TYPE_descriptor_t asn_DEF_EnumeratedColorFlag = {
/sizeof(asn_DEF_EnumeratedColorFlag_tags_1[0]), /* 1 */
0, /* No OER visible constraints */
0, /* No PER visible constraints */
asn_MBR_Flag_1
6
P1_6,
asn_MBR_Flag_1
5
P1_6,
1, /* Elements count */
&asn_SPC_Flag_1
6
P1_specs_6 /* Additional specs */
&asn_SPC_Flag_1
5
P1_specs_6 /* Additional specs */
};
This diff is collapsed.
Click to expand it.
tests/tests-asn1c-compiler/149-with-components-SE.asn1.-E
View file @
59165cf2
...
...
@@ -7,6 +7,6 @@ Certificate ::= ExplicitCertificate (WITH COMPONENTS { ..., issuer (WITH COMPONE
IdentifiedRegion ( WITH COMPONENTS { countryOnly(Canada) }),
IdentifiedRegion ( WITH COMPONENTS { countryOnly(Mexico) }),
IdentifiedRegion ( WITH COMPONENTS { countryOnly(USA) })
})) }), canRequestRollover (
NULL), encryptionKey ABSENT, verifyKeyIndicator (WITH COMPONENTS { verificationKey (WITH COMPONENTS { ecdsaNistP256 (WITH COMPONENTS { compressed-y-0, compressed-y-1 }) }) }) }) })
})) }), canRequestRollover (NULL), encryptionKey ABSENT, verifyKeyIndicator (WITH COMPONENTS { verificationKey (WITH COMPONENTS { ecdsaNistP256 (WITH COMPONENTS { compressed-y-0, compressed-y-1 }) }) }) }) })
END
This diff is collapsed.
Click to expand it.
tests/tests-asn1c-compiler/151-per-b2110-OK.asn1
0 → 100644
View file @
59165cf2
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .151
ModulePerEffectiveConstraint
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 151 }
DEFINITIONS ::= BEGIN
-- B.2.1.10
-- Effective constraint: SIZE(3..20) and FROM("A".."K")
B ::= VisibleString (SIZE (20) INTERSECTION FROM ("A".."F")
UNION SIZE (3) INTERSECTION FROM ("F".."K"))
END
This diff is collapsed.
Click to expand it.
tests/tests-asn1c-compiler/151-per-b2110-OK.asn1.-EFprint-constraints
0 → 100644
View file @
59165cf2
ModulePerEffectiveConstraint { iso org(3) dod(6) internet(1) private(4)
enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 151 }
DEFINITIONS ::=
BEGIN
B ::= VisibleString (SIZE(20) ^ FROM("A".."F") | SIZE(3) ^ FROM("F".."K"))
-- Combined constraints: (SIZE(20) ^ FROM("A".."F") | SIZE(3) ^ FROM("F".."K"))
-- Practical constraints (B): (MIN..MAX) (SIZE(3 | 20)) (FROM("A".."K"))
-- OER-visible constraints (B): (MIN..MAX) (SIZE(3 | 20))
-- PER-visible constraints (B): (MIN..MAX) (SIZE(3 | 20)) (FROM("A".."K"))
END
This diff is collapsed.
Click to expand it.
tests/tests-asn1c-compiler/152-value-and-type-references-OK.asn1
0 → 100644
View file @
59165cf2
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .152
ModuleValueAndTypeReferences
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 152 }
DEFINITIONS ::= BEGIN
value INTEGER ::= 3
valueAssignment3 INTEGER ::= value
valueAssignment4 INTEGER ::= MOD-CAPITALS.value4
Foo ::= Extension {{CAPS.SomeType}}
Bar ::= Extension {{Uppercase.SomeType}}
Extension {Foo} ::= SEQUENCE {
}
MTYPE ::= CLASS {
&id INTEGER UNIQUE,
&Type
} WITH SYNTAX {&Type IDENTIFIED BY &id}
MessageFrame ::= SEQUENCE {
messageIdE MTYPE.&id,
messageIdF MTYPE.&id({MessageTypes}),
valueE MTYPE.&Type,
valueF MTYPE.&Type({MessageTypes}{@.messageId})
}
END
MOD-CAPITALS
{ iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 152 1 }
DEFINITIONS ::= BEGIN
value4 INTEGER ::= 4
END
This diff is collapsed.
Click to expand it.
tests/tests-asn1c-compiler/152-value-and-type-references-OK.asn1.-EF
0 → 100644
View file @
59165cf2
ModuleValueAndTypeReferences { iso org(3) dod(6) internet(1) private(4)
enterprise(1) spelio(9363) software(1) asn1c(5) test(1) 152 }
DEFINITIONS ::=
BEGIN
value INTEGER ::= 3
valueAssignment3 INTEGER ::= 3
valueAssignment4 INTEGER ::= 4
Foo ::= Extension{ { CAPS.SomeType}}
Bar ::= Extension{ { Uppercase.SomeType}}
Extension{Foo} ::= SEQUENCE { }
MTYPE ::= CLASS {
&id INTEGER UNIQUE,
&Type ANY
} WITH SYNTAX {&Type IDENTIFIED BY &id}
MessageFrame ::= SEQUENCE {
messageIdE MTYPE.&id,
messageIdF MTYPE.&id ({MessageTypes}),
valueE MTYPE.&Type,
valueF MTYPE.&Type ({MessageTypes}{@.messageId})
}
END
MOD-CAPITALS { iso org(3) dod(6) internet(1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 152 1 }
DEFINITIONS ::=
BEGIN
value4 INTEGER ::= 4
END
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment