3 * Copyright 1996-2017 Ian Jackson <ian@davenant.greenend.org.uk>.
4 * Copyright 2000 Ben Harris <bjh21@cam.ac.uk>
5 * Copyright 2016-2017 Peter Benie <pjb1008@cam.ac.uk>
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with userv; if not, see <http://www.gnu.org/licenses/>.
30 tokm_instance= 0x000000ff,
31 tokm_repres= 0x00000f00,
32 tokm_type= 0xfffff000,
33 tokr_nonstring= 0x00000100,
34 tokr_word= 0x00000200,
35 tokr_punct= 0x00000300,
36 tokr_string= 0x00000400,
37 tokt_directive= 0x00001000,
38 tokt_controlstart= 0x00002000,
39 tokt_controlend= 0x00004000,
40 tokt_exception= 0x00008000,
41 tokt_parmcondition= 0x00010000,
42 tokt_condop= 0x00020000,
43 tokt_parameter= 0x00040000,
44 tokt_number= 0x00080000,
45 tokt_fdrange= 0x00100000,
46 tokt_logfacility= 0x00200000,
47 tokt_loglevel= 0x00400000,
48 tokt_readwrite= 0x00800000,
49 tokt_string= 0x01000000,
50 tokt_execmode= 0x02000000,
51 tokt_ehandlemode= 0x04000000,
52 tokt_lookupquotemode= 0x08000000,
53 tokt_builtinservice= 0x10000000,
54 tokt_misc= 0x20000000,
55 tokt_internal= 0x40000000,
57 toki_word_reject= 0x00000001,
58 toki_word_executefromdirectory= 0x00000002,
59 toki_word_executefrompath= 0x00000003,
60 toki_word_executebuiltin= 0x00000004,
61 toki_word_errorstostderr= 0x00000005,
62 toki_word_errorstosyslog= 0x00000006,
63 toki_word_errorstofile= 0x00000007,
64 toki_word_includelookupquoteold= 0x00000008,
65 toki_word_includelookupquotenew= 0x00000009,
66 toki_word_requirefd= 0x0000000a,
67 toki_word_allowfd= 0x0000000b,
68 toki_word_nullfd= 0x0000000c,
69 toki_word_rejectfd= 0x0000000d,
70 toki_word_ignorefd= 0x0000000e,
71 toki_word_setenvironment= 0x0000000f,
72 toki_word_nosetenvironment= 0x00000010,
73 toki_word_suppressargs= 0x00000011,
74 toki_word_nosuppressargs= 0x00000012,
75 toki_word_disconnecthup= 0x00000013,
76 toki_word_nodisconnecthup= 0x00000014,
77 toki_word_cd= 0x00000015,
78 toki_word_userrcfile= 0x00000016,
79 toki_word_include= 0x00000017,
80 toki_word_includeifexist= 0x00000018,
81 toki_word_includelookup= 0x00000019,
82 toki_word_includelookupall= 0x0000001a,
83 toki_word_includedirectory= 0x0000001b,
84 toki_word_message= 0x0000001c,
85 toki_word_includesysconfig= 0x0000001d,
86 toki_word_includeuserrcfile= 0x0000001e,
87 toki_word_includeclientconfig= 0x0000001f,
88 toki_word_quit= 0x00000020,
89 toki_word_eof= 0x00000021,
90 toki_word_if= 0x00000022,
91 toki_word_catchquit= 0x00000023,
92 toki_word_errorspush= 0x00000024,
93 toki_word_elif= 0x00000025,
94 toki_word_else= 0x00000026,
95 toki_word_fi= 0x00000027,
96 toki_word_hctac= 0x00000028,
97 toki_word_srorre= 0x00000029,
98 toki_word_glob= 0x0000002a,
99 toki_word_range= 0x0000002b,
100 toki_word_grep= 0x0000002c,
101 toki_word_environment= 0x0000002d,
102 toki_word_parameter= 0x0000002e,
103 toki_word_version= 0x0000002f,
104 toki_word_toplevel= 0x00000030,
105 toki_word_override= 0x00000031,
106 toki_word_shutdown= 0x00000032,
107 toki_word_reset= 0x00000033,
108 toki_word_execute= 0x00000034,
109 toki_word_help= 0x00000035,
110 toki_word_service= 0x00000036,
111 toki_word_callinguser= 0x00000037,
112 toki_word_callinggroup= 0x00000038,
113 toki_word_callingusershell= 0x00000039,
114 toki_word_serviceuser= 0x0000003a,
115 toki_word_servicegroup= 0x0000003b,
116 toki_word_serviceusershell= 0x0000003c,
117 toki_syslog_debug= 0x0000003d,
118 toki_syslog_info= 0x0000003e,
119 toki_syslog_notice= 0x0000003f,
120 toki_syslog_warning= 0x00000040,
121 toki_syslog_err= 0x00000041,
122 toki_syslog_crit= 0x00000042,
123 toki_syslog_alert= 0x00000043,
124 toki_syslog_emerg= 0x00000044,
125 toki_syslog_authpriv= 0x00000045,
126 toki_syslog_cron= 0x00000046,
127 toki_syslog_daemon= 0x00000047,
128 toki_syslog_kern= 0x00000048,
129 toki_syslog_lpr= 0x00000049,
130 toki_syslog_mail= 0x0000004a,
131 toki_syslog_news= 0x0000004b,
132 toki_syslog_syslog= 0x0000004c,
133 toki_syslog_user= 0x0000004d,
134 toki_syslog_uucp= 0x0000004e,
135 toki_syslog_local0= 0x0000004f,
136 toki_syslog_local1= 0x00000050,
137 toki_syslog_local2= 0x00000051,
138 toki_syslog_local3= 0x00000052,
139 toki_syslog_local4= 0x00000053,
140 toki_syslog_local5= 0x00000054,
141 toki_syslog_local6= 0x00000055,
142 toki_syslog_local7= 0x00000056,
143 toki_word_read= 0x00000057,
144 toki_word_write= 0x00000058,
145 toki_ordinal= 0x00000059,
146 toki_fdrange= 0x0000005a,
147 toki_fdstoend= 0x0000005b,
148 toki_dollar= 0x0000005c,
149 toki_word_stdin= 0x0000005d,
150 toki_word_stdout= 0x0000005e,
151 toki_word_stderr= 0x0000005f,
152 toki_lwsp= 0x00000060,
153 toki_newline= 0x00000061,
154 toki_barestring= 0x00000062,
155 toki_quotedstring= 0x00000063,
156 toki_eof= 0x00000064,
157 toki_quit= 0x00000065,
158 toki_error= 0x00000066,
159 toki_openparen= 0x00000067,
160 toki_closeparen= 0x00000068,
161 toki_not= 0x00000069,
162 toki_and= 0x0000006a,
164 toki_word_error= 0x0000006c,
166 tokv_word_reject= tokt_directive|tokt_execmode|tokr_word|toki_word_reject,
167 tokv_word_executefromdirectory=tokt_directive|tokt_execmode|tokr_word|toki_word_executefromdirectory,
168 tokv_word_executefrompath= tokt_directive|tokt_execmode|tokr_word|toki_word_executefrompath,
169 tokv_word_executebuiltin= tokt_directive|tokt_execmode|tokr_word|toki_word_executebuiltin,
170 tokv_word_errorstostderr= tokt_directive|tokt_ehandlemode|tokr_word|toki_word_errorstostderr,
171 tokv_word_errorstosyslog= tokt_directive|tokt_ehandlemode|tokr_word|toki_word_errorstosyslog,
172 tokv_word_errorstofile= tokt_directive|tokt_ehandlemode|tokr_word|toki_word_errorstofile,
173 tokv_word_includelookupquoteold=tokt_directive|tokt_lookupquotemode|tokr_word|toki_word_includelookupquoteold,
174 tokv_word_includelookupquotenew=tokt_directive|tokt_lookupquotemode|tokr_word|toki_word_includelookupquotenew,
175 tokv_word_requirefd= tokt_directive|tokr_word|toki_word_requirefd,
176 tokv_word_allowfd= tokt_directive|tokr_word|toki_word_allowfd,
177 tokv_word_nullfd= tokt_directive|tokr_word|toki_word_nullfd,
178 tokv_word_rejectfd= tokt_directive|tokr_word|toki_word_rejectfd,
179 tokv_word_ignorefd= tokt_directive|tokr_word|toki_word_ignorefd,
180 tokv_word_setenvironment= tokt_directive|tokr_word|toki_word_setenvironment,
181 tokv_word_nosetenvironment= tokt_directive|tokr_word|toki_word_nosetenvironment,
182 tokv_word_suppressargs= tokt_directive|tokr_word|toki_word_suppressargs,
183 tokv_word_nosuppressargs= tokt_directive|tokr_word|toki_word_nosuppressargs,
184 tokv_word_disconnecthup= tokt_directive|tokr_word|toki_word_disconnecthup,
185 tokv_word_nodisconnecthup= tokt_directive|tokr_word|toki_word_nodisconnecthup,
186 tokv_word_cd= tokt_directive|tokr_word|toki_word_cd,
187 tokv_word_userrcfile= tokt_directive|tokr_word|toki_word_userrcfile,
188 tokv_word_include= tokt_directive|tokr_word|toki_word_include,
189 tokv_word_includeifexist= tokt_directive|tokr_word|toki_word_includeifexist,
190 tokv_word_includelookup= tokt_directive|tokr_word|toki_word_includelookup,
191 tokv_word_includelookupall= tokt_directive|tokr_word|toki_word_includelookupall,
192 tokv_word_includedirectory= tokt_directive|tokr_word|toki_word_includedirectory,
193 tokv_word_message= tokt_directive|tokr_word|toki_word_message,
194 tokv_word_includesysconfig= tokt_directive|tokt_internal|tokr_word|toki_word_includesysconfig,
195 tokv_word_includeuserrcfile= tokt_directive|tokt_internal|tokr_word|toki_word_includeuserrcfile,
196 tokv_word_includeclientconfig=tokt_directive|tokt_internal|tokr_word|toki_word_includeclientconfig,
197 tokv_word_quit= tokt_directive|tokr_word|toki_word_quit,
198 tokv_word_eof= tokt_directive|tokr_word|toki_word_eof,
199 tokv_word_if= tokt_directive|tokt_controlstart|tokr_word|toki_word_if,
200 tokv_word_catchquit= tokt_directive|tokt_controlstart|tokr_word|toki_word_catchquit,
201 tokv_word_errorspush= tokt_directive|tokt_controlstart|tokr_word|toki_word_errorspush,
202 tokv_word_elif= tokt_controlend|tokt_controlstart|tokr_word|toki_word_elif,
203 tokv_word_else= tokt_controlend|tokt_controlstart|tokr_word|toki_word_else,
204 tokv_word_fi= tokt_controlend|tokr_word|toki_word_fi,
205 tokv_word_hctac= tokt_controlend|tokr_word|toki_word_hctac,
206 tokv_word_srorre= tokt_controlend|tokr_word|toki_word_srorre,
207 tokv_word_glob= tokt_parmcondition|tokr_word|toki_word_glob,
208 tokv_word_range= tokt_parmcondition|tokr_word|toki_word_range,
209 tokv_word_grep= tokt_parmcondition|tokr_word|toki_word_grep,
210 tokv_word_environment= tokt_builtinservice|tokr_word|toki_word_environment,
211 tokv_word_parameter= tokt_builtinservice|tokr_word|toki_word_parameter,
212 tokv_word_version= tokt_builtinservice|tokr_word|toki_word_version,
213 tokv_word_toplevel= tokt_builtinservice|tokr_word|toki_word_toplevel,
214 tokv_word_override= tokt_builtinservice|tokr_word|toki_word_override,
215 tokv_word_shutdown= tokt_builtinservice|tokr_word|toki_word_shutdown,
216 tokv_word_reset= tokt_builtinservice|tokt_directive|tokr_word|toki_word_reset,
217 tokv_word_execute= tokt_builtinservice|tokt_directive|tokt_execmode|tokr_word|toki_word_execute,
218 tokv_word_help= tokt_builtinservice|tokr_word|toki_word_help,
219 tokv_word_service= tokt_parameter|tokr_word|toki_word_service,
220 tokv_word_callinguser= tokt_parameter|tokr_word|toki_word_callinguser,
221 tokv_word_callinggroup= tokt_parameter|tokr_word|toki_word_callinggroup,
222 tokv_word_callingusershell= tokt_parameter|tokr_word|toki_word_callingusershell,
223 tokv_word_serviceuser= tokt_parameter|tokr_word|toki_word_serviceuser,
224 tokv_word_servicegroup= tokt_parameter|tokr_word|toki_word_servicegroup,
225 tokv_word_serviceusershell= tokt_parameter|tokr_word|toki_word_serviceusershell,
226 tokv_syslog_debug= tokt_loglevel|tokr_word|toki_syslog_debug,
227 tokv_syslog_info= tokt_loglevel|tokr_word|toki_syslog_info,
228 tokv_syslog_notice= tokt_loglevel|tokr_word|toki_syslog_notice,
229 tokv_syslog_warning= tokt_loglevel|tokr_word|toki_syslog_warning,
230 tokv_syslog_err= tokt_loglevel|tokr_word|toki_syslog_err,
231 tokv_syslog_crit= tokt_loglevel|tokr_word|toki_syslog_crit,
232 tokv_syslog_alert= tokt_loglevel|tokr_word|toki_syslog_alert,
233 tokv_syslog_emerg= tokt_loglevel|tokr_word|toki_syslog_emerg,
234 tokv_syslog_authpriv= tokt_logfacility|tokr_word|toki_syslog_authpriv,
235 tokv_syslog_cron= tokt_logfacility|tokr_word|toki_syslog_cron,
236 tokv_syslog_daemon= tokt_logfacility|tokr_word|toki_syslog_daemon,
237 tokv_syslog_kern= tokt_logfacility|tokr_word|toki_syslog_kern,
238 tokv_syslog_lpr= tokt_logfacility|tokr_word|toki_syslog_lpr,
239 tokv_syslog_mail= tokt_logfacility|tokr_word|toki_syslog_mail,
240 tokv_syslog_news= tokt_logfacility|tokr_word|toki_syslog_news,
241 tokv_syslog_syslog= tokt_logfacility|tokr_word|toki_syslog_syslog,
242 tokv_syslog_user= tokt_logfacility|tokr_word|toki_syslog_user,
243 tokv_syslog_uucp= tokt_logfacility|tokr_word|toki_syslog_uucp,
244 tokv_syslog_local0= tokt_logfacility|tokr_word|toki_syslog_local0,
245 tokv_syslog_local1= tokt_logfacility|tokr_word|toki_syslog_local1,
246 tokv_syslog_local2= tokt_logfacility|tokr_word|toki_syslog_local2,
247 tokv_syslog_local3= tokt_logfacility|tokr_word|toki_syslog_local3,
248 tokv_syslog_local4= tokt_logfacility|tokr_word|toki_syslog_local4,
249 tokv_syslog_local5= tokt_logfacility|tokr_word|toki_syslog_local5,
250 tokv_syslog_local6= tokt_logfacility|tokr_word|toki_syslog_local6,
251 tokv_syslog_local7= tokt_logfacility|tokr_word|toki_syslog_local7,
252 tokv_word_read= tokt_readwrite|tokr_word|toki_word_read,
253 tokv_word_write= tokt_readwrite|tokr_word|toki_word_write,
254 tokv_ordinal= tokt_number|tokt_fdrange|tokr_word|toki_ordinal,
255 tokv_fdrange= tokt_fdrange|tokr_punct|toki_fdrange,
256 tokv_fdstoend= tokt_fdrange|tokr_punct|toki_fdstoend,
257 tokv_dollar= tokt_misc|tokr_punct|toki_dollar,
258 tokv_word_stdin= tokt_fdrange|tokr_word|toki_word_stdin,
259 tokv_word_stdout= tokt_fdrange|tokr_word|toki_word_stdout,
260 tokv_word_stderr= tokt_fdrange|tokr_word|toki_word_stderr,
261 tokv_lwsp= tokt_misc|tokr_nonstring|toki_lwsp,
262 tokv_newline= tokt_misc|tokr_nonstring|toki_newline,
263 tokv_barestring= tokt_string|tokr_string|toki_barestring,
264 tokv_quotedstring= tokt_string|tokr_string|toki_quotedstring,
265 tokv_eof= tokt_exception|tokr_nonstring|toki_eof,
266 tokv_quit= tokt_exception|tokr_nonstring|toki_quit,
267 tokv_error= tokt_exception|tokr_nonstring|toki_error,
268 tokv_openparen= tokt_condop|tokr_punct|toki_openparen,
269 tokv_closeparen= tokt_condop|tokr_punct|toki_closeparen,
270 tokv_not= tokt_condop|tokr_punct|toki_not,
271 tokv_and= tokt_condop|tokr_punct|toki_and,
272 tokv_or= tokt_condop|tokr_punct|toki_or,
273 tokv_word_error= tokt_directive|tokt_loglevel|tokr_word|toki_word_error,