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:
@@ -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 <name> IDENTIFIER
|
||||
%token <constant> 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); }
|
||||
|
Reference in New Issue
Block a user