2 * The Regina Rexx Interpreter
3 * Copyright (C) 1992-1994 Anders Christensen <anders@pvv.unit.no>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #define X_REP_FOREVER 11
48 #define X_PARSE_ARG 30
49 #define X_PARSE_EXT 31
50 #define X_PARSE_PULL 32
51 #define X_PARSE_SRC 33
52 #define X_PARSE_VAR 34
53 #define X_PARSE_VAL 35
54 #define X_PARSE_VER 36
64 #define X_OTHERWISE 46
72 #define X_S_NOVALUE 54
75 #define X_UPPER_VAR 57
95 #define X_SIM_SYMBOL 77
96 #define X_CON_SYMBOL 78
104 #define X_TPL_SOLID 86
107 #define X_TPL_SYMBOL 89
108 #define X_TPL_POINT 90
109 #define X_POS_OFFS 91
110 #define X_NEG_OFFS 92
111 #define X_ABS_OFFS 93
112 #define X_EXPRLIST 94
113 #define X_S_NOTREADY 95
114 #define X_S_FAILURE 96
116 #define X_CALL_SET 98
117 #define X_NO_OTHERWISE 99
118 #define X_IND_SYMBOL 100
119 #define X_IS_INTERNAL 101
120 #define X_IS_BUILTIN 102
121 #define X_IS_EXTERNAL 103
122 #define X_CTAIL_SYMBOL 104
123 #define X_VTAIL_SYMBOL 105
124 #define X_HEAD_SYMBOL 106
125 #define X_STEM_SYMBOL 107
138 #define X_NASSIGN 120
139 #define X_CEXPRLIST 121
140 #define X_U_PLUSS 122
141 #define X_OPTIONS 123
143 #define X_NUM_DDEF 125
144 #define X_NUM_FDEF 126
145 #define X_NUM_FRMDEF 127
152 #define X_ADDR_WITH 134
153 #define X_S_LOSTDIGITS 135
154 #define X_DO_EXPR 136
157 /* The three first two numbers have not errortext attched to them */
158 #define ERR_PROG_UNREADABLE 3
159 #define ERR_PROG_INTERRUPT 4
160 #define ERR_STORAGE_EXHAUSTED 5
161 #define ERR_UNMATCHED_QUOTE 6
162 #define ERR_WHEN_EXPECTED 7
163 #define ERR_THEN_UNEXPECTED 8
164 #define ERR_WHEN_UNEXPECTED 9
165 #define ERR_UNMATCHED_END 10
166 #define ERR_FULL_CTRL_STACK 11
167 #define ERR_TOO_LONG_LINE 12
168 #define ERR_INVALID_CHAR 13
169 #define ERR_INCOMPLETE_STRUCT 14
170 #define ERR_INVALID_HEX_CONST 15
171 #define ERR_UNEXISTENT_LABEL 16
172 #define ERR_UNEXPECTED_PROC 17
173 #define ERR_THEN_EXPECTED 18
174 #define ERR_STRING_EXPECTED 19
175 #define ERR_SYMBOL_EXPECTED 20
176 #define ERR_EXTRA_DATA 21
177 /* The next to number have not been assigned an errortext */
178 #define ERR_INVALID_TRACE 24
179 #define ERR_INV_SUBKEYWORD 25
180 #define ERR_INVALID_INTEGER 26
181 #define ERR_INVALID_DO_SYNTAX 27
182 #define ERR_INVALID_LEAVE 28
183 #define ERR_ENVIRON_TOO_LONG 29
184 #define ERR_TOO_LONG_STRING 30
185 #define ERR_INVALID_START 31
186 #define ERR_INVALID_STEM 32
187 #define ERR_INVALID_RESULT 33
188 #define ERR_UNLOGICAL_VALUE 34
189 #define ERR_INVALID_EXPRESSION 35
190 #define ERR_UNMATCHED_PARAN 36
191 #define ERR_UNEXPECTED_PARAN 37
192 #define ERR_INVALID_TEMPLATE 38
193 #define ERR_STACK_OVERFLOW 39
194 #define ERR_INCORRECT_CALL 40
195 #define ERR_BAD_ARITHMETIC 41
196 #define ERR_ARITH_OVERFLOW 42
197 #define ERR_ROUTINE_NOT_FOUND 43
198 #define ERR_NO_DATA_RETURNED 44
199 #define ERR_DATA_NOT_SPEC 45
200 /* No errortexts have not been defined to the next to numbers */
201 #define ERR_SYSTEM_FAILURE 48
202 #define ERR_INTERPRETER_FAILURE 49
203 #define ERR_RESERVED_SYMBOL 50
204 #define ERR_UNQUOTED_FUNC_STOP 51
205 #define ERR_INVALID_OPTION 53
206 #define ERR_INVALID_STEM_OPTION 54
208 #define ERR_CANT_REWIND 60
209 #define ERR_IMPROPER_SEEK 61
211 #define ERR_YACC_SYNTAX 64
213 #define ERR_NON_ANSI_FEATURE 90
214 #define ERR_STREAM_COMMAND 93
215 #define ERR_EXTERNAL_QUEUE 94
217 #define ERR_RESTRICTED 95
219 #define ERR_UNKNOWN_FS_ERROR 100
221 #define ERR_MAX_NUMBER 100
223 #define ENV_BOURNE_SH 0
224 #define ENV_C_SHELL 1
225 #define ENV_COMMAND 2
232 * NOTE: There is a close correspondance between these and the char
233 * array alloc in memory.c
235 # define TRC_LEAKED 0 /* "leaked", status unknown, probably leaked */
236 # define TRC_HASHTAB 1 /* "hashtab", holds hashtable in variable subsystem */
237 # define TRC_PROCBOX 2 /* "procbox", the info local to a single routine */
238 # define TRC_SOURCE 3 /* "source", a line of source code */
239 # define TRC_SOURCEL 4 /* "srcbox", box in list of source lines */
240 # define TRC_TREENODE 5 /* "treenode", node in the parse three */
241 # define TRC_VARVALUE 6 /* "var_val", value of a variable */
242 # define TRC_VARNAME 7 /* "var_nam", name of a variable */
243 # define TRC_VARBOX 8 /* "var_box", other structure in the variable subsystem */
244 # define TRC_STACKBOX 9 /* "stc_box", box in linked list of the stack lines */
245 # define TRC_STACKLINE 10 /* "stc_line", stack line */
246 # define TRC_SYSINFO 11 /* "sys_info", the common info for a whole program */
247 # define TRC_FILEPTR 12 /* "file_ptr", holds the filetable */
248 # define TRC_PROCARG 13 /* "proc_arg", holds arguments for internal or builtin functions */
249 # define TRC_LABEL 14 /* "label", holds info about labels */
250 # define TRC_STATIC 15 /* "static", names of special variables */
251 # define TRC_P_CACHE 16 /* "argcache", the proc argument cache */
252 # define TRC_MATH 17 /* "math", dynamic workarrays in the math funcstion */
253 # define TRC_ENVIRBOX 18 /* "envirbx", box holding environment definition */
254 # define TRC_ENVIRNAME 19 /* "envirnm", name in a box holding environment definition */
255 # define TRC_SPCV_BOX 20 /* "spcvarbx", special variable box */
256 # define TRC_SPCV_NAME 21 /* "spcvarnm", special variable name */
257 # define TRC_SPCV_NUMB 22 /* "spcnumbx", special number box */
258 # define TRC_SPCV_NUMC 23 /* "spcnumnm", special number contents */
262 # define MEMTRC_NONE 0
263 # define MEMTRC_ALL 1
264 # define MEMTRC_LEAKED 2
267 # define MEM_CURRENT 1
268 # define MEM_LEAKED 2
269 #endif /* TRACEMEM */
273 * Note: must match the definition of numeric_forms in rexx.c
275 #define NUM_FORM_SCI 0
276 #define NUM_FORM_ENG 1
279 #define SIGNAL_FATAL -1
280 #define SIGNAL_ERROR 0
281 #define SIGNAL_FAILURE 1
282 #define SIGNAL_HALT 2
283 #define SIGNAL_NOVALUE 3
284 #define SIGNAL_NOTREADY 4
285 #define SIGNAL_SYNTAX 5
286 #define SIGNAL_LOSTDIGITS 6
290 #define SIGTYPE_OFF 1
291 #define SIGTYPE_DELAY 2
294 #define ENVIR_SHELL 1
296 #if defined(_AMIGA) || defined(__AROS__)
297 #define ENVIR_AMIGA 3
300 #define SUBENVIR_PATH 1
301 #define SUBENVIR_SYSTEM 2
302 #define SUBENVIR_COMMAND 3
303 #define SUBENVIR_REXX 4
306 #define REDIR_NONE 0x00000000
307 #define REDIR_INPUT 0x00000001
308 #define REDIR_OUTLIFO 0x00000002
309 #define REDIR_OUTFIFO 0x00000004
310 #define REDIR_OUTPUT 0x00000006
311 #define REDIR_CLEAR 0x00000008
312 #define REDIR_OUTSTRING 0x00000010
315 #define HOOK_LINEFEED 1
321 #define HOOK_STDOUT 0
322 #define HOOK_STDERR 1
326 #define HOOK_TERMIN 5
327 #define HOOK_SUBCOM 6
329 #define HOOK_GETENV 8
330 #define HOOK_SETENV 9
331 #define HOOK_GETCWD 10
332 #define HOOK_SETCWD 11
334 #define HOOK_MASK(a) (1<<(a))
336 #define PARAM_TYPE_HARD 0
337 #define PARAM_TYPE_SOFT 1
339 #define INVO_COMMAND 0
340 #define INVO_FUNCTION 1
341 #define INVO_SUBROUTINE 2
344 #define SYMBOL_CONSTANT 1
345 #define SYMBOL_STEM 2
346 #define SYMBOL_SIMPLE 3
347 #define SYMBOL_COMPOUND 4
348 #define SYMBOL_NUMBER 5
351 #define VFLAG_NONE 0x0000
352 #define VFLAG_STR 0x0001
353 #define VFLAG_NUM 0x0002
355 #define VFLAG_BOTH (VFLAG_STR | VFLAG_NUM)
357 #define UNKNOWN_QUEUE -1
359 * For refering to the extensions.
361 #define EXT_FLUSHSTACK 0
362 #define EXT_LINEOUTTRUNC 1
363 #define EXT_BUFTYPE_BIF 2
364 #define EXT_DESBUF_BIF 3
365 #define EXT_DROPBUF_BIF 4
366 #define EXT_MAKEBUF_BIF 5
367 #define EXT_CACHEEXT 6
368 #define EXT_PRUNE_TRACE 7
369 #define EXT_EXT_COMMANDS_AS_FUNCS 8
370 #define EXT_STDOUT_FOR_STDERR 9
371 #define EXT_TRACE_HTML 10
372 #define EXT_FAST_LINES_BIF_DEFAULT 11
373 #define EXT_STRICT_ANSI 12
374 #define EXT_INTERNAL_QUEUES 13
375 #define EXT_REGINA_BIFS 14
376 #define EXT_STRICT_WHITE_SPACE_COMPARISONS 15
377 #define EXT_AREXX_SEMANTICS 16
378 #define EXT_AREXX_BIFS 17
379 #define EXT_BROKEN_ADDRESS_COMMAND 18
380 #define EXT_CALLS_AS_FUNCS 19
381 #define EXT_QUEUES_301 20
382 #define EXT_HALT_ON_EXT_CALL_FAIL 21
383 #define EXT_SINGLE_INTERPRETER 22
384 #define EXT_RESULTS 23
387 * Regina 3.1 introduced "pool 0" variables. There exist only some and they
388 * can be determined by known_reserved_variable. Here are the return
389 * values of this function.
391 #define POOL0_NOT_RESERVED 0 /* must be 0, following must be consecutive */
392 #define POOL0_RC 1 /* Never change the order, it is hard-wired */
393 #define POOL0_RESULT 2 /* used in variable.c */
398 #define POOL0_ENDOFLINE 7
399 #define POOL0_CNT ( POOL0_ENDOFLINE + 1 )
402 * treenode.u.parseflags values which may be or'ed.
404 #define PARSE_NORMAL 0
405 #define PARSE_UPPER 1
406 #define PARSE_LOWER 2
407 #define PARSE_CASELESS 4