forked from zeotrope/anicca
-
Notifications
You must be signed in to change notification settings - Fork 1
/
lexer.h
36 lines (31 loc) · 830 Bytes
/
lexer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef _LEXER_H
#define _LEXER_H
typedef enum {
SS, /* Space */
SX, /* Unknown */
SA, /* Alphanumeric */
SN, /* N */
SM, /* NB */
SO, /* NB. */
S9, /* Number */
SQ, /* Quote */
SC, /* Even Quote */
SZ /* Trailing Comment */
} STATE;
typedef enum {
EO, /* No effect */
EN, /* Word start index = index, j =. i */
EW, /* emitword(i,j,state,char)), j =. i */
EY, /* emitword(i,j,state,char)), j =. _1 */
EV, /* emitvector(i,j,state,char), j =. i */
EZ, /* emitvector(i,j,state,char), j =. _1 */
ES /* Stop */
} ACTION;
typedef struct _state {
C new;
C effect;
} ST;
static A parse_literal(I n, C *s);
static MONAD(token_index);
MONAD(tokens);
#endif