Menu

ASN1 compiler

2017-01-23
2017-01-23
  • David Aharon

    David Aharon - 2017-01-23

    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?

     
  • Alex Zhondin

    Alex Zhondin - 2017-01-24

    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

     

Log in to post a comment.