Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Havar
asn1c
Commits
557f27de
Commit
557f27de
authored
Mar 21, 2006
by
Lev Walkin
Browse files
valuesettypeassignment parsing
parent
171487e6
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
557f27de
...
...
@@ -7,6 +7,7 @@
* Refactored Information Object Classes parsing.
* Refactored Parameterization support.
* [typedef enum foo {}] foo_e; is now e_foo, see #1287989
* Refactored ValueSetTypeAssignment parsing.
0.9.20: 2006-Mar-06
...
...
libasn1parser/asn1p_y.c
View file @
557f27de
This diff is collapsed.
Click to expand it.
libasn1parser/asn1p_y.y
View file @
557f27de
...
...
@@ -251,7 +251,8 @@ static void _fixup_anonymous_identifier(asn1p_expr_t *expr);
%type <a_expr> Type
%type <a_expr> DataTypeReference /* Type1 ::= Type2 */
%type <a_expr> DefinedType
%type <a_expr> ValueSetDefinition /* Val INTEGER ::= {1|2} */
%type <a_constr> ValueSet /* {a|b|c}*/
%type <a_expr> ValueSetTypeAssignment /* Val INTEGER ::= {1|2} */
%type <a_expr> ValueDefinition /* val INTEGER ::= 1*/
%type <a_value> Value
%type <a_value> SimpleValue
...
...
@@ -554,7 +555,7 @@ ModuleSpecificationElement:
* EvenNumbers INTEGER ::= { 2 | 4 | 6 | 8 }
* === EOF ===
*/
| ValueSet
Definition
{
| ValueSet
TypeAssignment
{
$$ = asn1p_module_new();
checkmem($$);
assert($1->expr_type != A1TC_INVALID);
...
...
@@ -712,14 +713,15 @@ ExportsElement:
;
ValueSetDefinition:
TypeRefName DefinedType TOK_PPEQ
'{' { asn1p_lexer_hack_push_opaque_state(); } Opaque /* '}' */ {
ValueSet: '{' ElementSetSpecs '}' { $$ = $2; }
ValueSetTypeAssignment:
TypeRefName DefinedType TOK_PPEQ ValueSet {
$$ = $2;
assert($$->Identifier == 0);
$$->Identifier = $1;
$$->meta_type = AMT_VALUESET;
/* take care of ValueSet body */
$$->constraints = $4;
}
;
...
...
libasn1print/asn1print.c
View file @
557f27de
...
...
@@ -607,7 +607,6 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
*/
if
(
TQ_FIRST
(
&
(
tc
->
members
))
||
(
tc
->
expr_type
&
ASN_CONSTR_MASK
)
||
tc
->
meta_type
==
AMT_VALUESET
||
tc
->
meta_type
==
AMT_OBJECT
||
tc
->
meta_type
==
AMT_OBJECTCLASS
||
tc
->
meta_type
==
AMT_OBJECTFIELD
...
...
@@ -675,7 +674,11 @@ asn1print_expr(asn1p_t *asn, asn1p_module_t *mod, asn1p_expr_t *tc, enum asn1pri
if
(
!
SEQ_OF
&&
tc
->
constraints
)
{
printf
(
" "
);
if
(
tc
->
meta_type
==
AMT_VALUESET
)
printf
(
"{"
);
asn1print_constraint
(
tc
->
constraints
,
flags
);
if
(
tc
->
meta_type
==
AMT_VALUESET
)
printf
(
"}"
);
}
if
(
tc
->
unique
)
{
...
...
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