Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 1 | /* Definitions for compiled intermediate code */ |
| 2 | |
| 3 | |
| 4 | /* An intermediate code fragment contains: |
| 5 | - a string that encodes the instructions, |
| 6 | - a list of the constants, |
| 7 | - and a list of the names used. */ |
| 8 | |
| 9 | typedef struct { |
| 10 | OB_HEAD |
| 11 | stringobject *co_code; /* instruction opcodes */ |
| 12 | object *co_consts; /* list of immutable constant objects */ |
| 13 | object *co_names; /* list of stringobjects */ |
| 14 | object *co_filename; /* string */ |
| 15 | } codeobject; |
| 16 | |
| 17 | extern typeobject Codetype; |
| 18 | |
| 19 | #define is_codeobject(op) ((op)->ob_type == &Codetype) |
| 20 | |
| 21 | |
| 22 | /* Public interface */ |
| 23 | codeobject *compile PROTO((struct _node *, char *)); |