#ifndef _SYMBOL_H
#define _SYMBOL_H
#include "asn1_queue.h"
enum typetype {
TBitString,
TBoolean,
TChoice,
TEnumerated,
TGeneralString,
TTeletexString,
TGeneralizedTime,
TIA5String,
TInteger,
TNull,
TOID,
TOctetString,
TPrintableString,
TSequence,
TSequenceOf,
TSet,
TSetOf,
TTag,
TType,
TUTCTime,
TUTF8String,
TBMPString,
TUniversalString,
TVisibleString
};
typedef enum typetype Typetype;
struct type;
struct value {
enum { booleanvalue,
nullvalue,
integervalue,
stringvalue,
objectidentifiervalue
} type;
union {
int booleanvalue;
int integervalue;
char *stringvalue;
struct objid *objectidentifiervalue;
} u;
};
struct member {
char *name;
char *gen_name;
char *label;
int val;
int optional;
int ellipsis;
struct type *type;
ASN1_TAILQ_ENTRY(member) members;
struct value *defval;
};
typedef struct member Member;
ASN1_TAILQ_HEAD(memhead, member);
struct symbol;
struct tagtype {
int tagclass;
int tagvalue;
enum { TE_IMPLICIT, TE_EXPLICIT } tagenv;
};
struct range {
int min;
int max;
};
enum ctype { CT_CONTENTS, CT_USER } ;
struct constraint_spec;
struct type {
Typetype type;
struct memhead *members;
struct symbol *symbol;
struct type *subtype;
struct tagtype tag;
struct range *range;
struct constraint_spec *constraint;
unsigned long id;
};
typedef struct type Type;
struct constraint_spec {
enum ctype ctype;
union {
struct {
Type *type;
struct value *encoding;
} content;
} u;
};
struct objid {
const char *label;
int value;
struct objid *next;
};
struct symbol {
char *name;
char *gen_name;
enum { SUndefined, SValue, Stype } stype;
struct value *value;
Type *type;
struct {
unsigned used;
unsigned external;
} flags;
};
typedef struct symbol Symbol;
void initsym (void);
Symbol *addsym (char *);
void output_name (char *);
int checksymbols(void);
#endif