forked from vlm/asn1c
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from v0-e/class-default-syntax-support
Class default syntax support
- Loading branch information
Showing
8 changed files
with
207 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/tests-asn1c-compiler/164-class-default-syntax-OK.asn1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- OK: Everything is fine | ||
|
||
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1) | ||
-- .spelio.software.asn1c.test (9363.1.5.1) | ||
-- .164 | ||
|
||
ModuleClassDefaultSyntax | ||
{ iso org(3) dod(6) internet (1) private(4) enterprise(1) | ||
spelio(9363) software(1) asn1c(5) test(1) 164 } | ||
DEFINITIONS AUTOMATIC TAGS ::= | ||
BEGIN | ||
|
||
DCLASS ::= CLASS { | ||
&id INTEGER, | ||
&Type | ||
} | ||
|
||
Ordered DCLASS ::= { | ||
{&id 1, &Type UTF8String} | | ||
{&id 2, &Type OCTET STRING} | ||
} | ||
|
||
Unordered DCLASS ::= { | ||
{&Type UTF8String, &id 17} | | ||
{&id 8, &Type OCTET STRING} | ||
} | ||
|
||
A ::= SEQUENCE | ||
{ | ||
a-Ordered-id DCLASS.&id ({Ordered}), | ||
a-Ordered-val DCLASS.&Type ({Ordered}{@a-Ordered-id}) | ||
} | ||
|
||
B ::= SEQUENCE | ||
{ | ||
b-Unordered-id DCLASS.&id ({Unordered}), | ||
b-Unordered-val DCLASS.&Type ({Unordered}{@b-Unordered-id}) | ||
} | ||
|
||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#undef NDEBUG | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <sys/types.h> | ||
#include <string.h> | ||
#include <assert.h> | ||
|
||
#include <A.h> | ||
#include <B.h> | ||
|
||
int | ||
main(int ac, char **av) { | ||
A_t a; | ||
B_t b; | ||
|
||
(void)ac; /* Unused argument */ | ||
(void)av; /* Unused argument */ | ||
|
||
memset(&a, 0, sizeof(a)); | ||
memset(&b, 0, sizeof(b)); | ||
|
||
/* Check existence of the following enum values */ | ||
assert(a_Ordered_val_PR_UTF8String); | ||
assert(a_Ordered_val_PR_OCTET_STRING); | ||
assert(b_Unordered_val_PR_UTF8String); | ||
assert(b_Unordered_val_PR_OCTET_STRING); | ||
|
||
/* | ||
* No plans to fill it up: just checking whether it compiles or not. | ||
*/ | ||
|
||
return 0; | ||
} |