Commit 112d69e0 authored by Lev Walkin's avatar Lev Walkin

1. Finer support for BOOLEAN

2. Small refactoring
parent 72894034
...@@ -49,6 +49,12 @@ asn1print(asn1p_t *asn, enum asn1print_flags flags) { ...@@ -49,6 +49,12 @@ asn1print(asn1p_t *asn, enum asn1print_flags flags) {
asn1print_module(asn, mod, flags); asn1print_module(asn, mod, flags);
} }
if(flags & APF_PRINT_XML_DTD) {
/* Values for BOOLEAN */
printf("<!ELEMENT true EMPTY>\n");
printf("<!ELEMENT false EMPTY>\n");
}
return 0; return 0;
} }
...@@ -670,15 +676,6 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a ...@@ -670,15 +676,6 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a
if(!expr->Identifier) return 0; if(!expr->Identifier) return 0;
if(expr->expr_type == ASN_CONSTR_CHOICE
|| expr->expr_type == ASN_CONSTR_SEQUENCE_OF
|| expr->expr_type == ASN_CONSTR_SET_OF
|| expr->expr_type == ASN_CONSTR_SET
|| expr->expr_type == ASN_BASIC_INTEGER
|| expr->expr_type == ASN_BASIC_ENUMERATED) {
expr_unordered = 1;
}
if(flags & APF_LINE_COMMENTS) if(flags & APF_LINE_COMMENTS)
INDENT("<!-- #line %d -->\n", expr->_lineno); INDENT("<!-- #line %d -->\n", expr->_lineno);
INDENT("<!ELEMENT %s", expr->Identifier); INDENT("<!ELEMENT %s", expr->Identifier);
...@@ -693,6 +690,12 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a ...@@ -693,6 +690,12 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a
dont_involve_children = 1; dont_involve_children = 1;
} }
if((expr->expr_type & ASN_CONSTR_MASK)
|| expr->expr_type == ASN_BASIC_INTEGER
|| expr->expr_type == ASN_BASIC_ENUMERATED) {
expr_unordered = 1;
}
if(TQ_FIRST(&expr->members)) { if(TQ_FIRST(&expr->members)) {
int extensible = 0; int extensible = 0;
printf(" ("); printf(" (");
...@@ -738,7 +741,7 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a ...@@ -738,7 +741,7 @@ asn1print_expr_dtd(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *expr, enum a
} else switch(expr->expr_type) { } else switch(expr->expr_type) {
case ASN_BASIC_BOOLEAN: case ASN_BASIC_BOOLEAN:
printf("(true|false)"); printf(" (true|false)");
break; break;
case ASN_CONSTR_CHOICE: case ASN_CONSTR_CHOICE:
case ASN_CONSTR_SET: case ASN_CONSTR_SET:
......
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