1 /****************************************************************************
2 **
3 ** This file is part of GAP, a system for computational discrete algebra.
4 **
5 ** Copyright of GAP belongs to its developers, whose names are too numerous
6 ** to list here. Please refer to the COPYRIGHT file for details.
7 **
8 ** SPDX-License-Identifier: GPL-2.0-or-later
9 **
10 ** This file declares the functions of the coder package.
11 **
12 ** The coder package is the part of the interpreter that creates the
13 ** expressions. Its functions are called from the reader.
14 */
15
16 #ifndef GAP_CODE_H
17 #define GAP_CODE_H
18
19 #include "gapstate.h"
20 #include "objects.h"
21
22 /****************************************************************************
23 **
24 *T StatHeader
25 **
26 */
27 typedef struct {
28 unsigned int visited : 1;
29 unsigned int line : 31;
30 unsigned int size : 24;
31 unsigned int type : 8;
32 } StatHeader;
33
34 GAP_STATIC_ASSERT((sizeof(StatHeader) % sizeof(Stat)) == 0,
35 "StatHeader size must be multiple of Stat size");
36
37 /****************************************************************************
38 **
39 *V PtrBody . . . . . . . . . . . . . . . . . . . . . pointer to current body
40 **
41 ** 'PtrBody' is a pointer to the current body.
42 */
43 /* TL: extern Stat * PtrBody; */
44
45
46 /****************************************************************************
47 **
48 ** Function body headers
49 **
50 ** 'FILENAME_BODY' is a string containing the file of a function.
51 ** 'STARTLINE_BODY' is the line number where a function starts.
52 ** 'ENDLINE_BODY' is the line number where a function ends.
53 ** 'LOCATION_BODY' is a string describing the location of a function.
54 ** Typically this will be the name of a C function implementing it.
55 **
56 ** These each have a 'GET' and a 'SET' variant, to read or set the value.
57 ** Note that STARTLINE_BODY and LOCATION_BODY are stored in the same place,
58 ** so writing one will overwrite the other.
59 **
60 ** All of these variables may be 0, if the information is not known,
61 */
62
63 typedef struct {
64 // if non-zero, this is either a string containing the name of the
65 // file of a function, or an immediate integer containing the index
66 // of the filename inside FilenameCache
67 Obj filename_or_id;
68
69 // if non-zero, this is either an immediate integer encoding the
70 // line number where a function starts, or string describing the
71 // location of a function. Typically this will be the name of a C
72 // function implementing it.
73 Obj startline_or_location;
74
75 // if non-zero, this is an immediate integer encoding the line
76 // number where a function ends
77 Obj endline;
78
79 // if non-zero, this points to a dense plist containing constant values
80 // referenced by the code in this function body
81 Obj values;
82
83 } BodyHeader;
84
BODY_HEADER(Obj body)85 EXPORT_INLINE BodyHeader *BODY_HEADER(Obj body)
86 {
87 GAP_ASSERT(TNUM_OBJ(body) == T_BODY);
88 return (BodyHeader *)ADDR_OBJ(body);
89 }
90
91 Obj GET_FILENAME_BODY(Obj body);
92 void SET_FILENAME_BODY(Obj body, Obj val);
93
94 UInt GET_GAPNAMEID_BODY(Obj body);
95 void SET_GAPNAMEID_BODY(Obj body, UInt val);
96
97 Obj GET_LOCATION_BODY(Obj body);
98 void SET_LOCATION_BODY(Obj body, Obj val);
99
100 UInt GET_STARTLINE_BODY(Obj body);
101 void SET_STARTLINE_BODY(Obj body, UInt val);
102 UInt GET_ENDLINE_BODY(Obj body);
103 void SET_ENDLINE_BODY(Obj body, UInt val);
104
105 Obj GET_VALUE_FROM_CURRENT_BODY(Int ix);
106
VALUES_BODY(Obj body)107 EXPORT_INLINE Obj VALUES_BODY(Obj body)
108 {
109 return BODY_HEADER(body)->values;
110 }
111
112
113 /****************************************************************************
114 **
115 *F NewStatOrExpr(<type>,<size>,<line>) . . . . . . allocate a new statement
116 **
117 ** 'NewStatOrExpr' allocates a new statement or expressions memory block of
118 ** type <type> and with <size> bytes. It also records the line number <line>
119 ** of the statement for profiling. It returns the offset of the new
120 ** statement.
121 **
122 ** Callers may pass zero for <line> to denote a statement which should not
123 ** be tracked by the profiling code.
124 */
125 Stat NewStatOrExpr(UInt type, UInt size, UInt line);
126
127
128 void PushStat(Stat stat);
129
130
131 /****************************************************************************
132 **
133 *V OFFSET_FIRST_STAT . . . . . . . . . . offset of first statement in a body
134 **
135 ** 'OFFSET_FIRST_STAT' is the offset of the first statement in a body.
136 */
137
138 enum {
139 OFFSET_FIRST_STAT = sizeof(StatHeader)+sizeof(BodyHeader)
140 };
141
142
143 /****************************************************************************
144 **
145 *F NewFunctionBody() . . . . . . . . . . . . . . create a new function body
146 */
147 Obj NewFunctionBody(void);
148
149
150 void WRITE_EXPR(Expr expr, UInt idx, UInt val);
151
152
153 /****************************************************************************
154 **
155 *S T_<name> . . . . . . . . . . . . . . symbolic names for statement types
156 *S FIRST_STAT_TNUM . . . . . . . . . . . . . . . . . . first statement type
157 *S LAST_STAT_TNUM . . . . . . . . . . . . . . . . . . . last statement type
158 **
159 ** For every type of statements there is a symbolic name defined for this
160 ** type.
161 */
162 enum STAT_TNUM {
163 START_ENUM_RANGE(FIRST_STAT_TNUM),
164
165 STAT_PROCCALL_0ARGS,
166 STAT_PROCCALL_1ARGS,
167 STAT_PROCCALL_2ARGS,
168 STAT_PROCCALL_3ARGS,
169 STAT_PROCCALL_4ARGS,
170 STAT_PROCCALL_5ARGS,
171 STAT_PROCCALL_6ARGS,
172 STAT_PROCCALL_XARGS,
173
174 STAT_PROCCALL_OPTS,
175
176 // STAT_EMPTY could also be considered to be "T_SEQ_STAT0", but it
177 // must be an interruptible statement, so that loops with empty
178 // body can be interrupted.
179 STAT_EMPTY,
180
181 // The statement types between FIRST_NON_INTERRUPT_STAT and
182 // LAST_NON_INTERRUPT_STAT will not be interrupted (which may happen
183 // for two reasons: the user interrupted, e.g. via ctrl-c; or memory
184 // run full). We don't want to compound statements to be interrupted,
185 // relying instead on their sub-statements being interruptible. This
186 // results in a slightly better user experience in break loops, where
187 // the interrupted statement is printed, which works better for
188 // single statements than for compound statements.
189 START_ENUM_RANGE(FIRST_NON_INTERRUPT_STAT),
190
191 START_ENUM_RANGE(FIRST_COMPOUND_STAT),
192
193 STAT_SEQ_STAT,
194 STAT_SEQ_STAT2,
195 STAT_SEQ_STAT3,
196 STAT_SEQ_STAT4,
197 STAT_SEQ_STAT5,
198 STAT_SEQ_STAT6,
199 STAT_SEQ_STAT7,
200
201 STAT_IF,
202 STAT_IF_ELSE,
203 STAT_IF_ELIF,
204 STAT_IF_ELIF_ELSE,
205
206 STAT_FOR,
207 STAT_FOR2,
208 STAT_FOR3,
209
210 STAT_FOR_RANGE,
211 STAT_FOR_RANGE2,
212 STAT_FOR_RANGE3,
213
214 STAT_WHILE,
215 STAT_WHILE2,
216 STAT_WHILE3,
217
218 STAT_REPEAT,
219 STAT_REPEAT2,
220 STAT_REPEAT3,
221
222 #ifdef HPCGAP
223 STAT_ATOMIC,
224 #endif
225
226 END_ENUM_RANGE(LAST_COMPOUND_STAT),
227
228 END_ENUM_RANGE(LAST_NON_INTERRUPT_STAT),
229
230 START_ENUM_RANGE(FIRST_CONTROL_FLOW_STAT),
231
232 STAT_BREAK,
233 STAT_CONTINUE,
234 STAT_RETURN_OBJ,
235 STAT_RETURN_VOID,
236
237 END_ENUM_RANGE(LAST_CONTROL_FLOW_STAT),
238
239 STAT_ASS_LVAR,
240 STAT_UNB_LVAR,
241
242 STAT_ASS_HVAR,
243 STAT_UNB_HVAR,
244
245 STAT_ASS_GVAR,
246 STAT_UNB_GVAR,
247
248 STAT_ASS_LIST,
249 STAT_ASS_MAT,
250 STAT_ASSS_LIST,
251 STAT_ASS_LIST_LEV,
252 STAT_ASSS_LIST_LEV,
253 STAT_UNB_LIST,
254
255 STAT_ASS_REC_NAME,
256 STAT_ASS_REC_EXPR,
257 STAT_UNB_REC_NAME,
258 STAT_UNB_REC_EXPR,
259
260 STAT_ASS_POSOBJ,
261 STAT_UNB_POSOBJ,
262
263 STAT_ASS_COMOBJ_NAME,
264 STAT_ASS_COMOBJ_EXPR,
265 STAT_UNB_COMOBJ_NAME,
266 STAT_UNB_COMOBJ_EXPR,
267
268 STAT_INFO,
269 STAT_ASSERT_2ARGS,
270 STAT_ASSERT_3ARGS,
271 STAT_PRAGMA,
272
273 END_ENUM_RANGE(LAST_STAT_TNUM),
274 };
275
276
277 /****************************************************************************
278 **
279 *F ADDR_STAT(<stat>) . . . . . . . . . . . . absolute address of a statement
280 **
281 ** 'ADDR_STAT' returns the absolute address of the memory block of the
282 ** statement <stat>.
283 */
CONST_ADDR_STAT(Stat stat)284 EXPORT_INLINE const Stat * CONST_ADDR_STAT(Stat stat)
285 {
286 return (const Stat *)STATE(PtrBody) + stat / sizeof(Stat);
287 }
288
289
290 /****************************************************************************
291 **
292 *F READ_STAT(<stat>,<idx>)
293 */
READ_STAT(Stat stat,UInt idx)294 EXPORT_INLINE Stat READ_STAT(Stat stat, UInt idx)
295 {
296 return CONST_ADDR_STAT(stat)[idx];
297 }
298
299
300 /****************************************************************************
301 **
302 *F CONST_STAT_HEADER(<stat>)
303 */
CONST_STAT_HEADER(Stat stat)304 EXPORT_INLINE const StatHeader * CONST_STAT_HEADER(Stat stat)
305 {
306 return (const StatHeader *)CONST_ADDR_STAT(stat) - 1;
307 }
308
309
310 /****************************************************************************
311 **
312 *F TNUM_STAT(<stat>) . . . . . . . . . . . . . . . . . . type of a statement
313 **
314 ** 'TNUM_STAT' returns the type of the statement <stat>.
315 */
TNUM_STAT(Stat stat)316 EXPORT_INLINE Int TNUM_STAT(Stat stat)
317 {
318 return CONST_STAT_HEADER(stat)->type;
319 }
320
321
322 /****************************************************************************
323 **
324 *F SIZE_STAT(<stat>) . . . . . . . . . . . . . . . . . . size of a statement
325 **
326 ** 'SIZE_STAT' returns the size of the statement <stat>.
327 */
SIZE_STAT(Stat stat)328 EXPORT_INLINE Int SIZE_STAT(Stat stat)
329 {
330 return CONST_STAT_HEADER(stat)->size;
331 }
332
333
334 /****************************************************************************
335 **
336 *F LINE_STAT(<stat>) . . . . . . . . . . . . . . line number of a statement
337 **
338 ** 'LINE_STAT' returns the line number of the statement <stat>.
339 */
LINE_STAT(Stat stat)340 EXPORT_INLINE Int LINE_STAT(Stat stat)
341 {
342 return CONST_STAT_HEADER(stat)->line;
343 }
344
345
346 /****************************************************************************
347 **
348 *F VISITED_STAT(<stat>) . . . . . . . . . . . if statement has even been run
349 **
350 ** 'VISITED_STAT' returns true if the statement has ever been executed
351 ** while profiling is turned on.
352 */
VISITED_STAT(Stat stat)353 EXPORT_INLINE Int VISITED_STAT(Stat stat)
354 {
355 return CONST_STAT_HEADER(stat)->visited;
356 }
357
358
359 /****************************************************************************
360 **
361 *F SET_VISITED_STAT(<stat>) . . . . . . . . . . mark statement as having run
362 **
363 ** 'SET_VISITED_STAT' marks the statement as having been executed while
364 ** profiling wass turned on.
365 */
366 void SET_VISITED_STAT(Stat stat);
367
368
369 /****************************************************************************
370 **
371 *F IS_REF_LVAR(<expr>) . . . test if an expression is a reference to a local
372 *F REF_LVAR_LVAR(<lvar>) . . . . . convert a local to a reference to a local
373 *F LVAR_REF_LVAR(<expr>) . . . . . convert a reference to a local to a local
374 **
375 ** 'IS_REF_LVAR' returns 1 if the expression <expr> is an (immediate)
376 ** reference to a local variable, and 0 otherwise.
377 **
378 ** 'REF_LVAR_LVAR' returns a (immediate) reference to the local variable
379 ** <lvar> (given by its index).
380 **
381 ** 'LVAR_REF_LVAR' returns the local variable (by its index) to which <expr>
382 ** is a (immediate) reference.
383 */
IS_REF_LVAR(Expr expr)384 EXPORT_INLINE Int IS_REF_LVAR(Expr expr)
385 {
386 return ((Int)expr & 0x03) == 0x03;
387 }
388
REF_LVAR_LVAR(Int lvar)389 EXPORT_INLINE Expr REF_LVAR_LVAR(Int lvar)
390 {
391 return (Expr)((lvar << 2) + 0x03);
392 }
393
LVAR_REF_LVAR(Expr expr)394 EXPORT_INLINE Int LVAR_REF_LVAR(Expr expr)
395 {
396 return (Int)expr >> 2;
397 }
398
399
400 /****************************************************************************
401 **
402 *F IS_INTEXPR(<expr>). . . . test if an expression is an integer expression
403 *F INTEXPR_INT(<i>) . . . . . convert a C integer to an integer expression
404 *F INT_INTEXPR(<expr>) . . . . convert an integer expression to a C integer
405 **
406 ** 'IS_INTEXPR' returns 1 if the expression <expr> is an (immediate) integer
407 ** expression, and 0 otherwise.
408 **
409 ** 'INTEXPR_INT' converts the C integer <i> to an (immediate) integer
410 ** expression.
411 **
412 ** 'INT_INTEXPR' converts the (immediate) integer expression <expr> to a C
413 ** integer.
414 */
IS_INTEXPR(Expr expr)415 EXPORT_INLINE Int IS_INTEXPR(Expr expr)
416 {
417 return ((Int)expr & 0x03) == 0x01;
418 }
419
INTEXPR_INT(Int indx)420 EXPORT_INLINE Expr INTEXPR_INT(Int indx)
421 {
422 return (Expr)(((UInt)indx << 2) + 0x01);
423 }
424
INT_INTEXPR(Expr expr)425 EXPORT_INLINE Int INT_INTEXPR(Expr expr)
426 {
427 return ((Int)expr-0x01) >> 2;
428 }
429
430
431 /****************************************************************************
432 **
433 *S T_<name> . . . . . . . . . . . . . . symbolic names for expression types
434 *S FIRST_EXPR_TNUM . . . . . . . . . . . . . . . . . . first expression type
435 *S LAST_EXPR_TNUM . . . . . . . . . . . . . . . . . . last expression type
436 **
437 ** For every type of expressions there is a symbolic name defined for this
438 ** type.
439 */
440 enum EXPR_TNUM {
441 START_ENUM_RANGE_INIT(FIRST_EXPR_TNUM, 128),
442
443 EXPR_FUNCCALL_0ARGS,
444 EXPR_FUNCCALL_1ARGS,
445 EXPR_FUNCCALL_2ARGS,
446 EXPR_FUNCCALL_3ARGS,
447 EXPR_FUNCCALL_4ARGS,
448 EXPR_FUNCCALL_5ARGS,
449 EXPR_FUNCCALL_6ARGS,
450 EXPR_FUNCCALL_XARGS,
451 EXPR_FUNC,
452
453 EXPR_FUNCCALL_OPTS,
454
455 EXPR_OR,
456 EXPR_AND,
457 EXPR_NOT,
458 EXPR_EQ,
459 EXPR_NE,
460 EXPR_LT,
461 EXPR_GE,
462 EXPR_GT,
463 EXPR_LE,
464 EXPR_IN,
465 EXPR_SUM,
466 EXPR_AINV,
467 EXPR_DIFF,
468 EXPR_PROD,
469 EXPR_QUO,
470 EXPR_MOD,
471 EXPR_POW,
472
473 EXPR_INT,
474 EXPR_INTPOS,
475 EXPR_TRUE,
476 EXPR_FALSE,
477 EXPR_TILDE,
478 EXPR_CHAR,
479 EXPR_PERM,
480 EXPR_PERM_CYCLE,
481 EXPR_LIST,
482 EXPR_LIST_TILDE,
483 EXPR_RANGE,
484 EXPR_STRING,
485 EXPR_REC,
486 EXPR_REC_TILDE,
487
488 EXPR_FLOAT_EAGER,
489 EXPR_FLOAT_LAZY,
490
491 EXPR_REF_LVAR,
492 EXPR_ISB_LVAR,
493
494 EXPR_REF_HVAR,
495 EXPR_ISB_HVAR,
496
497 EXPR_REF_GVAR,
498 EXPR_ISB_GVAR,
499
500 EXPR_ELM_LIST,
501 EXPR_ELM_MAT,
502 EXPR_ELMS_LIST,
503 EXPR_ELM_LIST_LEV,
504 EXPR_ELMS_LIST_LEV,
505 EXPR_ISB_LIST,
506
507 EXPR_ELM_REC_NAME,
508 EXPR_ELM_REC_EXPR,
509 EXPR_ISB_REC_NAME,
510 EXPR_ISB_REC_EXPR,
511
512 EXPR_ELM_POSOBJ,
513 EXPR_ISB_POSOBJ,
514
515 EXPR_ELM_COMOBJ_NAME,
516 EXPR_ELM_COMOBJ_EXPR,
517 EXPR_ISB_COMOBJ_NAME,
518 EXPR_ISB_COMOBJ_EXPR,
519
520 END_ENUM_RANGE(LAST_EXPR_TNUM)
521 };
522
523
524 /****************************************************************************
525 **
526 *F TNUM_EXPR(<expr>) . . . . . . . . . . . . . . . . . type of an expression
527 **
528 ** 'TNUM_EXPR' returns the type of the expression <expr>.
529 */
TNUM_EXPR(Expr expr)530 EXPORT_INLINE Int TNUM_EXPR(Expr expr)
531 {
532 if (IS_REF_LVAR(expr))
533 return EXPR_REF_LVAR;
534 if (IS_INTEXPR(expr))
535 return EXPR_INT;
536 return TNUM_STAT(expr);
537 }
538
539
540 /****************************************************************************
541 **
542 *F SIZE_EXPR(<expr>) . . . . . . . . . . . . . . . . . size of an expression
543 **
544 ** 'SIZE_EXPR' returns the size of the expression <expr>.
545 **
546 ** Note that it is *fatal* to apply 'SIZE_EXPR' to expressions of type
547 ** 'EXPR_REF_LVAR' or 'EXPR_INT'.
548 */
549 #define SIZE_EXPR(expr) SIZE_STAT(expr)
550
551
552 /****************************************************************************
553 **
554 *F ADDR_EXPR(<expr>) . . . . . . . . . . . absolute address of an expression
555 **
556 ** 'ADDR_EXPR' returns the absolute address of the memory block of the
557 ** expression <expr>.
558 **
559 ** Note that it is *fatal* to apply 'ADDR_EXPR' to expressions of type
560 ** 'EXPR_REF_LVAR' or 'EXPR_INT'.
561 */
562 #define CONST_ADDR_EXPR(expr) CONST_ADDR_STAT(expr)
563
564 #define READ_EXPR(expr, idx) (CONST_ADDR_EXPR(expr)[idx])
565
566 /****************************************************************************
567 **
568 *F FUNC_CALL(<call>) . . . . . . . . . . . . . function for a function call
569 *F ARGI_CALL(<call>,<i>) . . . . <i>-th formal argument for a function call
570 *F NARG_SIZE_CALL(<size>) . . . . . number of arguments for a function call
571 *F SIZE_NARG_CALL(<narg>) . . . . . . . size of the bag for a function call
572 **
573 ** 'FUNC_CALL' returns the expression that should evaluate to the function
574 ** for the procedure or function call <call>. This is a legal left value,
575 ** so it can be used to set the expression too.
576 **
577 ** 'ARGI_CALL' returns the expression that evaluate to the <i>-th actual
578 ** argument for the procedure or function call <call>. This is a legal left
579 ** value, so it can be used to set the expression too.
580 **
581 ** 'NARG_SIZE_CALL' returns the number of arguments in a function call from
582 ** the size <size> of the function call bag (as returned by 'SIZE_EXPR').
583 **
584 ** 'SIZE_NARG_CALL' returns the size a function call bag should have for a
585 ** function call bag with <narg> arguments.
586 */
587 #define FUNC_CALL(call) READ_EXPR(call, 0)
588 #define ARGI_CALL(call,i) READ_EXPR(call, i)
589 #define NARG_SIZE_CALL(size) (((size) / sizeof(Expr)) - 1)
590 #define SIZE_NARG_CALL(narg) (((narg) + 1) * sizeof(Expr))
591
592
593 /****************************************************************************
594 **
595 *F ARGI_INFO(<info>,<i>) . . . <i>-th formal argument for an Info statement
596 *F NARG_SIZE_INFO(<size>) . . . . number of arguments for an Info statement
597 *F SIZE_NARG_INFO(<narg>) . . . . . . size of the bag for an Info statement
598 **
599 ** 'ARGI_INFO' returns the expression that evaluates to the <i>-th actual
600 ** argument for the Info statement <info>. This is a legal left value, so
601 ** it can be used to set the expression too.
602 **
603 ** 'NARG_SIZE_INFO' returns the number of arguments in a function call from
604 ** the size <size> of the function call bag (as returned by 'SIZE_STAT').
605 **
606 ** 'SIZE_NARG_INFO' returns the size a function call bag should have for a
607 ** function call bag with <narg> arguments.
608 */
609 #define ARGI_INFO(info,i) READ_STAT(info, (i) - 1)
610 #define NARG_SIZE_INFO(size) ((size) / sizeof(Expr))
611 #define SIZE_NARG_INFO(narg) ((narg) * sizeof(Expr))
612
613
614 /****************************************************************************
615 **
616 *V CodeResult . . . . . . . . . . . . . . . . . . . . . . result of coding
617 **
618 ** 'CodeResult' is the result of the coding, i.e., the function that was
619 ** coded.
620 */
621 /* TL: extern Obj CodeResult; */
622
623
624 /****************************************************************************
625 **
626 *F * * * * * * * * * * * * * coder functions * * * * * * * * * * * * * * * *
627 */
628
629 /****************************************************************************
630 **
631 *F CodeBegin() . . . . . . . . . . . . . . . . . . . . . . . start the coder
632 *F CodeEnd(<error>) . . . . . . . . . . . . . . . . . . . . stop the coder
633 **
634 ** 'CodeBegin' starts the coder. It is called from the immediate
635 ** interpreter when he encounters a construct that it cannot immediately
636 ** interpret.
637 **
638 ** 'CodeEnd' stops the coder. It is called from the immediate interpreter
639 ** when he is done with the construct that it cannot immediately interpret.
640 ** If <error> is non-zero, a syntax error was detected by the reader, and
641 ** the coder should only clean up. Otherwise, returns the newly coded
642 ** function.
643 **
644 ** ...only function expressions inbetween...
645 */
646 void CodeBegin(void);
647
648 Obj CodeEnd(UInt error);
649
650
651 /****************************************************************************
652 **
653 *F CodeFuncCallBegin() . . . . . . . . . . . . . . code function call, begin
654 *F CodeFuncCallEnd(<funccall>,<options>, <nr>) . code function call, end
655 **
656 ** 'CodeFuncCallBegin' is an action to code a function call. It is called
657 ** by the reader when it encounters the parenthesis '(', i.e., *after* the
658 ** function expression is read.
659 **
660 ** 'CodeFuncCallEnd' is an action to code a function call. It is called by
661 ** the reader when it encounters the parenthesis ')', i.e., *after* the
662 ** argument expressions are read. <funccall> is 1 if this is a function
663 ** call, and 0 if this is a procedure call. <nr> is the number of
664 ** arguments. <options> is 1 if options were present after the ':' in which
665 ** case the options have been read already.
666 */
667 void CodeFuncCallBegin(void);
668
669 void CodeFuncCallEnd(UInt funccall, UInt options, UInt nr);
670
671
672 /****************************************************************************
673 **
674 *F CodeFuncExprBegin(<narg>,<nloc>,<nams>,<startline>) . code function expression, begin
675 *F CodeFuncExprEnd(<nr>,<pushExpr>) . . . . . code function expression, end
676 **
677 ** 'CodeFuncExprBegin' is an action to code a function expression. It is
678 ** called when the reader encounters the beginning of a function expression.
679 ** <narg> is the number of arguments (-1 if the function takes a variable
680 ** number of arguments), <nloc> is the number of locals, <nams> is a list of
681 ** local variable names.
682 **
683 ** 'CodeFuncExprEnd' is an action to code a function expression. It is
684 ** called when the reader encounters the end of a function expression. <nr>
685 ** is the number of statements in the body of the function. If <pushExpr> is
686 ** set, the current function expression is pushed on the expression stack.
687 */
688 void CodeFuncExprBegin(Int narg, Int nloc, Obj nams, Int startLine);
689
690 Expr CodeFuncExprEnd(UInt nr, UInt pushExpr);
691
692 /****************************************************************************
693 **
694 *F AddValueToBody( <val> ) . . . . . . . . . . . store value in values list
695 **
696 ** 'AddValueToBody' adds a value into the value list of the body of the
697 ** function currently being coded, and returns the index at which the value
698 ** was inserted. This function must only be called while coding a function.
699 */
700 Int AddValueToBody(Obj val);
701
702 /****************************************************************************
703 **
704 *F CodeFuncCallOptionsBegin() . . . . . . . . . . . . . code options, begin
705 *F CodeFuncCallOptionsBeginElmName(<rnam>). . . code options, begin element
706 *F CodeFuncCallOptionsBeginElmExpr() . .. . . . .code options, begin element
707 *F CodeFuncCallOptionsEndElm() . . .. . . . . . . code options, end element
708 *F CodeFuncCallOptionsEndElmEmpty() .. . . . . . .code options, end element
709 *F CodeFuncCallOptionsEnd(<nr>) . . . . . . . . . . . . . code options, end
710 **
711 ** The net effect of all of these is to leave a record expression on the
712 ** stack containing the options record. It will be picked up by
713 ** CodeFuncCallEnd().
714 **
715 */
716 void CodeFuncCallOptionsBegin(void);
717
718
719 void CodeFuncCallOptionsBeginElmName(UInt rnam);
720
721 void CodeFuncCallOptionsBeginElmExpr(void);
722
723 void CodeFuncCallOptionsEndElm(void);
724
725
726 void CodeFuncCallOptionsEndElmEmpty(void);
727
728 void CodeFuncCallOptionsEnd(UInt nr);
729
730
731 /****************************************************************************
732 **
733 *F CodeIfBegin() . . . . . . . . . . . code if-statement, begin of statement
734 *F CodeIfElif() . . . . . . . . . . code if-statement, begin of elif-branch
735 *F CodeIfElse() . . . . . . . . . . code if-statement, begin of else-branch
736 *F CodeIfBeginBody() . . . . . . . . . . . code if-statement, begin of body
737 *F CodeIfEndBody(<nr>) . . . . . . . . . . . code if-statement, end of body
738 *F CodeIfEnd(<nr>) . . . . . . . . . . . code if-statement, end of statement
739 **
740 ** 'CodeIfBegin' is an action to code an if-statement. It is called when
741 ** the reader encounters the 'if', i.e., *before* the condition is read.
742 **
743 ** 'CodeIfElif' is an action to code an if-statement. It is called when the
744 ** reader encounters an 'elif', i.e., *before* the condition is read.
745 **
746 ** 'CodeIfElse' is an action to code an if-statement. It is called when the
747 ** reader encounters an 'else'.
748 **
749 ** 'CodeIfBeginBody' is an action to code an if-statement. It is called
750 ** when the reader encounters the beginning of the statement body of an
751 ** 'if', 'elif', or 'else' branch, i.e., *after* the condition is read.
752 **
753 ** 'CodeIfEndBody' is an action to code an if-statement. It is called when
754 ** the reader encounters the end of the statements body of an 'if', 'elif',
755 ** or 'else' branch. <nr> is the number of statements in the body.
756 **
757 ** 'CodeIfEnd' is an action to code an if-statement. It is called when the
758 ** reader encounters the end of the statement. <nr> is the number of 'if',
759 ** 'elif', or 'else' branches.
760 */
761 void CodeIfBegin(void);
762
763 void CodeIfElif(void);
764
765 void CodeIfElse(void);
766
767 Int CodeIfBeginBody(void);
768
769 Int CodeIfEndBody(UInt nr);
770
771 void CodeIfEnd(UInt nr);
772
773
774 /****************************************************************************
775 **
776 *F CodeForBegin() . . . . . . . . . code for-statement, begin of statement
777 *F CodeForIn() . . . . . . . . . . . . . . . . code for-statement, 'in' read
778 *F CodeForBeginBody() . . . . . . . . . . code for-statement, begin of body
779 *F CodeForEndBody(<nr>) . . . . . . . . . . code for-statement, end of body
780 *F CodeForEnd() . . . . . . . . . . . code for-statement, end of statement
781 **
782 ** 'CodeForBegin' is an action to code a for-statement. It is called when
783 ** the reader encounters the 'for', i.e., *before* the variable is read.
784 **
785 ** 'CodeForIn' is an action to code a for-statement. It is called when the
786 ** reader encounters the 'in', i.e., *after* the variable is read, but
787 ** *before* the list expression is read.
788 **
789 ** 'CodeForBeginBody' is an action to code a for-statement. It is called
790 ** when the reader encounters the beginning of the statement body, i.e.,
791 ** *after* the list expression is read.
792 **
793 ** 'CodeForEndBody' is an action to code a for-statement. It is called when
794 ** the reader encounters the end of the statement body. <nr> is the number
795 ** of statements in the body.
796 **
797 ** 'CodeForEnd' is an action to code a for-statement. It is called when the
798 ** reader encounters the end of the statement, i.e., immediately after
799 ** 'CodeForEndBody'.
800 */
801 void CodeForBegin(void);
802
803 void CodeForIn(void);
804
805 void CodeForBeginBody(void);
806
807 void CodeForEndBody(UInt nr);
808
809 void CodeForEnd(void);
810
811 /****************************************************************************
812 **
813 *F CodeAtomicBegin() . . . . . . . code atomic-statement, begin of statement
814 *F CodeAtomicBeginBody() . . . . . . . code atomic-statement, begin of body
815 *F CodeAtomicEndBody(<nr>) . . . . . . . code atomic-statement, end of body
816 *F CodeAtomicEnd() . . . . . . . . . code atomic-statement, end of statement
817 **
818 ** 'CodeAtomicBegin' is an action to code an atomic-statement. It is called
819 ** when the reader encounters the 'atomic', i.e., *before* the condition is
820 ** read.
821 **
822 ** 'CodeAtomicBeginBody' is an action to code a atomic-statement. It is
823 ** called when the reader encounters the beginning of the statement body,
824 ** i.e., *after* the condition is read.
825 **
826 ** 'CodeAtomicEndBody' is an action to code a atomic-statement. It is called
827 ** when the reader encounters the end of the statement body. <nr> is the
828 ** number of statements in the body.
829 **
830 ** 'CodeAtomicEnd' is an action to code a atomic-statement. It is called
831 ** when the reader encounters the end of the statement, i.e., immediately
832 ** after 'CodeAtomicEndBody'.
833 */
834
835 void CodeAtomicBegin(void);
836
837 void CodeAtomicBeginBody(UInt nrexprs);
838
839 void CodeAtomicEndBody(UInt nrstats);
840 void CodeAtomicEnd(void);
841
842 /****************************************************************************
843 **
844 *F CodeQualifiedExprBegin() . . . code readonly/readwrite expression start
845 *F CodeQualifiedExprEnd() . . . . . code readonly/readwrite expression end
846 **
847 */
848
849 void CodeQualifiedExprBegin(UInt qual);
850
851 void CodeQualifiedExprEnd(void);
852
853
854 /****************************************************************************
855 **
856 *F CodeWhileBegin() . . . . . . . code while-statement, begin of statement
857 *F CodeWhileBeginBody() . . . . . . . . code while-statement, begin of body
858 *F CodeWhileEndBody(<nr>) . . . . . . . . code while-statement, end of body
859 *F CodeWhileEnd() . . . . . . . . . code while-statement, end of statement
860 **
861 ** 'CodeWhileBegin' is an action to code a while-statement. It is called
862 ** when the reader encounters the 'while', i.e., *before* the condition is
863 ** read.
864 **
865 ** 'CodeWhileBeginBody' is an action to code a while-statement. It is
866 ** called when the reader encounters the beginning of the statement body,
867 ** i.e., *after* the condition is read.
868 **
869 ** 'CodeWhileEndBody' is an action to code a while-statement. It is called
870 ** when the reader encounters the end of the statement body. <nr> is the
871 ** number of statements in the body.
872 **
873 ** 'CodeWhileEnd' is an action to code a while-statement. It is called when
874 ** the reader encounters the end of the statement, i.e., immediate after
875 ** 'CodeWhileEndBody'.
876 */
877 void CodeWhileBegin(void);
878
879 void CodeWhileBeginBody(void);
880
881 void CodeWhileEndBody(UInt nr);
882
883 void CodeWhileEnd(void);
884
885
886 /****************************************************************************
887 **
888 *F CodeRepeatBegin() . . . . . . . code repeat-statement, begin of statement
889 *F CodeRepeatBeginBody() . . . . . . . code repeat-statement, begin of body
890 *F CodeRepeatEndBody(<nr>) . . . . . . . code repeat-statement, end of body
891 *F CodeRepeatEnd() . . . . . . . . . code repeat-statement, end of statement
892 **
893 ** 'CodeRepeatBegin' is an action to code a repeat-statement. It is called
894 ** when the reader encounters the 'repeat'.
895 **
896 ** 'CodeRepeatBeginBody' is an action to code a repeat-statement. It is
897 ** called when the reader encounters the beginning of the statement body,
898 ** i.e., immediately after 'CodeRepeatBegin'.
899 **
900 ** 'CodeRepeatEndBody' is an action to code a repeat-statement. It is
901 ** called when the reader encounters the end of the statement body, i.e.,
902 ** *before* the condition is read. <nr> is the number of statements in the
903 ** body.
904 **
905 ** 'CodeRepeatEnd' is an action to code a repeat-statement. It is called
906 ** when the reader encounters the end of the statement, i.e., *after* the
907 ** condition is read.
908 */
909 void CodeRepeatBegin(void);
910
911 void CodeRepeatBeginBody(void);
912
913 void CodeRepeatEndBody(UInt nr);
914
915 void CodeRepeatEnd(void);
916
917
918 /****************************************************************************
919 **
920 *F CodeBreak() . . . . . . . . . . . . . . . . . . . . code break-statement
921 **
922 ** 'CodeBreak' is the action to code a break-statement. It is called when
923 ** the reader encounters a 'break;'.
924 */
925 void CodeBreak(void);
926
927
928 /****************************************************************************
929 **
930 *F CodeReturnObj() . . . . . . . . . . . . . . . code return-value-statement
931 **
932 ** 'CodeReturnObj' is the action to code a return-value-statement. It is
933 ** called when the reader encounters a 'return <expr>;', but *after* reading
934 ** the expression <expr>.
935 */
936 void CodeReturnObj(void);
937
938
939 /****************************************************************************
940 **
941 *F CodeReturnVoid() . . . . . . . . . . . . . . code return-void-statement
942 **
943 ** 'CodeReturnVoid' is the action to code a return-void-statement. It is
944 ** called when the reader encounters a 'return;'.
945 **
946 ** 'CodeReturnVoidWhichIsNotProfiled' creates a return which will not
947 ** be tracked by profiling. This is used for the implicit return put
948 ** at the end of functions.
949 */
950 void CodeReturnVoid(void);
951 void CodeReturnVoidWhichIsNotProfiled(void);
952
953 /****************************************************************************
954 **
955 *F CodeOr() . . . . . . . . . . . . . . . . . . . . . . code or-expression
956 *F CodeAnd() . . . . . . . . . . . . . . . . . . . . . . code and-expression
957 *F CodeNot() . . . . . . . . . . . . . . . . . . . . . . code not-expression
958 *F CodeEq() . . . . . . . . . . . . . . . . . . . . . . . code =-expression
959 *F CodeNe() . . . . . . . . . . . . . . . . . . . . . . code <>-expression
960 *F CodeLt() . . . . . . . . . . . . . . . . . . . . . . . code <-expression
961 *F CodeGe() . . . . . . . . . . . . . . . . . . . . . . code >=-expression
962 *F CodeGt() . . . . . . . . . . . . . . . . . . . . . . . code >-expression
963 *F CodeLe() . . . . . . . . . . . . . . . . . . . . . . code <=-expression
964 *F CodeIn() . . . . . . . . . . . . . . . . . . . . . . code in-expression
965 *F CodeSum() . . . . . . . . . . . . . . . . . . . . . . . code +-expression
966 *F CodeAInv() . . . . . . . . . . . . . . . . . . . code unary --expression
967 *F CodeDiff() . . . . . . . . . . . . . . . . . . . . . . code --expression
968 *F CodeProd() . . . . . . . . . . . . . . . . . . . . . . code *-expression
969 *F CodeQuo() . . . . . . . . . . . . . . . . . . . . . . . code /-expression
970 *F CodeMod() . . . . . . . . . . . . . . . . . . . . . . code mod-expression
971 *F CodePow() . . . . . . . . . . . . . . . . . . . . . . . code ^-expression
972 **
973 ** 'CodeOr', 'CodeAnd', 'CodeNot', 'CodeEq', 'CodeNe', 'CodeGt', 'CodeGe',
974 ** 'CodeIn', 'CodeSum', 'CodeDiff', 'CodeProd', 'CodeQuo', 'CodeMod', and
975 ** 'CodePow' are the actions to code the respective operator expressions.
976 ** They are called by the reader *after* *both* operands are read.
977 */
978 void CodeOrL(void);
979
980 void CodeOr(void);
981
982 void CodeAndL(void);
983
984 void CodeAnd(void);
985
986 void CodeNot(void);
987
988 void CodeEq(void);
989
990 void CodeNe(void);
991
992 void CodeLt(void);
993
994 void CodeGe(void);
995
996 void CodeGt(void);
997
998 void CodeLe(void);
999
1000 void CodeIn(void);
1001
1002 void CodeSum(void);
1003
1004 void CodeAInv(void);
1005
1006 void CodeDiff(void);
1007
1008 void CodeProd(void);
1009
1010 void CodeQuo(void);
1011
1012 void CodeMod(void);
1013
1014 void CodePow(void);
1015
1016
1017 /****************************************************************************
1018 **
1019 *F CodeIntExpr(<val>) . . . . . . . . . . . code literal integer expression
1020 **
1021 ** 'CodeIntExpr' is the action to code a literal integer expression. <val>
1022 ** is the integer as a GAP object.
1023 */
1024 void CodeIntExpr(Obj val);
1025
1026 /****************************************************************************
1027 **
1028 *F CodeTildeExpr() . . . . . . . . . . . . . . code tilde expression
1029 **
1030 ** 'CodeTildeExpr' is the action to code a tilde expression.
1031 */
1032 void CodeTildeExpr(void);
1033
1034 /****************************************************************************
1035 **
1036 *F CodeTrueExpr() . . . . . . . . . . . . . . code literal true expression
1037 **
1038 ** 'CodeTrueExpr' is the action to code a literal true expression.
1039 */
1040 void CodeTrueExpr(void);
1041
1042
1043 /****************************************************************************
1044 **
1045 *F CodeFalseExpr() . . . . . . . . . . . . . . code literal false expression
1046 **
1047 ** 'CodeFalseExpr' is the action to code a literal false expression.
1048 */
1049 void CodeFalseExpr(void);
1050
1051
1052 /****************************************************************************
1053 **
1054 *F CodeCharExpr(<chr>) . . . . . . . . . . code literal character expression
1055 **
1056 ** 'CodeCharExpr' is the action to code a literal character expression.
1057 ** <chr> is the C character.
1058 */
1059 void CodeCharExpr(Char chr);
1060
1061
1062 /****************************************************************************
1063 **
1064 *F CodePermCycle(<nrx>,<nrc>) . . . . . code literal permutation expression
1065 *F CodePerm(<nrc>) . . . . . . . . . . . code literal permutation expression
1066 **
1067 ** 'CodePermCycle' is an action to code a literal permutation expression.
1068 ** It is called when one cycles is read completely. <nrc> is the number of
1069 ** elements in that cycle. <nrx> is the number of that cycles (i.e., 1 for
1070 ** the first cycle, 2 for the second, and so on).
1071 **
1072 ** 'CodePerm' is an action to code a literal permutation expression. It is
1073 ** called when the permutation is read completely. <nrc> is the number of
1074 ** cycles.
1075 */
1076 void CodePermCycle(UInt nrx, UInt nrc);
1077
1078 void CodePerm(UInt nrc);
1079
1080
1081 /****************************************************************************
1082 **
1083 *F CodeListExprBegin(<top>) . . . . . . . . . . code list expression, begin
1084 *F CodeListExprBeginElm(<pos>) . . . . . code list expression, begin element
1085 *F CodeListExprEndElm() . . . . . . . . . code list expression, end element
1086 *F CodeListExprEnd(<nr>,<range>,<top>,<tilde>) . . code list expression, end
1087 */
1088 void CodeListExprBegin(UInt top);
1089
1090 void CodeListExprBeginElm(UInt pos);
1091
1092 void CodeListExprEndElm(void);
1093
1094 void CodeListExprEnd(UInt nr, UInt range, UInt top, UInt tilde);
1095
1096
1097 /****************************************************************************
1098 **
1099 *F CodeStringExpr(<str>) . . . . . . . . . . code literal string expression
1100 */
1101 void CodeStringExpr(Obj str);
1102
1103 void CodePragma(Obj pragma);
1104
1105
1106 /****************************************************************************
1107 **
1108 *F CodeLazyFloatExpr(<str>,<pushExpr>) . . . . . code lazy float expression
1109 */
1110 Expr CodeLazyFloatExpr(Obj str, UInt pushExpr);
1111
1112
1113 /****************************************************************************
1114 **
1115 *F CodeFloatExpr(<str>) . . . . . . . . . . code literal float expression
1116 */
1117 void CodeFloatExpr(Obj str);
1118
1119
1120 /****************************************************************************
1121 **
1122 *F CodeRecExprBegin(<top>) . . . . . . . . . . code record expression, begin
1123 *F CodeRecExprBeginElmName(<rnam>) . . code record expression, begin element
1124 *F CodeRecExprBeginElmExpr() . . . . . code record expression, begin element
1125 *F CodeRecExprEndElmExpr() . . . . . . . code record expression, end element
1126 *F CodeRecExprEnd(<nr>,<top>,<tilde>) . . . . . code record expression, end
1127 */
1128 void CodeRecExprBegin(UInt top);
1129
1130 void CodeRecExprBeginElmName(UInt rnam);
1131
1132 void CodeRecExprBeginElmExpr(void);
1133
1134 void CodeRecExprEndElm(void);
1135
1136 void CodeRecExprEnd(UInt nr, UInt top, UInt tilde);
1137
1138
1139 /****************************************************************************
1140 **
1141 *F CodeAssLVar(<lvar>) . . . . . . . . . . . . . . code assignment to local
1142 **
1143 ** 'CodeAssLVar' is the action to code an assignment to the local variable
1144 ** <lvar> (given by its index). It is called by the reader *after* the
1145 ** right hand side expression is read.
1146 **
1147 ** An assignment to a local variable is represented by a bag with two
1148 ** subexpressions. The *first* is the local variable, the *second* is the
1149 ** right hand side expression.
1150 */
1151 void CodeAssLVar(UInt lvar);
1152
1153 void CodeUnbLVar(UInt lvar);
1154
1155
1156 /****************************************************************************
1157 **
1158 *F CodeRefLVar(<lvar>) . . . . . . . . . . . . . . . code reference to local
1159 **
1160 ** 'CodeRefLVar' is the action to code a reference to the local variable
1161 ** <lvar> (given by its index). It is called by the reader when it
1162 ** encounters a local variable.
1163 **
1164 ** A reference to a local variable is represented immediately (see
1165 ** 'REF_LVAR_LVAR').
1166 */
1167 void CodeRefLVar(UInt lvar);
1168
1169 void CodeIsbLVar(UInt lvar);
1170
1171
1172 /****************************************************************************
1173 **
1174 *F CodeAssHVar(<hvar>) . . . . . . . . . . . . . . code assignment to higher
1175 **
1176 ** 'CodeAssHVar' is the action to code an assignment to the higher variable
1177 ** <hvar> (given by its level and index). It is called by the reader
1178 ** *after* the right hand side expression is read.
1179 **
1180 ** An assignment to a higher variable is represented by a statement bag with
1181 ** two subexpressions. The *first* is the higher variable, the *second* is
1182 ** the right hand side expression.
1183 */
1184 void CodeAssHVar(UInt hvar);
1185
1186 void CodeUnbHVar(UInt hvar);
1187
1188
1189 /****************************************************************************
1190 **
1191 *F CodeRefHVar(<hvar>) . . . . . . . . . . . . . . code reference to higher
1192 **
1193 ** 'CodeRefHVar' is the action to code a reference to the higher variable
1194 ** <hvar> (given by its level and index). It is called by the reader when
1195 ** it encounters a higher variable.
1196 **
1197 ** A reference to a higher variable is represented by an expression bag with
1198 ** one subexpression. This is the higher variable.
1199 */
1200 void CodeRefHVar(UInt hvar);
1201
1202 void CodeIsbHVar(UInt hvar);
1203
1204
1205 /****************************************************************************
1206 **
1207 *F CodeAssGVar(<gvar>) . . . . . . . . . . . . . . code assignment to global
1208 **
1209 ** 'CodeAssGVar' is the action to code an assignment to the global variable
1210 ** <gvar>. It is called by the reader *after* the right hand side
1211 ** expression is read.
1212 **
1213 ** An assignment to a global variable is represented by a statement bag with
1214 ** two subexpressions. The *first* is the global variable, the *second* is
1215 ** the right hand side expression.
1216 */
1217 void CodeAssGVar(UInt gvar);
1218
1219 void CodeUnbGVar(UInt gvar);
1220
1221
1222 /****************************************************************************
1223 **
1224 *F CodeRefGVar(<gvar>) . . . . . . . . . . . . . . code reference to global
1225 **
1226 ** 'CodeRefGVar' is the action to code a reference to the global variable
1227 ** <gvar>. It is called by the reader when it encounters a global variable.
1228 **
1229 ** A reference to a global variable is represented by an expression bag with
1230 ** one subexpression. This is the global variable.
1231 */
1232 void CodeRefGVar(UInt gvar);
1233
1234 void CodeIsbGVar(UInt gvar);
1235
1236
1237 /****************************************************************************
1238 **
1239 *F CodeAssList() . . . . . . . . . . . . . . . . . code assignment to a list
1240 *F CodeAsssList() . . . . . . . . . . . code multiple assignment to a list
1241 *F CodeAssListLevel(<level>) . . . . . . . code assignment to several lists
1242 *F CodeAsssListLevel(<level>) . . code multiple assignment to several lists
1243 */
1244 void CodeAssList(Int narg);
1245
1246 void CodeAsssList(void);
1247
1248 void CodeAssListLevel(Int narg, UInt level);
1249
1250 void CodeAsssListLevel(UInt level);
1251
1252 void CodeUnbList(Int narg);
1253
1254
1255 /****************************************************************************
1256 **
1257 *F CodeElmList() . . . . . . . . . . . . . . . . . code selection of a list
1258 *F CodeElmsList() . . . . . . . . . . . . code multiple selection of a list
1259 *F CodeElmListLevel(<level>) . . . . . . . . code selection of several lists
1260 *F CodeElmsListLevel(<level>) . . code multiple selection of several lists
1261 */
1262 void CodeElmList(Int narg);
1263
1264 void CodeElmsList(void);
1265
1266 void CodeElmListLevel(Int narg, UInt level);
1267
1268 void CodeElmsListLevel(UInt level);
1269
1270 void CodeIsbList(Int narg);
1271
1272
1273 /****************************************************************************
1274 **
1275 *F CodeAssRecName(<rnam>) . . . . . . . . . . . code assignment to a record
1276 *F CodeAssRecExpr() . . . . . . . . . . . . . . code assignment to a record
1277 */
1278 void CodeAssRecName(UInt rnam);
1279
1280 void CodeAssRecExpr(void);
1281
1282 void CodeUnbRecName(UInt rnam);
1283
1284 void CodeUnbRecExpr(void);
1285
1286
1287 /****************************************************************************
1288 **
1289 *F CodeElmRecName(<rnam>) . . . . . . . . . . . code selection of a record
1290 *F CodeElmRecExpr() . . . . . . . . . . . . . . code selection of a record
1291 */
1292 void CodeElmRecName(UInt rnam);
1293
1294 void CodeElmRecExpr(void);
1295
1296 void CodeIsbRecName(UInt rnam);
1297
1298 void CodeIsbRecExpr(void);
1299
1300
1301 /****************************************************************************
1302 **
1303 *F CodeAssPosObj() . . . . . . . . . . . . . . . . code assignment to a list
1304 */
1305 void CodeAssPosObj(void);
1306
1307 void CodeUnbPosObj(void);
1308
1309
1310 /****************************************************************************
1311 **
1312 *F CodeElmPosObj() . . . . . . . . . . . . . . . . code selection of a list
1313 */
1314 void CodeElmPosObj(void);
1315
1316 void CodeIsbPosObj(void);
1317
1318
1319 /****************************************************************************
1320 **
1321 *F CodeAssComObjName(<rnam>) . . . . . . . . . . code assignment to a record
1322 *F CodeAssComObjExpr() . . . . . . . . . . . . . code assignment to a record
1323 */
1324 void CodeAssComObjName(UInt rnam);
1325
1326 void CodeAssComObjExpr(void);
1327
1328 void CodeUnbComObjName(UInt rnam);
1329
1330 void CodeUnbComObjExpr(void);
1331
1332
1333 /****************************************************************************
1334 **
1335 *F CodeElmComObjName(<rnam>) . . . . . . . . . . code selection of a record
1336 *F CodeElmComObjExpr() . . . . . . . . . . . . . code selection of a record
1337 */
1338 void CodeElmComObjName(UInt rnam);
1339
1340 void CodeElmComObjExpr(void);
1341
1342 void CodeIsbComObjName(UInt rnam);
1343
1344 void CodeIsbComObjExpr(void);
1345
1346 /****************************************************************************
1347 **
1348 *F CodeEmpty() . . . . code an empty statement
1349 **
1350 */
1351
1352 void CodeEmpty(void);
1353
1354 /****************************************************************************
1355 **
1356 *F CodeInfoBegin() . . . . . . . . . . . . . start coding of Info statement
1357 *F CodeInfoMiddle() . . . . . . . . . shift to coding printable arguments
1358 *F CodeInfoEnd( <narg> ) . . Info statement complete, <narg> things to print
1359 **
1360 ** These actions deal with the Info statement, which is coded specially,
1361 ** because not all of its arguments are always evaluated.
1362 */
1363 void CodeInfoBegin(void);
1364
1365 void CodeInfoMiddle(void);
1366
1367 void CodeInfoEnd(UInt narg);
1368
1369
1370 /****************************************************************************
1371 **
1372 *F CodeAssertBegin() . . . . . . . start interpretation of Assert statement
1373 *F CodeAsseerAfterLevel() . . called after the first argument has been read
1374 *F CodeAssertAfterCondition() called after the second argument has been read
1375 *F CodeAssertEnd2Args() . . . . called after reading the closing parenthesis
1376 *F CodeAssertEnd3Args() . . . . called after reading the closing parenthesis
1377 */
1378 void CodeAssertBegin(void);
1379
1380 void CodeAssertAfterLevel(void);
1381
1382 void CodeAssertAfterCondition(void);
1383
1384 void CodeAssertEnd2Args(void);
1385
1386 void CodeAssertEnd3Args(void);
1387
1388 /* CodeContinue() . . . . . . . . . . . . . code continue-statement */
1389 void CodeContinue(void);
1390
1391
1392 /****************************************************************************
1393 **
1394 *F * * * * * * * * * * * * * initialize module * * * * * * * * * * * * * * *
1395 */
1396
1397 /****************************************************************************
1398 **
1399 *F InitInfoCode() . . . . . . . . . . . . . . . . . table of init functions
1400 */
1401 StructInitInfo * InitInfoCode ( void );
1402
1403
1404
1405 #endif // GAP_CODE_H
1406