annotate src/tokenizer.cpp @ 23:37793d4c90a0

changes for rhel7 systemd and /var/run on tmpfs
author Carl Byington <carl@five-ten-sg.com>
date Mon, 06 Feb 2017 10:45:07 -0800
parents b24369330483
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
616666e2f34c initial version
carl
parents:
diff changeset
1 /*
616666e2f34c initial version
carl
parents:
diff changeset
2
13
75e1a9bcbc2e gpl3, add removal option for original recipients
carl
parents: 0
diff changeset
3 Copyright (c) 2007 Carl Byington - 510 Software Group, released under
75e1a9bcbc2e gpl3, add removal option for original recipients
carl
parents: 0
diff changeset
4 the GPL version 3 or any later version at your choice available at
75e1a9bcbc2e gpl3, add removal option for original recipients
carl
parents: 0
diff changeset
5 http://www.gnu.org/licenses/gpl-3.0.txt
0
616666e2f34c initial version
carl
parents:
diff changeset
6
616666e2f34c initial version
carl
parents:
diff changeset
7 */
616666e2f34c initial version
carl
parents:
diff changeset
8
616666e2f34c initial version
carl
parents:
diff changeset
9 #include "includes.h"
616666e2f34c initial version
carl
parents:
diff changeset
10
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
11 const int maxlen = 1000; // used for snprintf buffers
0
616666e2f34c initial version
carl
parents:
diff changeset
12
616666e2f34c initial version
carl
parents:
diff changeset
13 enum state {s_init,
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
14 s_token,
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
15 s_string,
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
16 s_ignore, // whitespace
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
17 s_eol, // ignore to eol
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
18 end_state,
0
616666e2f34c initial version
carl
parents:
diff changeset
19
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
20 s_term, // token terminator
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
21 s_single,
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
22 s_string1, // first " of string
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
23 s_string2, // last " of string
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
24 s_slash // possible start of ignore to eol
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
25 };
0
616666e2f34c initial version
carl
parents:
diff changeset
26
616666e2f34c initial version
carl
parents:
diff changeset
27 typedef state PARSE[end_state];
616666e2f34c initial version
carl
parents:
diff changeset
28
616666e2f34c initial version
carl
parents:
diff changeset
29 static PARSE parse_table[256] = {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
30 // s_init s_token s_string s_ignore s_eol
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
31 { s_single, s_term, s_string, s_single, s_eol, }, // 0x00
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
32 { s_single, s_term, s_string, s_single, s_eol, }, // 0x01
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
33 { s_single, s_term, s_string, s_single, s_eol, }, // 0x02
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
34 { s_single, s_term, s_string, s_single, s_eol, }, // 0x03
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
35 { s_single, s_term, s_string, s_single, s_eol, }, // 0x04
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
36 { s_single, s_term, s_string, s_single, s_eol, }, // 0x05
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
37 { s_single, s_term, s_string, s_single, s_eol, }, // 0x06
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
38 { s_single, s_term, s_string, s_single, s_eol, }, // 0x07
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
39 { s_single, s_term, s_string, s_single, s_eol, }, // 0x08
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
40 { s_ignore, s_term, s_string, s_ignore, s_eol, }, // 0x09 <tab>
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
41 { s_ignore, s_term, s_string2, s_ignore, s_ignore, }, // 0x0a <lf>
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
42 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0b
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
43 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0c
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
44 { s_ignore, s_term, s_string2, s_ignore, s_eol, }, // 0x0d <cr>
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
45 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0e
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
46 { s_single, s_term, s_string, s_single, s_eol, }, // 0x0f
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
47 { s_single, s_term, s_string, s_single, s_eol, }, // 0x10
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
48 { s_single, s_term, s_string, s_single, s_eol, }, // 0x11 xon char
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
49 { s_single, s_term, s_string, s_single, s_eol, }, // 0x12
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
50 { s_single, s_term, s_string, s_single, s_eol, }, // 0x13 xoff char
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
51 { s_single, s_term, s_string, s_single, s_eol, }, // 0x14
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
52 { s_single, s_term, s_string, s_single, s_eol, }, // 0x15
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
53 { s_single, s_term, s_string, s_single, s_eol, }, // 0x16
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
54 { s_single, s_term, s_string, s_single, s_eol, }, // 0x17
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
55 { s_single, s_term, s_string, s_single, s_eol, }, // 0x18
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
56 { s_single, s_term, s_string, s_single, s_eol, }, // 0x19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
57 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1a
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
58 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1b
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
59 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1c
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
60 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1d
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
61 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1e
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
62 { s_single, s_term, s_string, s_single, s_eol, }, // 0x1f
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
63 { s_ignore, s_term, s_string, s_ignore, s_eol, }, // 0x20 space
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
64 { s_single, s_term, s_string, s_single, s_eol, }, // 0x21 !
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
65 { s_string1, s_term, s_string2, s_string1, s_eol, }, // 0x22 "
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
66 { s_eol, s_term, s_string, s_eol, s_eol, }, // 0x23 #
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
67 { s_single, s_term, s_string, s_single, s_eol, }, // 0x24 $
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
68 { s_single, s_term, s_string, s_single, s_eol, }, // 0x25 %
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
69 { s_single, s_term, s_string, s_single, s_eol, }, // 0x26 &
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
70 { s_single, s_term, s_string, s_single, s_eol, }, // 0x27 '
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
71 { s_single, s_term, s_string, s_single, s_eol, }, // 0x28 (
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
72 { s_single, s_term, s_string, s_single, s_eol, }, // 0x29 )
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
73 { s_single, s_term, s_string, s_single, s_eol, }, // 0x2A *
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
74 { s_single, s_token, s_string, s_single, s_eol, }, // 0x2B +
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
75 { s_single, s_term, s_string, s_single, s_eol, }, // 0x2C ,
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
76 { s_single, s_token, s_string, s_single, s_eol, }, // 0x2D -
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
77 { s_single, s_token, s_string, s_single, s_eol, }, // 0x2E .
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
78 { s_slash, s_token, s_string, s_slash, s_eol, }, // 0x2F /
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
79 { s_token, s_token, s_string, s_token, s_eol, }, // 0x30 0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
80 { s_token, s_token, s_string, s_token, s_eol, }, // 0x31 1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
81 { s_token, s_token, s_string, s_token, s_eol, }, // 0x32 2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
82 { s_token, s_token, s_string, s_token, s_eol, }, // 0x33 3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
83 { s_token, s_token, s_string, s_token, s_eol, }, // 0x34 4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
84 { s_token, s_token, s_string, s_token, s_eol, }, // 0x35 5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
85 { s_token, s_token, s_string, s_token, s_eol, }, // 0x36 6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
86 { s_token, s_token, s_string, s_token, s_eol, }, // 0x37 7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
87 { s_token, s_token, s_string, s_token, s_eol, }, // 0x38 8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
88 { s_token, s_token, s_string, s_token, s_eol, }, // 0x39 9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
89 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3A :
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
90 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3B ;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
91 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3C <
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
92 { s_single, s_token, s_string, s_single, s_eol, }, // 0x3D =
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
93 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3E >
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
94 { s_single, s_term, s_string, s_single, s_eol, }, // 0x3F ?
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
95 { s_single, s_token, s_string, s_single, s_eol, }, // 0x40 @
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
96 { s_token, s_token, s_string, s_token, s_eol, }, // 0x41 A
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
97 { s_token, s_token, s_string, s_token, s_eol, }, // 0x42 B
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
98 { s_token, s_token, s_string, s_token, s_eol, }, // 0x43 C
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
99 { s_token, s_token, s_string, s_token, s_eol, }, // 0x44 D
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
100 { s_token, s_token, s_string, s_token, s_eol, }, // 0x45 E
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
101 { s_token, s_token, s_string, s_token, s_eol, }, // 0x46 F
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
102 { s_token, s_token, s_string, s_token, s_eol, }, // 0x47 G
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
103 { s_token, s_token, s_string, s_token, s_eol, }, // 0x48 H
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
104 { s_token, s_token, s_string, s_token, s_eol, }, // 0x49 I
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
105 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4A J
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
106 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4B K
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
107 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4C L
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
108 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4D M
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
109 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4E N
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
110 { s_token, s_token, s_string, s_token, s_eol, }, // 0x4F O
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
111 { s_token, s_token, s_string, s_token, s_eol, }, // 0x50 P
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
112 { s_token, s_token, s_string, s_token, s_eol, }, // 0x51 Q
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
113 { s_token, s_token, s_string, s_token, s_eol, }, // 0x52 R
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
114 { s_token, s_token, s_string, s_token, s_eol, }, // 0x53 S
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
115 { s_token, s_token, s_string, s_token, s_eol, }, // 0x54 T
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
116 { s_token, s_token, s_string, s_token, s_eol, }, // 0x55 U
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
117 { s_token, s_token, s_string, s_token, s_eol, }, // 0x56 V
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
118 { s_token, s_token, s_string, s_token, s_eol, }, // 0x57 W
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
119 { s_token, s_token, s_string, s_token, s_eol, }, // 0x58 X
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
120 { s_token, s_token, s_string, s_token, s_eol, }, // 0x59 Y
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
121 { s_token, s_token, s_string, s_token, s_eol, }, // 0x5A Z
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
122 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5B [
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
123 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5C backslash
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
124 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5D ]
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
125 { s_single, s_term, s_string, s_single, s_eol, }, // 0x5E ^
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
126 { s_single, s_token, s_string, s_single, s_eol, }, // 0x5F _
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
127 { s_single, s_term, s_string, s_single, s_eol, }, // 0x60 `
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
128 { s_token, s_token, s_string, s_token, s_eol, }, // 0x61 a
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
129 { s_token, s_token, s_string, s_token, s_eol, }, // 0x62 b
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
130 { s_token, s_token, s_string, s_token, s_eol, }, // 0x63 c
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
131 { s_token, s_token, s_string, s_token, s_eol, }, // 0x64 d
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
132 { s_token, s_token, s_string, s_token, s_eol, }, // 0x65 e
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
133 { s_token, s_token, s_string, s_token, s_eol, }, // 0x66 f
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
134 { s_token, s_token, s_string, s_token, s_eol, }, // 0x67 g
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
135 { s_token, s_token, s_string, s_token, s_eol, }, // 0x68 h
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
136 { s_token, s_token, s_string, s_token, s_eol, }, // 0x69 i
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
137 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6A j
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
138 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6B k
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
139 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6C l
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
140 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6D m
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
141 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6E n
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
142 { s_token, s_token, s_string, s_token, s_eol, }, // 0x6F o
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
143 { s_token, s_token, s_string, s_token, s_eol, }, // 0x70 p
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
144 { s_token, s_token, s_string, s_token, s_eol, }, // 0x71 q
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
145 { s_token, s_token, s_string, s_token, s_eol, }, // 0x72 r
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
146 { s_token, s_token, s_string, s_token, s_eol, }, // 0x73 s
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
147 { s_token, s_token, s_string, s_token, s_eol, }, // 0x74 t
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
148 { s_token, s_token, s_string, s_token, s_eol, }, // 0x75 u
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
149 { s_token, s_token, s_string, s_token, s_eol, }, // 0x76 v
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
150 { s_token, s_token, s_string, s_token, s_eol, }, // 0x77 w
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
151 { s_token, s_token, s_string, s_token, s_eol, }, // 0x78 x
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
152 { s_token, s_token, s_string, s_token, s_eol, }, // 0x79 y
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
153 { s_token, s_token, s_string, s_token, s_eol, }, // 0x7A z
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
154 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7B {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
155 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7C |
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
156 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7D }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
157 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7E ~
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
158 { s_single, s_term, s_string, s_single, s_eol, }, // 0x7f
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
159 { s_single, s_term, s_string, s_single, s_eol, }, // 0x80
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
160 { s_single, s_term, s_string, s_single, s_eol, }, // 0x81
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
161 { s_single, s_term, s_string, s_single, s_eol, }, // 0x82
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
162 { s_single, s_term, s_string, s_single, s_eol, }, // 0x83
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
163 { s_single, s_term, s_string, s_single, s_eol, }, // 0x84
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
164 { s_single, s_term, s_string, s_single, s_eol, }, // 0x85
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
165 { s_single, s_term, s_string, s_single, s_eol, }, // 0x86
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
166 { s_single, s_term, s_string, s_single, s_eol, }, // 0x87
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
167 { s_single, s_term, s_string, s_single, s_eol, }, // 0x88
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
168 { s_single, s_term, s_string, s_single, s_eol, }, // 0x89
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
169 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8a
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
170 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8b
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
171 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8c
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
172 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8d
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
173 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8e
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
174 { s_single, s_term, s_string, s_single, s_eol, }, // 0x8f
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
175 { s_single, s_term, s_string, s_single, s_eol, }, // 0x90
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
176 { s_single, s_term, s_string, s_single, s_eol, }, // 0x91
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
177 { s_single, s_term, s_string, s_single, s_eol, }, // 0x92
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
178 { s_single, s_term, s_string, s_single, s_eol, }, // 0x93
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
179 { s_single, s_term, s_string, s_single, s_eol, }, // 0x94
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
180 { s_single, s_term, s_string, s_single, s_eol, }, // 0x95
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
181 { s_single, s_term, s_string, s_single, s_eol, }, // 0x96
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
182 { s_single, s_term, s_string, s_single, s_eol, }, // 0x97
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
183 { s_single, s_term, s_string, s_single, s_eol, }, // 0x98
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
184 { s_single, s_term, s_string, s_single, s_eol, }, // 0x99
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
185 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9a
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
186 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9b
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
187 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9c
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
188 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9d
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
189 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9e
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
190 { s_single, s_term, s_string, s_single, s_eol, }, // 0x9f
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
191 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
192 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
193 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
194 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
195 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
196 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
197 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
198 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
199 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
200 { s_single, s_term, s_string, s_single, s_eol, }, // 0xa9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
201 { s_single, s_term, s_string, s_single, s_eol, }, // 0xaa
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
202 { s_single, s_term, s_string, s_single, s_eol, }, // 0xab
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
203 { s_single, s_term, s_string, s_single, s_eol, }, // 0xac
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
204 { s_single, s_term, s_string, s_single, s_eol, }, // 0xad
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
205 { s_single, s_term, s_string, s_single, s_eol, }, // 0xae
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
206 { s_single, s_term, s_string, s_single, s_eol, }, // 0xaf
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
207 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
208 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
209 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
210 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
211 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
212 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
213 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
214 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
215 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
216 { s_single, s_term, s_string, s_single, s_eol, }, // 0xb9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
217 { s_single, s_term, s_string, s_single, s_eol, }, // 0xba
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
218 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbb
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
219 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbc
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
220 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbd
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
221 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbe
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
222 { s_single, s_term, s_string, s_single, s_eol, }, // 0xbf
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
223 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
224 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
225 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
226 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
227 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
228 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
229 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
230 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
231 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
232 { s_single, s_term, s_string, s_single, s_eol, }, // 0xc9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
233 { s_single, s_term, s_string, s_single, s_eol, }, // 0xca
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
234 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcb
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
235 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcc
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
236 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcd
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
237 { s_single, s_term, s_string, s_single, s_eol, }, // 0xce
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
238 { s_single, s_term, s_string, s_single, s_eol, }, // 0xcf
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
239 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
240 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
241 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
242 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
243 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
244 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
245 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
246 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
247 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
248 { s_single, s_term, s_string, s_single, s_eol, }, // 0xd9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
249 { s_single, s_term, s_string, s_single, s_eol, }, // 0xda
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
250 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdb
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
251 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdc
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
252 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdd
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
253 { s_single, s_term, s_string, s_single, s_eol, }, // 0xde
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
254 { s_single, s_term, s_string, s_single, s_eol, }, // 0xdf
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
255 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
256 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
257 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
258 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
259 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
260 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
261 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
262 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
263 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
264 { s_single, s_term, s_string, s_single, s_eol, }, // 0xe9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
265 { s_single, s_term, s_string, s_single, s_eol, }, // 0xea
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
266 { s_single, s_term, s_string, s_single, s_eol, }, // 0xeb
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
267 { s_single, s_term, s_string, s_single, s_eol, }, // 0xec
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
268 { s_single, s_term, s_string, s_single, s_eol, }, // 0xed
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
269 { s_single, s_term, s_string, s_single, s_eol, }, // 0xee
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
270 { s_single, s_term, s_string, s_single, s_eol, }, // 0xef
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
271 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf0
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
272 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf1
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
273 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf2
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
274 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf3
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
275 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf4
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
276 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf5
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
277 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf6
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
278 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf7
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
279 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf8
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
280 { s_single, s_term, s_string, s_single, s_eol, }, // 0xf9
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
281 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfa
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
282 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfb
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
283 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfc
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
284 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfd
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
285 { s_single, s_term, s_string, s_single, s_eol, }, // 0xfe
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
286 { s_single, s_term, s_string, s_single, s_eol, }, // 0xff
0
616666e2f34c initial version
carl
parents:
diff changeset
287 };
616666e2f34c initial version
carl
parents:
diff changeset
288
616666e2f34c initial version
carl
parents:
diff changeset
289
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
290 TOKEN::TOKEN(const char *fn, string_set *includes) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
291 pushed = false;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
292 include_files = includes;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
293 include(fn);
0
616666e2f34c initial version
carl
parents:
diff changeset
294 }
616666e2f34c initial version
carl
parents:
diff changeset
295
616666e2f34c initial version
carl
parents:
diff changeset
296
616666e2f34c initial version
carl
parents:
diff changeset
297 TOKEN::~TOKEN() {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
298 while (!streams.empty()) pop();
0
616666e2f34c initial version
carl
parents:
diff changeset
299 }
616666e2f34c initial version
carl
parents:
diff changeset
300
616666e2f34c initial version
carl
parents:
diff changeset
301
616666e2f34c initial version
carl
parents:
diff changeset
302 void TOKEN::pop() {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
303 ifstream *is = streams.front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
304 const char *fn = filenames.front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
305 streams.pop_front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
306 filenamess.erase(fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
307 if (filenames.size() > 1) filenames.pop_front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
308 if (linenumbers.size() > 1) linenumbers.pop_front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
309 is->close();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
310 delete is;
0
616666e2f34c initial version
carl
parents:
diff changeset
311 }
616666e2f34c initial version
carl
parents:
diff changeset
312
616666e2f34c initial version
carl
parents:
diff changeset
313
616666e2f34c initial version
carl
parents:
diff changeset
314 void TOKEN::push_char(u_char c) {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
315 pushed = true;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
316 pushed_char = c;
0
616666e2f34c initial version
carl
parents:
diff changeset
317 }
616666e2f34c initial version
carl
parents:
diff changeset
318
616666e2f34c initial version
carl
parents:
diff changeset
319
616666e2f34c initial version
carl
parents:
diff changeset
320 bool TOKEN::next_char(u_char &uc) {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
321 if (pushed) {
0
616666e2f34c initial version
carl
parents:
diff changeset
322 uc = (u_char)tolower((char)pushed_char);
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
323 pushed = false;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
324 return true;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
325 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
326 while (!streams.empty() && streams.front()->eof()) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
327 pop();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
328 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
329 if (streams.empty()) return false;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
330 ifstream *is = streams.front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
331 uc = (u_char)is->get();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
332 if (is->eof()) return next_char(uc);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
333 if (uc == (u_char)'\n') {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
334 int &line = linenumbers.front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
335 line++;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
336 }
0
616666e2f34c initial version
carl
parents:
diff changeset
337 uc = (u_char)tolower((char)uc);
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
338 return true;
0
616666e2f34c initial version
carl
parents:
diff changeset
339 }
616666e2f34c initial version
carl
parents:
diff changeset
340
616666e2f34c initial version
carl
parents:
diff changeset
341
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
342 bool TOKEN::include(const char *fn) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
343 string_set::iterator i = filenamess.find(fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
344 if (i != filenamess.end()) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
345 token_error("redundant or recursive include file detected");
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
346 return false;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
347 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
348 ifstream *is = new ifstream;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
349 is->open(fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
350 if (is->fail()) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
351 char buf[maxlen];
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
352 snprintf(buf, sizeof(buf), "include file %s not found", fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
353 token_error(buf);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
354 return false;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
355 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
356 string_set &inc = *include_files;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
357 inc.insert(fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
358 streams.push_front(is);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
359 filenames.push_front(fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
360 filenamess.insert(fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
361 linenumbers.push_front(1);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
362 return true;
0
616666e2f34c initial version
carl
parents:
diff changeset
363 }
616666e2f34c initial version
carl
parents:
diff changeset
364
616666e2f34c initial version
carl
parents:
diff changeset
365
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
366 const char *TOKEN::next() {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
367 if (!pending_tokens.empty()) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
368 const char *t = pending_tokens.front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
369 pending_tokens.pop_front();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
370 return t;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
371 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
372 if (streams.empty()) return NULL;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
373 const int PENDING_LIMIT = 1000;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
374 u_char buffer[PENDING_LIMIT];
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
375 int count = 0;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
376 state st = s_init;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
377 while (true) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
378 if (count == (PENDING_LIMIT-1)) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
379 token_error("token too long");
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
380 break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
381 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
382 if (st >= end_state) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
383 token_error("finite state machine error");
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
384 break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
385 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
386 u_char c;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
387 if (!next_char(c)) break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
388 st = parse_table[c][st];
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
389 switch (st) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
390 case s_string:
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
391 case s_token: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
392 buffer[count++] = c;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
393 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
394
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
395 case s_term: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
396 push_char(c);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
397 st = s_init;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
398 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
399
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
400 case s_string1: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
401 st = s_string;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
402 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
403
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
404 case s_string2: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
405 st = s_init;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
406 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
407
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
408 case s_single: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
409 buffer[count++] = c;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
410 st = s_init;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
411 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
412
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
413 case s_ignore:
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
414 case s_eol: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
415 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
416
616666e2f34c initial version
carl
parents:
diff changeset
417
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
418 case s_slash: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
419 buffer[count++] = c;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
420 if (next_char(c)) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
421 if (c == (u_char)'/') {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
422 // start of ignore to eol on //
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
423 count--;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
424 st = s_eol;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
425 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
426 else {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
427 // not a // token, just return this single /
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
428 push_char(c);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
429 st = s_init;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
430 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
431 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
432 else {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
433 // cannot get another char
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
434 st = s_init;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
435 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
436 } break;
0
616666e2f34c initial version
carl
parents:
diff changeset
437
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
438 default: {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
439 token_error();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
440 token_error("unknown state %d %s", st, " ");
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
441 } break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
442 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
443 if (st == s_init) break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
444 }
0
616666e2f34c initial version
carl
parents:
diff changeset
445
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
446 buffer[count] = '\0';
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
447 if (count == 0) return NULL;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
448 const char *t = register_string((char*)buffer);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
449 if (t == token_include) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
450 const char *f = next(); // should be file name
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
451 const char *s = next(); // should be semicolon
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
452 if (s == token_semi) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
453 include(f);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
454 return next();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
455 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
456 else {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
457 push(s);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
458 push(f);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
459 return t;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
460 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
461 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
462 return t;
0
616666e2f34c initial version
carl
parents:
diff changeset
463 }
616666e2f34c initial version
carl
parents:
diff changeset
464
616666e2f34c initial version
carl
parents:
diff changeset
465
616666e2f34c initial version
carl
parents:
diff changeset
466 int TOKEN::nextint() {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
467 const char *t = next();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
468 char *e;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
469 long i = strtol(t, &e, 10);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
470 if (*e != '\0') {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
471 token_error("integer", t);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
472 return 0;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
473 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
474 return (int)i;
0
616666e2f34c initial version
carl
parents:
diff changeset
475 }
616666e2f34c initial version
carl
parents:
diff changeset
476
616666e2f34c initial version
carl
parents:
diff changeset
477
616666e2f34c initial version
carl
parents:
diff changeset
478 void TOKEN::skipeol() {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
479 while (true) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
480 u_char c;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
481 if (!next_char(c)) break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
482 if (c == (u_char)'\n') break;
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
483 }
0
616666e2f34c initial version
carl
parents:
diff changeset
484 }
616666e2f34c initial version
carl
parents:
diff changeset
485
616666e2f34c initial version
carl
parents:
diff changeset
486
616666e2f34c initial version
carl
parents:
diff changeset
487 void TOKEN::token_error(const char *err) {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
488 token_error();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
489 char buf[maxlen];
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
490 snprintf(buf, sizeof(buf), "%s \n", err);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
491 my_syslog(buf);
0
616666e2f34c initial version
carl
parents:
diff changeset
492 }
616666e2f34c initial version
carl
parents:
diff changeset
493
616666e2f34c initial version
carl
parents:
diff changeset
494
616666e2f34c initial version
carl
parents:
diff changeset
495 void TOKEN::token_error(const char *fmt, int d, const char *s) {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
496 char buf[maxlen];
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
497 snprintf(buf, sizeof(buf), fmt, d, s);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
498 my_syslog(buf);
0
616666e2f34c initial version
carl
parents:
diff changeset
499 }
616666e2f34c initial version
carl
parents:
diff changeset
500
616666e2f34c initial version
carl
parents:
diff changeset
501
616666e2f34c initial version
carl
parents:
diff changeset
502 void TOKEN::token_error(const char *fmt, const char *t, const char *h) {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
503 if (!h) h = "null";
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
504 char buf[maxlen];
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
505 snprintf(buf, sizeof(buf), fmt, t, h);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
506 my_syslog(buf);
0
616666e2f34c initial version
carl
parents:
diff changeset
507 }
616666e2f34c initial version
carl
parents:
diff changeset
508
616666e2f34c initial version
carl
parents:
diff changeset
509
616666e2f34c initial version
carl
parents:
diff changeset
510 void TOKEN::token_error(const char *want, const char *have) {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
511 token_error();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
512 token_error("expecting %s, found %s", want, have);
0
616666e2f34c initial version
carl
parents:
diff changeset
513 }
616666e2f34c initial version
carl
parents:
diff changeset
514
616666e2f34c initial version
carl
parents:
diff changeset
515
616666e2f34c initial version
carl
parents:
diff changeset
516 void TOKEN::token_error() {
19
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
517 token_error("syntax error at line %d in file %s -- ", cur_line(), cur_fn());
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
518 line_list::iterator j = linenumbers.begin();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
519 string_list::const_iterator i = filenames.begin();
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
520 for (; i!=filenames.end(); i++,j++) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
521 if (i != filenames.begin()) {
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
522 const char *fn = (*i);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
523 int li = (*j);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
524 token_error(" included from line %d in file %s -- ", li, fn);
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
525 }
b24369330483 Fedora 9 compile and const correctness.
Carl Byington <carl@five-ten-sg.com>
parents: 17
diff changeset
526 }
0
616666e2f34c initial version
carl
parents:
diff changeset
527 }
616666e2f34c initial version
carl
parents:
diff changeset
528