Line | |
---|
1 | /* token.h - token definition Author: Kees J. Bot
|
---|
2 | * 13 Dec 1993
|
---|
3 | */
|
---|
4 |
|
---|
5 | typedef enum toktype {
|
---|
6 | T_EOF,
|
---|
7 | T_CHAR,
|
---|
8 | T_WORD,
|
---|
9 | T_STRING
|
---|
10 | } toktype_t;
|
---|
11 |
|
---|
12 | typedef struct token {
|
---|
13 | struct token *next;
|
---|
14 | long line;
|
---|
15 | toktype_t type;
|
---|
16 | int symbol; /* Single character symbol. */
|
---|
17 | char *name; /* Word, number, etc. */
|
---|
18 | size_t len; /* Length of string. */
|
---|
19 | } token_t;
|
---|
20 |
|
---|
21 | #define S_LEFTSHIFT 0x100 /* << */
|
---|
22 | #define S_RIGHTSHIFT 0x101 /* >> */
|
---|
23 |
|
---|
24 | void set_file(char *file, long line);
|
---|
25 | void get_file(char **file, long *line);
|
---|
26 | void parse_err(int err, token_t *where, const char *fmt, ...);
|
---|
27 | void tok_init(char *file, int comment);
|
---|
28 | token_t *get_token(int n);
|
---|
29 | void skip_token(int n);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.