Pristine Ack-5.5
[Ack-5.5.git] / lang / pc / comp / LLlex.h
1 /* 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 */
2
3 /* Structure to store a string constant
4 */
5 struct string {
6         arith s_length;                 /* length of a string */
7         char *s_str;                    /* the string itself */
8         label s_lab;                    /* data label of string */
9 };
10
11 /* Structure to store a real constant
12 */
13 struct real {
14         char *r_real;                   /* string representation of real */
15         struct real *r_inverse;         /* the inverse of this real */
16         label r_lab;                    /* data label of real */
17 };
18
19 /* Token structure. Keep it small, as it is part of a parse-tree node
20 */
21 struct token    {
22         short tk_symb;                  /* token itself */
23         unsigned short tk_lineno;       /* linenumber on which it occurred */
24         union {
25                 struct idf *tk_idf;     /* IDENT        */
26                 struct string *tk_str;  /* STRING       */
27                 arith tk_int;           /* INTEGER      */
28                 struct real *tk_real;   /* REAL         */
29                 struct def *tk_def;     /* only used in parse tree node */
30                 arith *tk_set;          /* only used in parse tree node */
31                 label tk_lab;           /* only used in parse tree node */
32         } tk_data;
33 };
34
35 #define TOK_IDF tk_data.tk_idf
36 #define TOK_STR tk_data.tk_str->s_str
37 #define TOK_SLE tk_data.tk_str->s_length
38 #define TOK_SLA tk_data.tk_str->s_lab
39 #define TOK_INT tk_data.tk_int
40 #define TOK_REL tk_data.tk_real->r_real
41 #define TOK_RIV tk_data.tk_real->r_inverse
42 #define TOK_RLA tk_data.tk_real->r_lab
43
44 extern struct token dot, aside;
45 extern struct type *toktype, *asidetype;
46 extern int tokenseen;
47
48 #define ASIDE   aside.tk_symb