blob: 330693060bd76c66bf90bf7abc77edbcf2a2cad3 [file] [log] [blame]
Guido van Rossum3f5da241990-12-20 15:06:42 +00001/* 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
9typedef 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
17extern typeobject Codetype;
18
19#define is_codeobject(op) ((op)->ob_type == &Codetype)
20
21
22/* Public interface */
23codeobject *compile PROTO((struct _node *, char *));