diff --git a/lib/asn1/parse.y b/lib/asn1/parse.y index 5d6f7121d..9b6cf7545 100644 --- a/lib/asn1/parse.y +++ b/lib/asn1/parse.y @@ -64,6 +64,7 @@ static void append (Member *l, Member *r); %token INTEGER SEQUENCE OF OCTET STRING GeneralizedTime GeneralString %token BIT APPLICATION OPTIONAL EEQUAL TBEGIN END DEFINITIONS EXTERNAL %token DOTDOT +%token IMPORTS FROM %token IDENTIFIER %token CONSTANT @@ -82,16 +83,24 @@ specification : | specification declaration ; -declaration : extern_decl +declaration : imports_decl | type_decl | constant_decl ; -extern_decl : IDENTIFIER EXTERNAL +referencenames : IDENTIFIER ',' referencenames { Symbol *s = addsym($1); s->stype = Stype; } + | IDENTIFIER + { + Symbol *s = addsym($1); + s->stype = Stype; + } + ; + +imports_decl : IMPORTS referencenames FROM IDENTIFIER ';' ; type_decl : IDENTIFIER EEQUAL type @@ -121,6 +130,11 @@ type : INTEGER { $$ = new_type(TInteger); } UINT_MAX); $$ = new_type(TUInteger); } + | INTEGER '{' bitdecls '}' + { + $$ = new_type(TInteger); + $$->members = $3; + } | OCTET STRING { $$ = new_type(TOctetString); } | GeneralString { $$ = new_type(TGeneralString); } | GeneralizedTime { $$ = new_type(TGeneralizedTime); }