add support for more standards like import statements, and

distinguished value integers


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8394 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2000-06-19 15:16:48 +00:00
parent cc0c770246
commit fb46c05aa0

View File

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