ack/lang/m2/comp/LLlex.h

36 lines
947 B
C
Raw Normal View History

1986-03-26 15:11:02 +00:00
/* T O K E N D E S C R I P T O R D E F I N I T I O N */
1986-03-20 14:52:03 +00:00
/* $Header$ */
1986-04-04 13:47:04 +00:00
struct string {
1986-04-28 18:06:58 +00:00
arith s_length; /* length of a string */
1986-04-04 13:47:04 +00:00
char *s_str; /* the string itself */
};
1986-03-20 14:52:03 +00:00
struct token {
int tk_symb; /* token itself */
1986-04-04 13:47:04 +00:00
char *tk_filename; /* filename in which it occurred */
1986-03-24 17:29:57 +00:00
int tk_lineno; /* linenumber on which it occurred */
1986-03-20 14:52:03 +00:00
union {
struct idf *tk_idf; /* IDENT */
1986-04-22 22:36:16 +00:00
struct string *tk_str; /* STRING */
1986-04-04 13:47:04 +00:00
arith tk_int; /* INTEGER */
1986-03-20 14:52:03 +00:00
char *tk_real; /* REAL */
1986-04-09 18:14:49 +00:00
arith *tk_set; /* only used in parse tree node */
struct def *tk_def; /* only used in parse tree node */
1986-05-01 19:06:53 +00:00
label tk_lab; /* only used in parse tree node */
1986-03-20 14:52:03 +00:00
} tk_data;
};
#define TOK_IDF tk_data.tk_idf
1986-04-22 22:36:16 +00:00
#define TOK_STR tk_data.tk_str->s_str
#define TOK_SLE tk_data.tk_str->s_length
1986-04-04 13:47:04 +00:00
#define TOK_INT tk_data.tk_int
1986-03-20 14:52:03 +00:00
#define TOK_REL tk_data.tk_real
extern struct token dot, aside;
1986-04-15 17:51:53 +00:00
extern struct type *numtype;
1986-03-20 14:52:03 +00:00
#define DOT dot.tk_symb
#define ASIDE aside.tk_symb