I have a problem in ASN.1 compiler written in Bison.
A OCTET STRING (CONTAINING B)
The compiler Ignores CONTAINING B and refers to the data as OCTET STRING instead of referring it as B. Here is the current rule:
OctetStringType :
OCTET STRING Constraint { $$ = new OctetString($3); } |
OCTET STRING '{' NamedOctetList '}' Constraint { $$ = new OctetString($6); }
;
I tried to create a new rule:
OctetStringType :
OCTET STRING '('ContentsConstraint')' {}|
OCTET STRING Constraint { $$ = new OctetString($3); } |
OCTET STRING '{' NamedOctetList '}' Constraint { $$ = new OctetString($6); }
;
ContentsConstraint :
CONTAINING Type { }
;
When I try to print the result:
OCTET STRING '('ContentsConstraint')' {printf("$$: %s\n",$$);}
I get A. How can I access to B?Do I have to modify those rules to access B?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a problem in ASN.1 compiler written in Bison.
A OCTET STRING (CONTAINING B)
The compiler Ignores CONTAINING B and refers to the data as OCTET STRING instead of referring it as B. Here is the current rule:
OctetStringType :
OCTET STRING Constraint { $$ = new OctetString($3); } |
OCTET STRING '{' NamedOctetList '}' Constraint { $$ = new OctetString($6); }
;
I tried to create a new rule:
OctetStringType :
OCTET STRING '('ContentsConstraint')' {}|
OCTET STRING Constraint { $$ = new OctetString($3); } |
OCTET STRING '{' NamedOctetList '}' Constraint { $$ = new OctetString($6); }
;
ContentsConstraint :
CONTAINING Type { }
;
When I try to print the result:
OCTET STRING '('ContentsConstraint')' {printf("$$: %s\n",$$);}
I get A. How can I access to B?Do I have to modify those rules to access B?
Sorry I'm not an expert in flex/bison tools. Just adopted their code to windows.
I think the best place to ask is stackoverflow.com