different marker semantics

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@300 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2004-09-10 08:21:27 +00:00
parent 25e1293f13
commit d82eb01767
2 changed files with 12 additions and 12 deletions

View File

@ -173,18 +173,19 @@ typedef struct asn1p_expr_s {
asn1_integer_t tag_value;
} tag;
enum asn1p_expr_marker_e {
EM_NOMARK,
EM_INDIRECT = 0x01, /* 0001: Represent as pointer */
EM_OPTIONAL = 0x03, /* 0011: Optional member */
EM_DEFAULT = 0x07, /* 0111: FIXME: store the value */
} marker;
int unique; /* UNIQUE */
/*
* Whether automatic tagging is applicable for subtypes.
*/
int auto_tags_OK;
enum asn1p_expr_marker_e {
EM_NOMARK,
EM_OPTIONAL,
EM_DEFAULT, /* FIXME: store the value somewhere. */
} marker;
int unique; /* UNIQUE */
/*
* Members of the constructed type.
*/

View File

@ -533,11 +533,10 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
* Print the expression as it were a stand-alone type.
*/
asn1print_expr(asn, mod, se, flags, level + 4);
switch(se->marker) {
case EM_NOMARK: break;
case EM_OPTIONAL: printf(" OPTIONAL"); break;
case EM_DEFAULT: printf(" DEFAULT <?>"); break;
}
if(se->marker & EM_DEFAULT)
printf(" DEFAULT <?>");
else if(se->marker & EM_OPTIONAL)
printf(" OPTIONAL");
if(TQ_NEXT(se, next)) {
printf(",");
INDENT("\n");