Mercurial > cpython-lru_cache-weakref
annotate Include/node.h @ 13255:916fb024ce94 legacy-trunk
Change copyright notice.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 30 Jun 2000 23:50:40 +0000 |
| parents | 63436719d12e |
| children | 87ee82e5c56d |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
1 #ifndef Py_NODE_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
2 #define Py_NODE_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
6 |
| 145 | 7 /*********************************************************** |
| 2058 | 8 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 9 The Netherlands. | |
| 145 | 10 |
| 11 All Rights Reserved | |
| 12 | |
|
13255
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
12970
diff
changeset
|
13 Copyright (c) 2000, BeOpen.com. |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
12970
diff
changeset
|
14 Copyright (c) 1995-2000, Corporation for National Research Initiatives. |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
12970
diff
changeset
|
15 Copyright (c) 1990-1995, Stichting Mathematisch Centrum. |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
12970
diff
changeset
|
16 All rights reserved. |
| 145 | 17 |
|
13255
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
12970
diff
changeset
|
18 See the file "Misc/COPYRIGHT" for information on usage and |
|
916fb024ce94
Change copyright notice.
Guido van Rossum <guido@python.org>
parents:
12970
diff
changeset
|
19 redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 145 | 20 |
| 21 ******************************************************************/ | |
| 22 | |
| 6 | 23 /* Parse tree node interface */ |
| 24 | |
| 25 typedef struct _node { | |
|
1812
2d5b36a438ab
Include/node.h: make some fields short to save space during
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
26 short n_type; |
| 6 | 27 char *n_str; |
|
1812
2d5b36a438ab
Include/node.h: make some fields short to save space during
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
28 short n_lineno; |
|
2d5b36a438ab
Include/node.h: make some fields short to save space during
Guido van Rossum <guido@python.org>
parents:
1746
diff
changeset
|
29 short n_nchildren; |
| 6 | 30 struct _node *n_child; |
| 31 } node; | |
| 32 | |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
4839
diff
changeset
|
33 extern DL_IMPORT(node *) PyNode_New Py_PROTO((int type)); |
|
12970
63436719d12e
Add new parser error code, E_OVERFLOW. This error is returned when
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
9586
diff
changeset
|
34 extern DL_IMPORT(int) PyNode_AddChild Py_PROTO((node *n, int type, char *str, int lineno)); |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
4839
diff
changeset
|
35 extern DL_IMPORT(void) PyNode_Free Py_PROTO((node *n)); |
| 6 | 36 |
| 37 /* Node access functions */ | |
| 38 #define NCH(n) ((n)->n_nchildren) | |
| 39 #define CHILD(n, i) (&(n)->n_child[i]) | |
| 40 #define TYPE(n) ((n)->n_type) | |
| 41 #define STR(n) ((n)->n_str) | |
| 42 | |
| 43 /* Assert that the type of a node is what we expect */ | |
|
4839
4567e158d20c
Rename DEBUG macro to Py_DEBUG
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
44 #ifndef Py_DEBUG |
| 6 | 45 #define REQ(n, type) { /*pass*/ ; } |
| 46 #else | |
| 47 #define REQ(n, type) \ | |
| 48 { if (TYPE(n) != (type)) { \ | |
| 49 fprintf(stderr, "FATAL: node type %d, required %d\n", \ | |
| 50 TYPE(n), type); \ | |
| 51 abort(); \ | |
| 52 } } | |
| 53 #endif | |
| 86 | 54 |
|
9586
60fdb1db1175
Add DL_IMPORT(returntype) for all officially exported functions.
Guido van Rossum <guido@python.org>
parents:
4839
diff
changeset
|
55 extern DL_IMPORT(void) PyNode_ListTree Py_PROTO((node *)); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
56 |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
57 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
58 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
59 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
60 #endif /* !Py_NODE_H */ |
