Commit 6e8da2ba authored by Lev Walkin's avatar Lev Walkin

different marker semantics

parent 8a99bf71
......@@ -173,18 +173,19 @@ typedef struct asn1p_expr_s {
asn1_integer_t tag_value;
} tag;
/*
* 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. */
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;
/*
* Members of the constructed type.
*/
......
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment