2000-07-08 21:20:36 -03:00
|
|
|
#ifndef Py_COMPILE_H
|
|
|
|
#define Py_COMPILE_H
|
2006-02-28 19:09:08 -04:00
|
|
|
|
2011-09-28 20:04:08 -03:00
|
|
|
#ifndef Py_LIMITED_API
|
2006-02-28 19:09:08 -04:00
|
|
|
#include "code.h"
|
|
|
|
|
2000-07-08 21:20:36 -03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1990-12-20 11:06:42 -04:00
|
|
|
/* Public interface */
|
1991-04-03 15:00:55 -04:00
|
|
|
struct _node; /* Declare the existence of this type */
|
2002-12-11 10:04:59 -04:00
|
|
|
PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *, const char *);
|
1993-07-28 06:05:47 -03:00
|
|
|
|
2001-02-27 15:07:02 -04:00
|
|
|
/* Future feature support */
|
|
|
|
|
|
|
|
typedef struct {
|
2005-10-20 16:59:25 -03:00
|
|
|
int ff_features; /* flags set by future statements */
|
|
|
|
int ff_lineno; /* line number of last future statement */
|
2001-02-27 15:07:02 -04:00
|
|
|
} PyFutureFeatures;
|
|
|
|
|
|
|
|
#define FUTURE_NESTED_SCOPES "nested_scopes"
|
2001-07-15 18:08:29 -03:00
|
|
|
#define FUTURE_GENERATORS "generators"
|
2001-08-08 02:00:18 -03:00
|
|
|
#define FUTURE_DIVISION "division"
|
2006-04-21 07:40:58 -03:00
|
|
|
#define FUTURE_ABSOLUTE_IMPORT "absolute_import"
|
2006-02-28 15:02:24 -04:00
|
|
|
#define FUTURE_WITH_STATEMENT "with_statement"
|
2008-03-20 20:02:08 -03:00
|
|
|
#define FUTURE_PRINT_FUNCTION "print_function"
|
2008-03-26 19:34:47 -03:00
|
|
|
#define FUTURE_UNICODE_LITERALS "unicode_literals"
|
2009-04-01 02:08:41 -03:00
|
|
|
#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL"
|
2001-08-08 02:00:18 -03:00
|
|
|
|
2005-10-20 16:59:25 -03:00
|
|
|
struct _mod; /* Declare the existence of this type */
|
2010-12-04 06:26:46 -04:00
|
|
|
#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar)
|
2010-12-26 21:49:31 -04:00
|
|
|
PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
|
2010-12-26 22:39:20 -04:00
|
|
|
struct _mod *mod,
|
2010-12-26 21:49:31 -04:00
|
|
|
const char *filename, /* decoded from the filesystem encoding */
|
|
|
|
PyCompilerFlags *flags,
|
|
|
|
int optimize,
|
|
|
|
PyArena *arena);
|
2013-08-26 17:28:21 -03:00
|
|
|
PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject(
|
|
|
|
struct _mod *mod,
|
|
|
|
PyObject *filename,
|
|
|
|
PyCompilerFlags *flags,
|
|
|
|
int optimize,
|
|
|
|
PyArena *arena);
|
|
|
|
PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(
|
|
|
|
struct _mod * mod,
|
|
|
|
const char *filename /* decoded from the filesystem encoding */
|
|
|
|
);
|
|
|
|
PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject(
|
|
|
|
struct _mod * mod,
|
|
|
|
PyObject *filename
|
|
|
|
);
|
2005-10-20 16:59:25 -03:00
|
|
|
|
2011-09-28 20:04:08 -03:00
|
|
|
/* _Py_Mangle is defined in compile.c */
|
|
|
|
PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
|
2005-10-20 16:59:25 -03:00
|
|
|
|
1993-07-28 06:05:47 -03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2011-09-28 20:04:08 -03:00
|
|
|
|
2010-12-03 16:14:31 -04:00
|
|
|
#endif /* !Py_LIMITED_API */
|
2011-09-28 20:04:08 -03:00
|
|
|
|
|
|
|
/* These definitions must match corresponding definitions in graminit.h.
|
|
|
|
There's code in compile.c that checks that they are the same. */
|
|
|
|
#define Py_single_input 256
|
|
|
|
#define Py_file_input 257
|
|
|
|
#define Py_eval_input 258
|
|
|
|
|
|
|
|
#endif /* !Py_COMPILE_H */
|