Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / cemcom / LLlex.h
1 /*
2  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3  * See the copyright notice in the ACK home directory, in the file "Copyright".
4  */
5 /* $Id: LLlex.h,v 3.11 1994/06/24 12:01:40 ceriel Exp $ */
6 /* D E F I N I T I O N S   F O R   T H E   L E X I C A L   A N A L Y Z E R */
7
8 /*      A token from the input stream is represented by an integer,
9         called a "symbol", but it may have other information associated
10         to it.
11 */
12
13 #include "nofloat.h"
14 #include "file_info.h"
15 #include "nopp.h"
16
17 /* the structure of a token:    */
18 struct token    {
19         int tok_symb;           /* the token itself */
20         char *tok_file;         /* the file it (probably) comes from */
21         unsigned int tok_line;  /* the line it (probably) comes from */
22         union   {
23                 struct idf *tok_idf;    /* for IDENTIFIER & TYPE_IDENTIFIER */
24                 struct  {               /* for STRING */
25                         char *tok_bts;  /* row of bytes */
26                         int tok_len;    /* length of row of bytes */
27                 } tok_string;
28                 struct  {               /* for INTEGER */
29                         int tok_fund;   /* INT or LONG */
30                         arith tok_ival;
31                 } tok_integer;
32 #ifndef NOFLOAT
33                 char *tok_fval;
34 #endif /* NOFLOAT */
35         } tok_data;
36 };
37
38 #define tk_symb tok_symb
39 #define tk_file tok_file
40 #define tk_line tok_line
41 #define tk_idf  tok_data.tok_idf
42 #define tk_bts  tok_data.tok_string.tok_bts
43 #define tk_len  tok_data.tok_string.tok_len
44 #define tk_fund tok_data.tok_integer.tok_fund
45 #define tk_ival tok_data.tok_integer.tok_ival
46 #ifndef NOFLOAT
47 #define tk_fval tok_data.tok_fval
48 #endif /* NOFLOAT */
49
50 extern struct token dot, ahead, aside;
51 extern int token_nmb;                   /* number of the ahead token */
52 extern int tk_nmb_at_last_syn_err;      /* token number at last syntax error */
53
54 #ifndef NOPP
55 extern int ReplaceMacros;       /* "LLlex.c"    */
56 extern int AccDefined;          /* "LLlex.c"    */
57 extern int Unstacked;           /* "LLlex.c"    */
58 extern int UnknownIdIsZero;     /* "LLlex.c"    */
59 #endif /* NOPP */
60 extern int EoiForNewline;       /* "LLlex.c"    */
61 extern int AccFileSpecifier;    /* "LLlex.c"    */
62 extern int SkipEscNewline;      /* "LLlex.c"    */
63 extern int File_Inserted;       /* "LLlex.c"    */
64
65 extern int NoUnstack;           /* buffer.c     */
66
67 extern int err_occurred;        /* "error.c"    */
68
69 #define DOT     dot.tk_symb
70 #define AHEAD   ahead.tk_symb
71 #define ASIDE   aside.tk_symb
72
73 #define EOF     (-1)