summaryrefslogtreecommitdiff
path: root/Include/compile.h
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-12-20 15:06:42 +0000
committerGuido van Rossum <guido@python.org>1990-12-20 15:06:42 +0000
commit3f5da24ea304e674a9abbdcffc4d671e32aa70f1 (patch)
treee932e31cb9381f40b7c87c377638216c043b5cfc /Include/compile.h
parent226d79eb4a776dd54c9e4544b17deaf928bcef3a (diff)
downloadcpython-git-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.gz
"Compiling" version
Diffstat (limited to 'Include/compile.h')
-rw-r--r--Include/compile.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/Include/compile.h b/Include/compile.h
new file mode 100644
index 0000000000..330693060b
--- /dev/null
+++ b/Include/compile.h
@@ -0,0 +1,23 @@
+/* Definitions for compiled intermediate code */
+
+
+/* An intermediate code fragment contains:
+ - a string that encodes the instructions,
+ - a list of the constants,
+ - and a list of the names used. */
+
+typedef struct {
+ OB_HEAD
+ stringobject *co_code; /* instruction opcodes */
+ object *co_consts; /* list of immutable constant objects */
+ object *co_names; /* list of stringobjects */
+ object *co_filename; /* string */
+} codeobject;
+
+extern typeobject Codetype;
+
+#define is_codeobject(op) ((op)->ob_type == &Codetype)
+
+
+/* Public interface */
+codeobject *compile PROTO((struct _node *, char *));