-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTokenizer.h
42 lines (36 loc) · 1.06 KB
/
Tokenizer.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
37
38
39
40
/* Tokenizer.h -- definitions for tokenizer.c _and_ the language-specific lexers */
/* token ids */
enum {
NO_TOKEN = 0, /* don't use zero for tokens ! */
TOK_HSPACE,
TOK_VSPACE,
TOK_NEWLINE,
TOK_WORD,
TOK_NUMBER,
TOK_OTHER,
TOK_EOS,
TOK_DATE,
TOK_COMPLEX,
TOK_ABBR,
TOK_WWW,
};
typedef unsigned int BOOL;
enum { FALSE = 0, TRUE = 1 };
struct option {
/* don't use bit-maps: costs are 1% of time, saves almost no space */
/* because option is frequently consulted in yylex */
BOOL eos; /* 0 = eos off, 1 = on (-S)*/
unsigned int new_line_as_eos; /* 0 = off, 1 = on (-n), 2 = -N */
BOOL parMode; /* 0 = off, 1 = on (-p) */
unsigned int outputMode; /* 0 = off, 1 = on (-s), 2 = -p, 3 = -P */
BOOL printSpace; /* 0 = off, 1 = on (-n) */
BOOL hyphCont;
BOOL printHyphen;
BOOL convCase;
BOOL www;
BOOL quiet;
BOOL set; /* options set in Lexer (do it only once) */
unsigned int language;
char tokSep;
char* eosmark;
} option;