1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
/* \verbatim{control_h.tex} */
/*
* control.h
*
* Header of fixative structures.
*/
#ifndef _CONTROL_H
#define _CONTROL_H
typedef struct
{
int major;
char *jmp;
char *jz;
struct cont1 *cnext;
struct break1 *bnext;
} WHILE1;
typedef struct
{
int major;
char *jn; /* Label of the JZ */
char *jmp2; /* Label of the JMP. The first JMP */
/* instruction. It is between expr2 */
/* and expr3. */
char *jmp3; /* Address where to jump if all */
/* statements of the loop are */
/* done. (See manual) */
struct break1 *bnext;
struct cont1 *cnext;
} FOR1;
struct break1
{
char *adr;
struct break1 *next;
};
struct cont1
{
char *adr;
struct cont1 *next;
};
typedef struct
{
int major;
char *jz;
char *jmp;
} IF1;
struct default_usage
{
int line_number; /* Line number where the default label
was used. */
int def_flag; /* Flag if the default label was used.
It can be used only once per switch
statement. (ANSI) */
char *adr; /* Address where to jump to in the
virtual machine code. */
};
typedef struct
{
int major;
char *jz;
char *jmp;
struct default_usage def_use;
struct break1 *bnext;
struct list_const1 *next;
} SWITCH1;
struct list_const1 /* The list of labels in switch
statement is created. The list is
at the end of switch statement
checked if labels in this list are
not duplicit. If there are duplicit
error message is issued. */
{
int line_number; /* Line number where the label was
used in the switch statement. */
int constant; /* Label in switch statement. */
struct list_const1 *next;
};
union fix
{
WHILE1 while1;
FOR1 for1;
IF1 if1;
SWITCH1 switch1;
};
/* \verbatim */
#endif /* _CONTROL_H */
|