// File automatically generated by Parser/asdl_c.py.
#include "Python.h"
#include "pycore_ast.h"
#include "pycore_ast_state.h" // struct ast_state
#include "pycore_interp.h" // _PyInterpreterState.ast
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "structmember.h"
#include <stddef.h>
// Forward declaration
static int init_types(struct ast_state *state);
static struct ast_state*
get_ast_state(void)
{
PyInterpreterState *interp = _PyInterpreterState_GET();
struct ast_state *state = &interp->ast;
if (!init_types(state)) {
return NULL;
}
return state;
}
void _PyAST_Fini(PyInterpreterState *interp)
{
struct ast_state *state = &interp->ast;
Py_CLEAR(state->AST_type);
Py_CLEAR(state->Add_singleton);
Py_CLEAR(state->Add_type);
Py_CLEAR(state->And_singleton);
Py_CLEAR(state->And_type);
Py_CLEAR(state->AnnAssign_type);
Py_CLEAR(state->Assert_type);
Py_CLEAR(state->Assign_type);
Py_CLEAR(state->AsyncFor_type);
Py_CLEAR(state->AsyncFunctionDef_type);
Py_CLEAR(state->AsyncWith_type);
Py_CLEAR(state->Attribute_type);
Py_CLEAR(state->AugAssign_type);
Py_CLEAR(state->Await_type);
Py_CLEAR(state->BinOp_type);
Py_CLEAR(state->BitAnd_singleton);
Py_CLEAR(state->BitAnd_type);
Py_CLEAR(state->BitOr_singleton);
Py_CLEAR(state->BitOr_type);
Py_CLEAR(state->BitXor_singleton);
Py_CLEAR(state->BitXor_type);
Py_CLEAR(state->BoolOp_type);
Py_CLEAR(state->Break_type);
Py_CLEAR(state->Call_type);
Py_CLEAR(state->ClassDef_type);
Py_CLEAR(state->Compare_type);
Py_CLEAR(state->Constant_type);
Py_CLEAR(state->Continue_type);
Py_CLEAR(state->Del_singleton);
Py_CLEAR(state->Del_type);
Py_CLEAR(state->Delete_type);
Py_CLEAR(state->DictComp_type);
Py_CLEAR(state->Dict_type);
Py_CLEAR(state->Div_singleton);
Py_CLEAR(state->Div_type);
Py_CLEAR(state->Eq_singleton);
Py_CLEAR(state->Eq_type);
Py_CLEAR(state->ExceptHandler_type);
Py_CLEAR(state->Expr_type);
Py_CLEAR(state->Expression_type);
Py_CLEAR(state->FloorDiv_singleton);
Py_CLEAR(state->FloorDiv_type);
Py_CLEAR(state->For_type);
Py_CLEAR(state->FormattedValue_type);
Py_CLEAR(state->FunctionDef_type);
Py_CLEAR(state->FunctionType_type);
Py_CLEAR(state->GeneratorExp_type);
Py_CLEAR(state->Global_type);
Py_CLEAR(state->GtE_singleton);
Py_CLEAR(state->GtE_type);
Py_CLEAR(state->Gt_singleton);
Py_CLEAR(state->Gt_type);
Py_CLEAR(state->IfExp_type);
Py_CLEAR(state->If_type);
Py_CLEAR(state->ImportFrom_type);
Py_CLEAR(state->Import_type);
Py_CLEAR(state->In_singleton);
Py_CLEAR(state->In_type);
Py_CLEAR(state->Interactive_type);
Py_CLEAR(state->Invert_singleton);
Py_CLEAR(state->Invert_type);
Py_CLEAR(state->IsNot_singleton);
Py_CLEAR(state->IsNot_type);
Py_CLEAR(state->Is_singleton);
Py_CLEAR(state->Is_type);
Py_CLEAR(state->JoinedStr_type);
Py_CLEAR(state->LShift_singleton);
Py_CLEAR(state->LShift_type);
Py_CLEAR(state->Lambda_type);
Py_CLEAR(state->ListComp_type);
Py_CLEAR(state->List_type);
Py_CLEAR(state->Load_singleton);
Py_CLEAR(state->Load_type);
Py_CLEAR(state->LtE_singleton);
Py_CLEAR(state->LtE_type);
Py_CLEAR(state->Lt_singleton);
Py_CLEAR(state->Lt_type);
Py_CLEAR(state->MatMult_singleton);
Py_CLEAR(state->MatMult_type);
Py_CLEAR(state->MatchAs_type);
Py_CLEAR(state->MatchClass_type);
Py_CLEAR(state->MatchMapping_type);
Py_CLEAR(state->MatchOr_type);
Py_CLEAR(state->MatchSequence_type);
Py_CLEAR(state->MatchSingleton_type);
Py_CLEAR(state->MatchStar_type);
Py_CLEAR(state->MatchValue_type);
Py_CLEAR(state->Match_type);
Py_CLEAR(state->Mod_singleton);
Py_CLEAR(state->Mod_type);
Py_CLEAR(state->Module_type);
Py_CLEAR(state->Mult_singleton);
Py_CLEAR(state->Mult_type);
Py_CLEAR(state->Name_type);
Py_CLEAR(state->NamedExpr_type);
Py_CLEAR(state->Nonlocal_type);
Py_CLEAR(state->NotEq_singleton);
Py_CLEAR(state->NotEq_type);
Py_CLEAR(state->NotIn_singleton);
Py_CLEAR(state->NotIn_type);
Py_CLEAR(state->Not_singleton);
Py_CLEAR(state->Not_type);
Py_CLEAR(state->Or_singleton);
Py_CLEAR(state->Or_type);
Py_CLEAR(state->Pass_type);
Py_CLEAR(state->Pow_singleton);
Py_CLEAR(state->Pow_type);
Py_CLEAR(state->RShift_singleton);
Py_CLEAR(state->RShift_type);
Py_CLEAR(state->Raise_type);
Py_CLEAR(state->Return_type);
Py_CLEAR(state->SetComp_type);
Py_CLEAR(state->Set_type);
Py_CLEAR(state->Slice_type);
Py_CLEAR(state->Starred_type);
Py_CLEAR(state->Store_singleton);
Py_CLEAR(state->Store_type);
Py_CLEAR(state->Sub_singleton);
Py_CLEAR(state->Sub_type);
Py_CLEAR(state->Subscript_type);
Py_CLEAR(state->Try_type);
Py_CLEAR(state->Tuple_type);
Py_CLEAR(state->TypeIgnore_type);
Py_CLEAR(state->UAdd_singleton);
Py_CLEAR(state->UAdd_type);
Py_CLEAR(state->USub_singleton);
Py_CLEAR(state->USub_type);
Py_CLEAR(state->UnaryOp_type);
Py_CLEAR(state->While_type);
Py_CLEAR(state->With_type);
Py_CLEAR(state->YieldFrom_type);
Py_CLEAR(state->Yield_type);
Py_CLEAR(state->__dict__);
Py_CLEAR(state->__doc__);
Py_CLEAR(state->__match_args__);
Py_CLEAR(state->__module__);
Py_CLEAR(state->_attributes);
Py_CLEAR(state->_fields);
Py_CLEAR(state->alias_type);
Py_CLEAR(state->annotation);
Py_CLEAR(state->arg);
Py_CLEAR(state->arg_type);
Py_CLEAR(state->args);
Py_CLEAR(state->argtypes);
Py_CLEAR(state->arguments_type);
Py_CLEAR(state->asname);
Py_CLEAR(state->ast);
Py_CLEAR(state->attr);
Py_CLEAR(state->bases);
Py_CLEAR(state->body);
Py_CLEAR(state->boolop_type);
Py_CLEAR(state->cases);
Py_CLEAR(state->cause);
Py_CLEAR(state->cls);
Py_CLEAR(state->cmpop_type);
Py_CLEAR(state->col_offset);
Py_CLEAR(state->comparators);
Py_CLEAR(state->comprehension_type);
Py_CLEAR(state->context_expr);
Py_CLEAR(state->conversion);
Py_CLEAR(state->ctx);
Py_CLEAR(state->decorator_list);
Py_CLEAR(state->defaults);
Py_CLEAR(state->elt);
Py_CLEAR(state->elts);
Py_CLEAR(state->end_col_offset);
Py_CLEAR(state->end_lineno);
Py_CLEAR(state->exc);
Py_CLEAR(state->excepthandler_type);
Py_CLEAR(state->expr_context_type);
Py_CLEAR(state->expr_type);
Py_CLEAR(state->finalbody);
Py_CLEAR(state->format_spec);
Py_CLEAR(state->func);
Py_CLEAR(state->generators);
Py_CLEAR(state->guard);
Py_CLEAR(state->handlers);
Py_CLEAR(state->id);
Py_CLEAR(state->ifs);
Py_CLEAR(state->is_async);
Py_CLEAR(state->items);
Py_CLEAR(state->iter);
Py_CLEAR(state->key);
Py_CLEAR(state->keys);
Py_CLEAR(state->keyword_type);
Py_CLEAR(state->keywords);
Py_CLEAR(state->kind);
Py_CLEAR(state->kw_defaults);
Py_CLEAR(state->kwarg);
Py_CLEAR(state->kwd_attrs);
Py_CLEAR(state->kwd_patterns);
Py_CLEAR(state->kwonlyargs);
Py_CLEAR(state->left);
Py_CLEAR(state->level);
Py_CLEAR(state->lineno);
Py_CLEAR(state->lower);
Py_CLEAR(state->match_case_type);
Py_CLEAR(state->mod_type);
Py_CLEAR(state->module);
Py_CLEAR(state->msg);
Py_CLEAR(state->name);
Py_CLEAR(state->names);
Py_CLEAR(state->op);
Py_CLEAR(state->operand);
Py_CLEAR(state->operator_type);
Py_CLEAR(state->ops);
Py_CLEAR(state->optional_vars);
Py_CLEAR(state->orelse);
Py_CLEAR(state->pattern);
Py_CLEAR(state->pattern_type);
Py_CLEAR(state->patterns);
Py_CLEAR(state->posonlyargs);
Py_CLEAR(state->rest);
Py_CLEAR(state->returns);
Py_CLEAR(state->right);
Py_CLEAR(state->simple);
Py_CLEAR(state->slice);
Py_CLEAR(state->step);
Py_CLEAR(state->stmt_type);
Py_CLEAR(state->subject);
Py_CLEAR(state->tag);
Py_CLEAR(state->target);
Py_CLEAR(state->targets);
Py_CLEAR(state->test);
Py_CLEAR(state->type);
Py_CLEAR(state->type_comment);
Py_CLEAR(state->type_ignore_type);
Py_CLEAR(state->type_ignores);
Py_CLEAR(state->unaryop_type);
Py_CLEAR(state->upper);
Py_CLEAR(state->value);
Py_CLEAR(state->values);
Py_CLEAR(state->vararg);
Py_CLEAR(state->withitem_type);
#if !defined(NDEBUG)
state->initialized = -1;
#else
state->initialized = 0;
#endif
}
static int init_identifiers(struct ast_state *state)
{
if ((state->__dict__ = PyUnicode_InternFromString("__dict__")) == NULL) return 0;
if ((state->__doc__ = PyUnicode_InternFromString("__doc__")) == NULL) return 0;
if ((state->__match_args__ = PyUnicode_InternFromString("__match_args__")) == NULL) return 0;
if ((state->__module__ = PyUnicode_InternFromString("__module__")) == NULL) return 0;
if ((state->_attributes = PyUnicode_InternFromString("_attributes")) == NULL) return 0;
if ((state->_fields = PyUnicode_InternFromString("_fields")) == NULL) return 0;
if ((state->annotation = PyUnicode_InternFromString("annotation")) == NULL) return 0;
if ((state->arg = PyUnicode_InternFromString("arg")) == NULL) return 0;
if ((state->args = PyUnicode_InternFromString("args")) == NULL) return 0;
if ((state->argtypes = PyUnicode_InternFromString("argtypes")) == NULL) return 0;
if ((state->asname = PyUnicode_InternFromString("asname")) == NULL) return 0;
if ((state->ast = PyUnicode_InternFromString("ast")) == NULL) return 0;
if ((state->attr = PyUnicode_InternFromString("attr")) == NULL) return 0;
if ((state->bases = PyUnicode_InternFromString("bases")) == NULL) return 0;
if ((state->body = PyUnicode_InternFromString("body")) == NULL) return 0;
if ((state->cases = PyUnicode_InternFromString("cases")) == NULL) return 0;
if ((state->cause = PyUnicode_InternFromString("cause")) == NULL) return 0;
if ((state->cls = PyUnicode_InternFromString("cls")) == NULL) return 0;
if ((state->col_offset = PyUnicode_InternFromString("col_offset")) == NULL) return 0;
if ((state->comparators = PyUnicode_InternFromString("comparators")) == NULL) return 0;
if ((state->context_expr = PyUnicode_InternFromString("context_expr")) == NULL) return 0;
if ((state->conversion = PyUnicode_InternFromString("conversion")) == NULL) return 0;
if ((state->ctx = PyUnicode_InternFromString("ctx")) == NULL) return 0;
if ((state->decorator_list = PyUnicode_InternFromString("decorator_list")) == NULL) return 0;
if ((state->defaults = PyUnicode_InternFromString("defaults")) == NULL) return 0;
if ((state->elt = PyUnicode_InternFromString("elt")) == NULL) return 0;
if ((state->elts = PyUnicode_InternFromString("elts")) == NULL) return 0;
if ((state->end_col_offset = PyUnicode_InternFromString("end_col_offset")) == NULL) return 0;
if ((state->end_lineno = PyUnicode_InternFromString("end_lineno")) == NULL) return 0;
if ((state->exc = PyUnicode_InternFromString("exc")) == NULL) return 0;
if ((state->finalbody = PyUnicode_InternFromString("finalbody")) == NULL) return 0;
if ((state->format_spec = PyUnicode_InternFromString("format_spec")) == NULL) return 0;
if ((state->func = PyUnicode_InternFromString("func")) == NULL) return 0;
if ((state->generators = PyUnicode_InternFromString("generators")) == NULL) return 0;
if ((state->guard = PyUnicode_InternFromString("guard")) == NULL) return 0;
if ((state->handlers = PyUnicode_InternFromString("handlers")) == NULL) return 0;
if ((state->id = PyUnicode_InternFromString("id")) == NULL) return 0;
if ((state->ifs = PyUnicode_InternFromString("ifs")) == NULL) return 0;
if ((state->is_async = PyUnicode_InternFromString("is_async")) == NULL) return 0;
if ((state->items = PyUnicode_InternFromString("items")) == NULL) return 0;
if ((state->iter = PyUnicode_InternFromString("iter")) == NULL) return 0;
if ((state->key = PyUnicode_InternFromString("key")) == NULL) return 0;
if ((state->keys = PyUnicode_InternFromString("keys")) == NULL) return 0;
if ((state->keywords = PyUnicode_InternFromString("keywords")) == NULL) return 0;
if ((state->kind = PyUnicode_InternFromString("kind")) == NULL) return 0;
if ((state->kw_defaults = PyUnicode_InternFromString("kw_defaults")) == NULL) return 0;
if ((state->kwarg = PyUnicode_InternFromString("kwarg")) == NULL) return 0;
if ((state->kwd_attrs = PyUnicode_InternFromString("kwd_attrs")) == NULL) return 0;
if ((state->kwd_patterns = PyUnicode_InternFromString("kwd_patterns")) == NULL) return 0;
if ((state->kwonlyargs = PyUnicode_InternFromString("kwonlyargs")) == NULL) return 0;
if ((state->left = PyUnicode_InternFromString("left")) == NULL) return 0;
if ((state->level = PyUnicode_InternFromString("level")) == NULL) return 0;
if ((state->lineno = PyUnicode_InternFromString("lineno")) == NULL) return 0;
if ((state->lower = PyUnicode_InternFromString("lower")) == NULL) return 0;
if ((state->module = PyUnicode_InternFromString("module")) == NULL) return 0;
if ((state->msg = PyUnicode_InternFromString("msg")) == NULL) return 0;
if ((state->name = PyUnicode_InternFromString("name")) == NULL) return 0;
if ((state->names = PyUnicode_InternFromString("names")) == NULL) return 0;
if ((state->op = PyUnicode_InternFromString("op")) == NULL) return 0;
if ((state->operand = PyUnicode_InternFromString("operand")) == NULL) return 0;
if ((state->ops = PyUnicode_InternFromString("ops")) == NULL) return 0;
if ((state->optional_vars = PyUnicode_InternFromString("optional_vars")) == NULL) return 0;
if ((state->orelse = PyUnicode_InternFromString("orelse")) == NULL) return 0;
if ((state->pattern = PyUnicode_InternFromString("pattern")) == NULL) return 0;
if ((state->patterns = PyUnicode_InternFromString("patterns")) == NULL) return 0;
if ((state->posonlyargs = PyUnicode_InternFromString("posonlyargs")) == NULL) return 0;
if ((state->rest = PyUnicode_InternFromString("rest")) == NULL) return 0;
if ((state->returns = PyUnicode_InternFromString("returns")) == NULL) return 0;
if ((state->right = PyUnicode_InternFromString("right")) == NULL) return 0;
if ((state->simple = PyUnicode_InternFromString("simple")) == NULL) return 0;
if ((state->slice = PyUnicode_InternFromString("slice")) == NULL) return 0;
if ((state->step = PyUnicode_InternFromString("step")) == NULL) return 0;
if ((state->subject = PyUnicode_InternFromString("subject")) == NULL) return 0;
if ((state->tag = PyUnicode_InternFromString("tag")) == NULL) return 0;
if ((state->target = PyUnicode_InternFromString("target")) == NULL) return 0;
if ((state->targets = PyUnicode_InternFromString("targets")) == NULL) return 0;
if ((state->test = PyUnicode_InternFromString("test")) == NULL) return 0;
if ((state->type = PyUnicode_InternFromString("type")) == NULL) return 0;
if ((state->type_comment = PyUnicode_InternFromString("type_comment")) == NULL) return 0;
if ((state->type_ignores = PyUnicode_InternFromString("type_ignores")) == NULL) return 0;
if ((state->upper = PyUnicode_InternFromString("upper")) == NULL) return 0;
if ((state->value = PyUnicode_InternFromString("value")) == NULL) return 0;
if ((state->values = PyUnicode_InternFromString("values")) == NULL) return 0;
if ((state->vararg = PyUnicode_InternFromString("vararg")) == NULL) return 0;
return 1;
};
GENERATE_ASDL_SEQ_CONSTRUCTOR(mod, mod_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(stmt, stmt_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(expr, expr_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(comprehension, comprehension_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(excepthandler, excepthandler_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(arguments, arguments_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(arg, arg_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(keyword, keyword_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(alias, alias_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(withitem, withitem_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(match_case, match_case_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(pattern, pattern_ty)
GENERATE_ASDL_SEQ_CONSTRUCTOR(type_ignore, type_ignore_ty)
static PyObject* ast2obj_mod(struct ast_state *state, void*);
static const char * const Module_fields[]={
"body",
"type_ignores",
};
static const char * const Interactive_fields[]={
|