/******************************************************************************/
/* This file is generated by the templates/template.rb script and should not  */
/* be modified manually. See                                                  */
/* templates/ext/prism/api_node.c.erb                                         */
/* if you are looking to modify the                                           */
/* template                                                                   */
/******************************************************************************/
#line 2 "api_node.c.erb"
#include "prism/extension.h"

extern VALUE rb_cPrism;
extern VALUE rb_cPrismNode;
extern VALUE rb_cPrismSource;
extern VALUE rb_cPrismToken;
extern VALUE rb_cPrismLocation;

static VALUE rb_cPrismAliasGlobalVariableNode;
static VALUE rb_cPrismAliasMethodNode;
static VALUE rb_cPrismAlternationPatternNode;
static VALUE rb_cPrismAndNode;
static VALUE rb_cPrismArgumentsNode;
static VALUE rb_cPrismArrayNode;
static VALUE rb_cPrismArrayPatternNode;
static VALUE rb_cPrismAssocNode;
static VALUE rb_cPrismAssocSplatNode;
static VALUE rb_cPrismBackReferenceReadNode;
static VALUE rb_cPrismBeginNode;
static VALUE rb_cPrismBlockArgumentNode;
static VALUE rb_cPrismBlockLocalVariableNode;
static VALUE rb_cPrismBlockNode;
static VALUE rb_cPrismBlockParameterNode;
static VALUE rb_cPrismBlockParametersNode;
static VALUE rb_cPrismBreakNode;
static VALUE rb_cPrismCallAndWriteNode;
static VALUE rb_cPrismCallNode;
static VALUE rb_cPrismCallOperatorWriteNode;
static VALUE rb_cPrismCallOrWriteNode;
static VALUE rb_cPrismCallTargetNode;
static VALUE rb_cPrismCapturePatternNode;
static VALUE rb_cPrismCaseMatchNode;
static VALUE rb_cPrismCaseNode;
static VALUE rb_cPrismClassNode;
static VALUE rb_cPrismClassVariableAndWriteNode;
static VALUE rb_cPrismClassVariableOperatorWriteNode;
static VALUE rb_cPrismClassVariableOrWriteNode;
static VALUE rb_cPrismClassVariableReadNode;
static VALUE rb_cPrismClassVariableTargetNode;
static VALUE rb_cPrismClassVariableWriteNode;
static VALUE rb_cPrismConstantAndWriteNode;
static VALUE rb_cPrismConstantOperatorWriteNode;
static VALUE rb_cPrismConstantOrWriteNode;
static VALUE rb_cPrismConstantPathAndWriteNode;
static VALUE rb_cPrismConstantPathNode;
static VALUE rb_cPrismConstantPathOperatorWriteNode;
static VALUE rb_cPrismConstantPathOrWriteNode;
static VALUE rb_cPrismConstantPathTargetNode;
static VALUE rb_cPrismConstantPathWriteNode;
static VALUE rb_cPrismConstantReadNode;
static VALUE rb_cPrismConstantTargetNode;
static VALUE rb_cPrismConstantWriteNode;
static VALUE rb_cPrismDefNode;
static VALUE rb_cPrismDefinedNode;
static VALUE rb_cPrismElseNode;
static VALUE rb_cPrismEmbeddedStatementsNode;
static VALUE rb_cPrismEmbeddedVariableNode;
static VALUE rb_cPrismEnsureNode;
static VALUE rb_cPrismFalseNode;
static VALUE rb_cPrismFindPatternNode;
static VALUE rb_cPrismFlipFlopNode;
static VALUE rb_cPrismFloatNode;
static VALUE rb_cPrismForNode;
static VALUE rb_cPrismForwardingArgumentsNode;
static VALUE rb_cPrismForwardingParameterNode;
static VALUE rb_cPrismForwardingSuperNode;
static VALUE rb_cPrismGlobalVariableAndWriteNode;
static VALUE rb_cPrismGlobalVariableOperatorWriteNode;
static VALUE rb_cPrismGlobalVariableOrWriteNode;
static VALUE rb_cPrismGlobalVariableReadNode;
static VALUE rb_cPrismGlobalVariableTargetNode;
static VALUE rb_cPrismGlobalVariableWriteNode;
static VALUE rb_cPrismHashNode;
static VALUE rb_cPrismHashPatternNode;
static VALUE rb_cPrismIfNode;
static VALUE rb_cPrismImaginaryNode;
static VALUE rb_cPrismImplicitNode;
static VALUE rb_cPrismImplicitRestNode;
static VALUE rb_cPrismInNode;
static VALUE rb_cPrismIndexAndWriteNode;
static VALUE rb_cPrismIndexOperatorWriteNode;
static VALUE rb_cPrismIndexOrWriteNode;
static VALUE rb_cPrismIndexTargetNode;
static VALUE rb_cPrismInstanceVariableAndWriteNode;
static VALUE rb_cPrismInstanceVariableOperatorWriteNode;
static VALUE rb_cPrismInstanceVariableOrWriteNode;
static VALUE rb_cPrismInstanceVariableReadNode;
static VALUE rb_cPrismInstanceVariableTargetNode;
static VALUE rb_cPrismInstanceVariableWriteNode;
static VALUE rb_cPrismIntegerNode;
static VALUE rb_cPrismInterpolatedMatchLastLineNode;
static VALUE rb_cPrismInterpolatedRegularExpressionNode;
static VALUE rb_cPrismInterpolatedStringNode;
static VALUE rb_cPrismInterpolatedSymbolNode;
static VALUE rb_cPrismInterpolatedXStringNode;
static VALUE rb_cPrismKeywordHashNode;
static VALUE rb_cPrismKeywordRestParameterNode;
static VALUE rb_cPrismLambdaNode;
static VALUE rb_cPrismLocalVariableAndWriteNode;
static VALUE rb_cPrismLocalVariableOperatorWriteNode;
static VALUE rb_cPrismLocalVariableOrWriteNode;
static VALUE rb_cPrismLocalVariableReadNode;
static VALUE rb_cPrismLocalVariableTargetNode;
static VALUE rb_cPrismLocalVariableWriteNode;
static VALUE rb_cPrismMatchLastLineNode;
static VALUE rb_cPrismMatchPredicateNode;
static VALUE rb_cPrismMatchRequiredNode;
static VALUE rb_cPrismMatchWriteNode;
static VALUE rb_cPrismMissingNode;
static VALUE rb_cPrismModuleNode;
static VALUE rb_cPrismMultiTargetNode;
static VALUE rb_cPrismMultiWriteNode;
static VALUE rb_cPrismNextNode;
static VALUE rb_cPrismNilNode;
static VALUE rb_cPrismNoKeywordsParameterNode;
static VALUE rb_cPrismNumberedParametersNode;
static VALUE rb_cPrismNumberedReferenceReadNode;
static VALUE rb_cPrismOptionalKeywordParameterNode;
static VALUE rb_cPrismOptionalParameterNode;
static VALUE rb_cPrismOrNode;
static VALUE rb_cPrismParametersNode;
static VALUE rb_cPrismParenthesesNode;
static VALUE rb_cPrismPinnedExpressionNode;
static VALUE rb_cPrismPinnedVariableNode;
static VALUE rb_cPrismPostExecutionNode;
static VALUE rb_cPrismPreExecutionNode;
static VALUE rb_cPrismProgramNode;
static VALUE rb_cPrismRangeNode;
static VALUE rb_cPrismRationalNode;
static VALUE rb_cPrismRedoNode;
static VALUE rb_cPrismRegularExpressionNode;
static VALUE rb_cPrismRequiredKeywordParameterNode;
static VALUE rb_cPrismRequiredParameterNode;
static VALUE rb_cPrismRescueModifierNode;
static VALUE rb_cPrismRescueNode;
static VALUE rb_cPrismRestParameterNode;
static VALUE rb_cPrismRetryNode;
static VALUE rb_cPrismReturnNode;
static VALUE rb_cPrismSelfNode;
static VALUE rb_cPrismSingletonClassNode;
static VALUE rb_cPrismSourceEncodingNode;
static VALUE rb_cPrismSourceFileNode;
static VALUE rb_cPrismSourceLineNode;
static VALUE rb_cPrismSplatNode;
static VALUE rb_cPrismStatementsNode;
static VALUE rb_cPrismStringNode;
static VALUE rb_cPrismSuperNode;
static VALUE rb_cPrismSymbolNode;
static VALUE rb_cPrismTrueNode;
static VALUE rb_cPrismUndefNode;
static VALUE rb_cPrismUnlessNode;
static VALUE rb_cPrismUntilNode;
static VALUE rb_cPrismWhenNode;
static VALUE rb_cPrismWhileNode;
static VALUE rb_cPrismXStringNode;
static VALUE rb_cPrismYieldNode;

static VALUE
pm_location_new(pm_parser_t *parser, const uint8_t *start, const uint8_t *end, VALUE source) {
    VALUE argv[] = { source, LONG2FIX(start - parser->start), LONG2FIX(end - start) };
    return rb_class_new_instance(3, argv, rb_cPrismLocation);
}

VALUE
pm_token_new(pm_parser_t *parser, pm_token_t *token, rb_encoding *encoding, VALUE source) {
    ID type = rb_intern(pm_token_type_to_str(token->type));
    VALUE location = pm_location_new(parser, token->start, token->end, source);

    VALUE argv[] = {
        ID2SYM(type),
        rb_enc_str_new((const char *) token->start, token->end - token->start, encoding),
        location
    };

    return rb_class_new_instance(3, argv, rb_cPrismToken);
}

static VALUE
pm_string_new(pm_string_t *string, rb_encoding *encoding) {
    return rb_enc_str_new((const char *) pm_string_source(string), pm_string_length(string), encoding);
}

// Create a Prism::Source object from the given parser.
VALUE
pm_source_new(pm_parser_t *parser, rb_encoding *encoding) {
    VALUE source = rb_enc_str_new((const char *) parser->start, parser->end - parser->start, encoding);
    VALUE offsets = rb_ary_new_capa(parser->newline_list.size);

    for (size_t index = 0; index < parser->newline_list.size; index++) {
        rb_ary_push(offsets, INT2FIX(parser->newline_list.offsets[index]));
    }

    VALUE source_argv[] = { source, LONG2NUM(parser->start_line), offsets };
    return rb_class_new_instance(3, source_argv, rb_cPrismSource);
}

typedef struct pm_node_stack_node {
    struct pm_node_stack_node *prev;
    pm_node_t *visit;
    bool visited;
} pm_node_stack_node_t;

static void
pm_node_stack_push(pm_node_stack_node_t **stack, pm_node_t *visit) {
    pm_node_stack_node_t *node = malloc(sizeof(pm_node_stack_node_t));
    node->prev = *stack;
    node->visit = visit;
    node->visited = false;
    *stack = node;
}

static pm_node_t *
pm_node_stack_pop(pm_node_stack_node_t **stack) {
    pm_node_stack_node_t *current = *stack;
    pm_node_t *visit = current->visit;

    *stack = current->prev;
    free(current);

    return visit;
}

VALUE
pm_ast_new(pm_parser_t *parser, pm_node_t *node, rb_encoding *encoding) {
    VALUE source = pm_source_new(parser, encoding);
    ID *constants = calloc(parser->constant_pool.size, sizeof(ID));

    for (uint32_t index = 0; index < parser->constant_pool.size; index++) {
        pm_constant_t *constant = &parser->constant_pool.constants[index];
        int state = 0;

        VALUE string = rb_enc_str_new((const char *) constant->start, constant->length, encoding);
        ID value = rb_protect(rb_intern_str, string, &state);

        if (state != 0) {
            value = rb_intern_const("?");
            rb_set_errinfo(Qnil);
        }

        constants[index] = value;
    }

    pm_node_stack_node_t *node_stack = NULL;
    pm_node_stack_push(&node_stack, node);
    VALUE value_stack = rb_ary_new();

    while (node_stack != NULL) {
        if (!node_stack->visited) {
            if (node_stack->visit == NULL) {
                pm_node_stack_pop(&node_stack);
                rb_ary_push(value_stack, Qnil);
                continue;
            }

            pm_node_t *node = node_stack->visit;
            node_stack->visited = true;

            switch (PM_NODE_TYPE(node)) {
#line 118 "api_node.c.erb"
                case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
                    pm_alias_global_variable_node_t *cast = (pm_alias_global_variable_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->new_name);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->old_name);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ALIAS_METHOD_NODE: {
                    pm_alias_method_node_t *cast = (pm_alias_method_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->new_name);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->old_name);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ALTERNATION_PATTERN_NODE: {
                    pm_alternation_pattern_node_t *cast = (pm_alternation_pattern_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->left);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->right);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_AND_NODE: {
                    pm_and_node_t *cast = (pm_and_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->left);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->right);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ARGUMENTS_NODE: {
                    pm_arguments_node_t *cast = (pm_arguments_node_t *) node;
                    for (size_t index = 0; index < cast->arguments.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ARRAY_NODE: {
                    pm_array_node_t *cast = (pm_array_node_t *) node;
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->elements.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ARRAY_PATTERN_NODE: {
                    pm_array_pattern_node_t *cast = (pm_array_pattern_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->constant);
                    for (size_t index = 0; index < cast->requireds.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->requireds.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rest);
                    for (size_t index = 0; index < cast->posts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->posts.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ASSOC_NODE: {
                    pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->key);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ASSOC_SPLAT_NODE: {
                    pm_assoc_splat_node_t *cast = (pm_assoc_splat_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_BEGIN_NODE: {
                    pm_begin_node_t *cast = (pm_begin_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rescue_clause);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->else_clause);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->ensure_clause);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_BLOCK_ARGUMENT_NODE: {
                    pm_block_argument_node_t *cast = (pm_block_argument_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->expression);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_BLOCK_NODE: {
                    pm_block_node_t *cast = (pm_block_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->parameters);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_BLOCK_PARAMETERS_NODE: {
                    pm_block_parameters_node_t *cast = (pm_block_parameters_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->parameters);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->locals.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_BREAK_NODE: {
                    pm_break_node_t *cast = (pm_break_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CALL_AND_WRITE_NODE: {
                    pm_call_and_write_node_t *cast = (pm_call_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CALL_NODE: {
                    pm_call_node_t *cast = (pm_call_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CALL_OPERATOR_WRITE_NODE: {
                    pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CALL_OR_WRITE_NODE: {
                    pm_call_or_write_node_t *cast = (pm_call_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CALL_TARGET_NODE: {
                    pm_call_target_node_t *cast = (pm_call_target_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CAPTURE_PATTERN_NODE: {
                    pm_capture_pattern_node_t *cast = (pm_capture_pattern_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->target);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CASE_MATCH_NODE: {
                    pm_case_match_node_t *cast = (pm_case_match_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->predicate);
                    for (size_t index = 0; index < cast->conditions.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->conditions.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->consequent);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CASE_NODE: {
                    pm_case_node_t *cast = (pm_case_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->predicate);
                    for (size_t index = 0; index < cast->conditions.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->conditions.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->consequent);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CLASS_NODE: {
                    pm_class_node_t *cast = (pm_class_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->constant_path);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->superclass);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
                    pm_class_variable_and_write_node_t *cast = (pm_class_variable_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_class_variable_operator_write_node_t *cast = (pm_class_variable_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
                    pm_class_variable_or_write_node_t *cast = (pm_class_variable_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CLASS_VARIABLE_WRITE_NODE: {
                    pm_class_variable_write_node_t *cast = (pm_class_variable_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_AND_WRITE_NODE: {
                    pm_constant_and_write_node_t *cast = (pm_constant_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_OPERATOR_WRITE_NODE: {
                    pm_constant_operator_write_node_t *cast = (pm_constant_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_OR_WRITE_NODE: {
                    pm_constant_or_write_node_t *cast = (pm_constant_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_PATH_AND_WRITE_NODE: {
                    pm_constant_path_and_write_node_t *cast = (pm_constant_path_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->target);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_PATH_NODE: {
                    pm_constant_path_node_t *cast = (pm_constant_path_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->parent);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->child);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
                    pm_constant_path_operator_write_node_t *cast = (pm_constant_path_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->target);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_PATH_OR_WRITE_NODE: {
                    pm_constant_path_or_write_node_t *cast = (pm_constant_path_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->target);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_PATH_TARGET_NODE: {
                    pm_constant_path_target_node_t *cast = (pm_constant_path_target_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->parent);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->child);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_PATH_WRITE_NODE: {
                    pm_constant_path_write_node_t *cast = (pm_constant_path_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->target);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_CONSTANT_WRITE_NODE: {
                    pm_constant_write_node_t *cast = (pm_constant_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_DEF_NODE: {
                    pm_def_node_t *cast = (pm_def_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->parameters);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_DEFINED_NODE: {
                    pm_defined_node_t *cast = (pm_defined_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ELSE_NODE: {
                    pm_else_node_t *cast = (pm_else_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_EMBEDDED_STATEMENTS_NODE: {
                    pm_embedded_statements_node_t *cast = (pm_embedded_statements_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_EMBEDDED_VARIABLE_NODE: {
                    pm_embedded_variable_node_t *cast = (pm_embedded_variable_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->variable);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_ENSURE_NODE: {
                    pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_FIND_PATTERN_NODE: {
                    pm_find_pattern_node_t *cast = (pm_find_pattern_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->constant);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->left);
                    for (size_t index = 0; index < cast->requireds.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->requireds.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->right);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_FLIP_FLOP_NODE: {
                    pm_flip_flop_node_t *cast = (pm_flip_flop_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->left);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->right);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_FOR_NODE: {
                    pm_for_node_t *cast = (pm_for_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->index);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->collection);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_FORWARDING_SUPER_NODE: {
                    pm_forwarding_super_node_t *cast = (pm_forwarding_super_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
                    pm_global_variable_and_write_node_t *cast = (pm_global_variable_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_global_variable_operator_write_node_t *cast = (pm_global_variable_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
                    pm_global_variable_or_write_node_t *cast = (pm_global_variable_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_WRITE_NODE: {
                    pm_global_variable_write_node_t *cast = (pm_global_variable_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_HASH_NODE: {
                    pm_hash_node_t *cast = (pm_hash_node_t *) node;
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->elements.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_HASH_PATTERN_NODE: {
                    pm_hash_pattern_node_t *cast = (pm_hash_pattern_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->constant);
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->elements.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rest);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_IF_NODE: {
                    pm_if_node_t *cast = (pm_if_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->predicate);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->consequent);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_IMAGINARY_NODE: {
                    pm_imaginary_node_t *cast = (pm_imaginary_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->numeric);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_IMPLICIT_NODE: {
                    pm_implicit_node_t *cast = (pm_implicit_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_IN_NODE: {
                    pm_in_node_t *cast = (pm_in_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->pattern);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INDEX_AND_WRITE_NODE: {
                    pm_index_and_write_node_t *cast = (pm_index_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INDEX_OPERATOR_WRITE_NODE: {
                    pm_index_operator_write_node_t *cast = (pm_index_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INDEX_OR_WRITE_NODE: {
                    pm_index_or_write_node_t *cast = (pm_index_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INDEX_TARGET_NODE: {
                    pm_index_target_node_t *cast = (pm_index_target_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->receiver);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
                    pm_instance_variable_and_write_node_t *cast = (pm_instance_variable_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_instance_variable_operator_write_node_t *cast = (pm_instance_variable_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
                    pm_instance_variable_or_write_node_t *cast = (pm_instance_variable_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_WRITE_NODE: {
                    pm_instance_variable_write_node_t *cast = (pm_instance_variable_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
                    pm_interpolated_match_last_line_node_t *cast = (pm_interpolated_match_last_line_node_t *) node;
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->parts.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
                    pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->parts.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INTERPOLATED_STRING_NODE: {
                    pm_interpolated_string_node_t *cast = (pm_interpolated_string_node_t *) node;
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->parts.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INTERPOLATED_SYMBOL_NODE: {
                    pm_interpolated_symbol_node_t *cast = (pm_interpolated_symbol_node_t *) node;
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->parts.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_INTERPOLATED_X_STRING_NODE: {
                    pm_interpolated_x_string_node_t *cast = (pm_interpolated_x_string_node_t *) node;
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->parts.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_KEYWORD_HASH_NODE: {
                    pm_keyword_hash_node_t *cast = (pm_keyword_hash_node_t *) node;
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->elements.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_LAMBDA_NODE: {
                    pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->parameters);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
                    pm_local_variable_and_write_node_t *cast = (pm_local_variable_and_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_local_variable_operator_write_node_t *cast = (pm_local_variable_operator_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
                    pm_local_variable_or_write_node_t *cast = (pm_local_variable_or_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_WRITE_NODE: {
                    pm_local_variable_write_node_t *cast = (pm_local_variable_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_MATCH_PREDICATE_NODE: {
                    pm_match_predicate_node_t *cast = (pm_match_predicate_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->pattern);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_MATCH_REQUIRED_NODE: {
                    pm_match_required_node_t *cast = (pm_match_required_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->pattern);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_MATCH_WRITE_NODE: {
                    pm_match_write_node_t *cast = (pm_match_write_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->call);
                    for (size_t index = 0; index < cast->targets.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->targets.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_MODULE_NODE: {
                    pm_module_node_t *cast = (pm_module_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->constant_path);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_MULTI_TARGET_NODE: {
                    pm_multi_target_node_t *cast = (pm_multi_target_node_t *) node;
                    for (size_t index = 0; index < cast->lefts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->lefts.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rest);
                    for (size_t index = 0; index < cast->rights.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->rights.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_MULTI_WRITE_NODE: {
                    pm_multi_write_node_t *cast = (pm_multi_write_node_t *) node;
                    for (size_t index = 0; index < cast->lefts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->lefts.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rest);
                    for (size_t index = 0; index < cast->rights.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->rights.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_NEXT_NODE: {
                    pm_next_node_t *cast = (pm_next_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
                    pm_optional_keyword_parameter_node_t *cast = (pm_optional_keyword_parameter_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_OPTIONAL_PARAMETER_NODE: {
                    pm_optional_parameter_node_t *cast = (pm_optional_parameter_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->value);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_OR_NODE: {
                    pm_or_node_t *cast = (pm_or_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->left);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->right);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_PARAMETERS_NODE: {
                    pm_parameters_node_t *cast = (pm_parameters_node_t *) node;
                    for (size_t index = 0; index < cast->requireds.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->requireds.nodes[index]);
                    }
                    for (size_t index = 0; index < cast->optionals.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->optionals.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rest);
                    for (size_t index = 0; index < cast->posts.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->posts.nodes[index]);
                    }
                    for (size_t index = 0; index < cast->keywords.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->keywords.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->keyword_rest);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_PARENTHESES_NODE: {
                    pm_parentheses_node_t *cast = (pm_parentheses_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_PINNED_EXPRESSION_NODE: {
                    pm_pinned_expression_node_t *cast = (pm_pinned_expression_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->expression);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_PINNED_VARIABLE_NODE: {
                    pm_pinned_variable_node_t *cast = (pm_pinned_variable_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->variable);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_POST_EXECUTION_NODE: {
                    pm_post_execution_node_t *cast = (pm_post_execution_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_PRE_EXECUTION_NODE: {
                    pm_pre_execution_node_t *cast = (pm_pre_execution_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_PROGRAM_NODE: {
                    pm_program_node_t *cast = (pm_program_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_RANGE_NODE: {
                    pm_range_node_t *cast = (pm_range_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->left);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->right);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_RATIONAL_NODE: {
                    pm_rational_node_t *cast = (pm_rational_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->numeric);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_RESCUE_MODIFIER_NODE: {
                    pm_rescue_modifier_node_t *cast = (pm_rescue_modifier_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->expression);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->rescue_expression);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_RESCUE_NODE: {
                    pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
                    for (size_t index = 0; index < cast->exceptions.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->exceptions.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->reference);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->consequent);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_RETURN_NODE: {
                    pm_return_node_t *cast = (pm_return_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_SINGLETON_CLASS_NODE: {
                    pm_singleton_class_node_t *cast = (pm_singleton_class_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->expression);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->body);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_SPLAT_NODE: {
                    pm_splat_node_t *cast = (pm_splat_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->expression);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_STATEMENTS_NODE: {
                    pm_statements_node_t *cast = (pm_statements_node_t *) node;
                    for (size_t index = 0; index < cast->body.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->body.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_SUPER_NODE: {
                    pm_super_node_t *cast = (pm_super_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->block);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_UNDEF_NODE: {
                    pm_undef_node_t *cast = (pm_undef_node_t *) node;
                    for (size_t index = 0; index < cast->names.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->names.nodes[index]);
                    }
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_UNLESS_NODE: {
                    pm_unless_node_t *cast = (pm_unless_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->predicate);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->consequent);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_UNTIL_NODE: {
                    pm_until_node_t *cast = (pm_until_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->predicate);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_WHEN_NODE: {
                    pm_when_node_t *cast = (pm_when_node_t *) node;
                    for (size_t index = 0; index < cast->conditions.size; index++) {
                        pm_node_stack_push(&node_stack, (pm_node_t *) cast->conditions.nodes[index]);
                    }
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_WHILE_NODE: {
                    pm_while_node_t *cast = (pm_while_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->predicate);
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->statements);
                    break;
                }
#line 118 "api_node.c.erb"
                case PM_YIELD_NODE: {
                    pm_yield_node_t *cast = (pm_yield_node_t *) node;
                    pm_node_stack_push(&node_stack, (pm_node_t *) cast->arguments);
                    break;
                }
                default:
                    break;
            }
#line 138 "api_node.c.erb"
        } else {
            pm_node_t *node = pm_node_stack_pop(&node_stack);

            switch (PM_NODE_TYPE(node)) {
#line 144 "api_node.c.erb"
                case PM_ALIAS_GLOBAL_VARIABLE_NODE: {
                    pm_alias_global_variable_node_t *cast = (pm_alias_global_variable_node_t *) node;
                    VALUE argv[4];

                    // new_name
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // old_name
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismAliasGlobalVariableNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ALIAS_METHOD_NODE: {
                    pm_alias_method_node_t *cast = (pm_alias_method_node_t *) node;
                    VALUE argv[4];

                    // new_name
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // old_name
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismAliasMethodNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ALTERNATION_PATTERN_NODE: {
                    pm_alternation_pattern_node_t *cast = (pm_alternation_pattern_node_t *) node;
                    VALUE argv[4];

                    // left
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // right
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismAlternationPatternNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_AND_NODE: {
                    pm_and_node_t *cast = (pm_and_node_t *) node;
                    VALUE argv[4];

                    // left
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // right
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismAndNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ARGUMENTS_NODE: {
                    pm_arguments_node_t *cast = (pm_arguments_node_t *) node;
                    VALUE argv[3];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // arguments
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->arguments.size);
                    for (size_t index = 0; index < cast->arguments.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismArgumentsNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ARRAY_NODE: {
                    pm_array_node_t *cast = (pm_array_node_t *) node;
                    VALUE argv[5];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // elements
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->elements.size);
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismArrayNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ARRAY_PATTERN_NODE: {
                    pm_array_pattern_node_t *cast = (pm_array_pattern_node_t *) node;
                    VALUE argv[7];

                    // constant
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // requireds
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->requireds.size);
                    for (size_t index = 0; index < cast->requireds.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // rest
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // posts
#line 158 "api_node.c.erb"
                    argv[3] = rb_ary_new_capa(cast->posts.size);
                    for (size_t index = 0; index < cast->posts.size; index++) {
                        rb_ary_push(argv[3], rb_ary_pop(value_stack));
                    }

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[4] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismArrayPatternNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ASSOC_NODE: {
                    pm_assoc_node_t *cast = (pm_assoc_node_t *) node;
                    VALUE argv[4];

                    // key
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // value
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismAssocNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ASSOC_SPLAT_NODE: {
                    pm_assoc_splat_node_t *cast = (pm_assoc_splat_node_t *) node;
                    VALUE argv[3];

                    // value
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismAssocSplatNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BACK_REFERENCE_READ_NODE: {
                    pm_back_reference_read_node_t *cast = (pm_back_reference_read_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismBackReferenceReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BEGIN_NODE: {
                    pm_begin_node_t *cast = (pm_begin_node_t *) node;
                    VALUE argv[7];

                    // begin_keyword_loc
#line 183 "api_node.c.erb"
                    argv[0] = cast->begin_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->begin_keyword_loc.start, cast->begin_keyword_loc.end, source);

                    // statements
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // rescue_clause
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // else_clause
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // ensure_clause
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->end_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismBeginNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BLOCK_ARGUMENT_NODE: {
                    pm_block_argument_node_t *cast = (pm_block_argument_node_t *) node;
                    VALUE argv[3];

                    // expression
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismBlockArgumentNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BLOCK_LOCAL_VARIABLE_NODE: {
                    pm_block_local_variable_node_t *cast = (pm_block_local_variable_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismBlockLocalVariableNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BLOCK_NODE: {
                    pm_block_node_t *cast = (pm_block_node_t *) node;
                    VALUE argv[7];

                    // locals
#line 173 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // locals_body_index
#line 189 "api_node.c.erb"
                    argv[1] = ULONG2NUM(cast->locals_body_index);

                    // parameters
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // body
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[5] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismBlockNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BLOCK_PARAMETER_NODE: {
                    pm_block_parameter_node_t *cast = (pm_block_parameter_node_t *) node;
                    VALUE argv[4];

                    // name
                    argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->name_loc.start == NULL ? Qnil : pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismBlockParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BLOCK_PARAMETERS_NODE: {
                    pm_block_parameters_node_t *cast = (pm_block_parameters_node_t *) node;
                    VALUE argv[5];

                    // parameters
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // locals
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismBlockParametersNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_BREAK_NODE: {
                    pm_break_node_t *cast = (pm_break_node_t *) node;
                    VALUE argv[3];

                    // arguments
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismBreakNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CALL_AND_WRITE_NODE: {
                    pm_call_and_write_node_t *cast = (pm_call_and_write_node_t *) node;
                    VALUE argv[9];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // message_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->message_loc.start == NULL ? Qnil : pm_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);

                    // read_name
#line 167 "api_node.c.erb"
                    assert(cast->read_name != 0);
                    argv[4] = rb_id2sym(constants[cast->read_name - 1]);

                    // write_name
#line 167 "api_node.c.erb"
                    assert(cast->write_name != 0);
                    argv[5] = rb_id2sym(constants[cast->write_name - 1]);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[6] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[7] = rb_ary_pop(value_stack);

                    // location
                    argv[8] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(9, argv, rb_cPrismCallAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CALL_NODE: {
                    pm_call_node_t *cast = (pm_call_node_t *) node;
                    VALUE argv[10];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[3] = rb_id2sym(constants[cast->name - 1]);

                    // message_loc
#line 183 "api_node.c.erb"
                    argv[4] = cast->message_loc.start == NULL ? Qnil : pm_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[7] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // block
#line 155 "api_node.c.erb"
                    argv[8] = rb_ary_pop(value_stack);

                    // location
                    argv[9] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(10, argv, rb_cPrismCallNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CALL_OPERATOR_WRITE_NODE: {
                    pm_call_operator_write_node_t *cast = (pm_call_operator_write_node_t *) node;
                    VALUE argv[10];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // message_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->message_loc.start == NULL ? Qnil : pm_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);

                    // read_name
#line 167 "api_node.c.erb"
                    assert(cast->read_name != 0);
                    argv[4] = rb_id2sym(constants[cast->read_name - 1]);

                    // write_name
#line 167 "api_node.c.erb"
                    assert(cast->write_name != 0);
                    argv[5] = rb_id2sym(constants[cast->write_name - 1]);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[6] = rb_id2sym(constants[cast->operator - 1]);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[7] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[8] = rb_ary_pop(value_stack);

                    // location
                    argv[9] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(10, argv, rb_cPrismCallOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CALL_OR_WRITE_NODE: {
                    pm_call_or_write_node_t *cast = (pm_call_or_write_node_t *) node;
                    VALUE argv[9];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // message_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->message_loc.start == NULL ? Qnil : pm_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);

                    // read_name
#line 167 "api_node.c.erb"
                    assert(cast->read_name != 0);
                    argv[4] = rb_id2sym(constants[cast->read_name - 1]);

                    // write_name
#line 167 "api_node.c.erb"
                    assert(cast->write_name != 0);
                    argv[5] = rb_id2sym(constants[cast->write_name - 1]);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[6] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[7] = rb_ary_pop(value_stack);

                    // location
                    argv[8] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(9, argv, rb_cPrismCallOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CALL_TARGET_NODE: {
                    pm_call_target_node_t *cast = (pm_call_target_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[3] = rb_id2sym(constants[cast->name - 1]);

                    // message_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->message_loc.start, cast->message_loc.end, source);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismCallTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CAPTURE_PATTERN_NODE: {
                    pm_capture_pattern_node_t *cast = (pm_capture_pattern_node_t *) node;
                    VALUE argv[4];

                    // value
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // target
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismCapturePatternNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CASE_MATCH_NODE: {
                    pm_case_match_node_t *cast = (pm_case_match_node_t *) node;
                    VALUE argv[6];

                    // predicate
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // conditions
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->conditions.size);
                    for (size_t index = 0; index < cast->conditions.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // consequent
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // case_keyword_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->case_keyword_loc.start, cast->case_keyword_loc.end, source);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismCaseMatchNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CASE_NODE: {
                    pm_case_node_t *cast = (pm_case_node_t *) node;
                    VALUE argv[6];

                    // predicate
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // conditions
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->conditions.size);
                    for (size_t index = 0; index < cast->conditions.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // consequent
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // case_keyword_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->case_keyword_loc.start, cast->case_keyword_loc.end, source);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismCaseNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_NODE: {
                    pm_class_node_t *cast = (pm_class_node_t *) node;
                    VALUE argv[9];

                    // locals
#line 173 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // class_keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);

                    // constant_path
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // inheritance_operator_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->inheritance_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->inheritance_operator_loc.start, cast->inheritance_operator_loc.end, source);

                    // superclass
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // body
#line 155 "api_node.c.erb"
                    argv[5] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[6] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[7] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[8] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(9, argv, rb_cPrismClassNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_VARIABLE_AND_WRITE_NODE: {
                    pm_class_variable_and_write_node_t *cast = (pm_class_variable_and_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismClassVariableAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_class_variable_operator_write_node_t *cast = (pm_class_variable_operator_write_node_t *) node;
                    VALUE argv[6];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[4] = rb_id2sym(constants[cast->operator - 1]);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismClassVariableOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_VARIABLE_OR_WRITE_NODE: {
                    pm_class_variable_or_write_node_t *cast = (pm_class_variable_or_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismClassVariableOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_VARIABLE_READ_NODE: {
                    pm_class_variable_read_node_t *cast = (pm_class_variable_read_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismClassVariableReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_VARIABLE_TARGET_NODE: {
                    pm_class_variable_target_node_t *cast = (pm_class_variable_target_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismClassVariableTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CLASS_VARIABLE_WRITE_NODE: {
                    pm_class_variable_write_node_t *cast = (pm_class_variable_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismClassVariableWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_AND_WRITE_NODE: {
                    pm_constant_and_write_node_t *cast = (pm_constant_and_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismConstantAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_OPERATOR_WRITE_NODE: {
                    pm_constant_operator_write_node_t *cast = (pm_constant_operator_write_node_t *) node;
                    VALUE argv[6];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[4] = rb_id2sym(constants[cast->operator - 1]);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismConstantOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_OR_WRITE_NODE: {
                    pm_constant_or_write_node_t *cast = (pm_constant_or_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismConstantOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_PATH_AND_WRITE_NODE: {
                    pm_constant_path_and_write_node_t *cast = (pm_constant_path_and_write_node_t *) node;
                    VALUE argv[4];

                    // target
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismConstantPathAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_PATH_NODE: {
                    pm_constant_path_node_t *cast = (pm_constant_path_node_t *) node;
                    VALUE argv[4];

                    // parent
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // child
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // delimiter_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismConstantPathNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_PATH_OPERATOR_WRITE_NODE: {
                    pm_constant_path_operator_write_node_t *cast = (pm_constant_path_operator_write_node_t *) node;
                    VALUE argv[5];

                    // target
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[3] = rb_id2sym(constants[cast->operator - 1]);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismConstantPathOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_PATH_OR_WRITE_NODE: {
                    pm_constant_path_or_write_node_t *cast = (pm_constant_path_or_write_node_t *) node;
                    VALUE argv[4];

                    // target
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismConstantPathOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_PATH_TARGET_NODE: {
                    pm_constant_path_target_node_t *cast = (pm_constant_path_target_node_t *) node;
                    VALUE argv[4];

                    // parent
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // child
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // delimiter_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->delimiter_loc.start, cast->delimiter_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismConstantPathTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_PATH_WRITE_NODE: {
                    pm_constant_path_write_node_t *cast = (pm_constant_path_write_node_t *) node;
                    VALUE argv[4];

                    // target
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismConstantPathWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_READ_NODE: {
                    pm_constant_read_node_t *cast = (pm_constant_read_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismConstantReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_TARGET_NODE: {
                    pm_constant_target_node_t *cast = (pm_constant_target_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismConstantTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_CONSTANT_WRITE_NODE: {
                    pm_constant_write_node_t *cast = (pm_constant_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismConstantWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_DEF_NODE: {
                    pm_def_node_t *cast = (pm_def_node_t *) node;
                    VALUE argv[14];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // parameters
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // body
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // locals
#line 173 "api_node.c.erb"
                    argv[5] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[5], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // locals_body_index
#line 189 "api_node.c.erb"
                    argv[6] = ULONG2NUM(cast->locals_body_index);

                    // def_keyword_loc
#line 180 "api_node.c.erb"
                    argv[7] = pm_location_new(parser, cast->def_keyword_loc.start, cast->def_keyword_loc.end, source);

                    // operator_loc
#line 183 "api_node.c.erb"
                    argv[8] = cast->operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // lparen_loc
#line 183 "api_node.c.erb"
                    argv[9] = cast->lparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // rparen_loc
#line 183 "api_node.c.erb"
                    argv[10] = cast->rparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // equal_loc
#line 183 "api_node.c.erb"
                    argv[11] = cast->equal_loc.start == NULL ? Qnil : pm_location_new(parser, cast->equal_loc.start, cast->equal_loc.end, source);

                    // end_keyword_loc
#line 183 "api_node.c.erb"
                    argv[12] = cast->end_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[13] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(14, argv, rb_cPrismDefNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_DEFINED_NODE: {
                    pm_defined_node_t *cast = (pm_defined_node_t *) node;
                    VALUE argv[5];

                    // lparen_loc
#line 183 "api_node.c.erb"
                    argv[0] = cast->lparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // rparen_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->rparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismDefinedNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ELSE_NODE: {
                    pm_else_node_t *cast = (pm_else_node_t *) node;
                    VALUE argv[4];

                    // else_keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->else_keyword_loc.start, cast->else_keyword_loc.end, source);

                    // statements
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->end_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismElseNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_EMBEDDED_STATEMENTS_NODE: {
                    pm_embedded_statements_node_t *cast = (pm_embedded_statements_node_t *) node;
                    VALUE argv[4];

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // statements
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismEmbeddedStatementsNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_EMBEDDED_VARIABLE_NODE: {
                    pm_embedded_variable_node_t *cast = (pm_embedded_variable_node_t *) node;
                    VALUE argv[3];

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // variable
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismEmbeddedVariableNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_ENSURE_NODE: {
                    pm_ensure_node_t *cast = (pm_ensure_node_t *) node;
                    VALUE argv[4];

                    // ensure_keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->ensure_keyword_loc.start, cast->ensure_keyword_loc.end, source);

                    // statements
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismEnsureNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FALSE_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismFalseNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FIND_PATTERN_NODE: {
                    pm_find_pattern_node_t *cast = (pm_find_pattern_node_t *) node;
                    VALUE argv[7];

                    // constant
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // left
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // requireds
#line 158 "api_node.c.erb"
                    argv[2] = rb_ary_new_capa(cast->requireds.size);
                    for (size_t index = 0; index < cast->requireds.size; index++) {
                        rb_ary_push(argv[2], rb_ary_pop(value_stack));
                    }

                    // right
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[4] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismFindPatternNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FLIP_FLOP_NODE: {
                    pm_flip_flop_node_t *cast = (pm_flip_flop_node_t *) node;
                    VALUE argv[5];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // left
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // right
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismFlipFlopNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FLOAT_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismFloatNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FOR_NODE: {
                    pm_for_node_t *cast = (pm_for_node_t *) node;
                    VALUE argv[8];

                    // index
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // collection
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // statements
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // for_keyword_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->for_keyword_loc.start, cast->for_keyword_loc.end, source);

                    // in_keyword_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->in_keyword_loc.start, cast->in_keyword_loc.end, source);

                    // do_keyword_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->do_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->do_keyword_loc.start, cast->do_keyword_loc.end, source);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[6] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[7] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(8, argv, rb_cPrismForNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FORWARDING_ARGUMENTS_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismForwardingArgumentsNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FORWARDING_PARAMETER_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismForwardingParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_FORWARDING_SUPER_NODE: {
                    VALUE argv[2];

                    // block
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismForwardingSuperNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_AND_WRITE_NODE: {
                    pm_global_variable_and_write_node_t *cast = (pm_global_variable_and_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismGlobalVariableAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_global_variable_operator_write_node_t *cast = (pm_global_variable_operator_write_node_t *) node;
                    VALUE argv[6];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[4] = rb_id2sym(constants[cast->operator - 1]);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismGlobalVariableOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_OR_WRITE_NODE: {
                    pm_global_variable_or_write_node_t *cast = (pm_global_variable_or_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismGlobalVariableOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_READ_NODE: {
                    pm_global_variable_read_node_t *cast = (pm_global_variable_read_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismGlobalVariableReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_TARGET_NODE: {
                    pm_global_variable_target_node_t *cast = (pm_global_variable_target_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismGlobalVariableTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_GLOBAL_VARIABLE_WRITE_NODE: {
                    pm_global_variable_write_node_t *cast = (pm_global_variable_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismGlobalVariableWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_HASH_NODE: {
                    pm_hash_node_t *cast = (pm_hash_node_t *) node;
                    VALUE argv[4];

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // elements
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->elements.size);
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismHashNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_HASH_PATTERN_NODE: {
                    pm_hash_pattern_node_t *cast = (pm_hash_pattern_node_t *) node;
                    VALUE argv[6];

                    // constant
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // elements
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->elements.size);
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // rest
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[4] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismHashPatternNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_IF_NODE: {
                    pm_if_node_t *cast = (pm_if_node_t *) node;
                    VALUE argv[7];

                    // if_keyword_loc
#line 183 "api_node.c.erb"
                    argv[0] = cast->if_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->if_keyword_loc.start, cast->if_keyword_loc.end, source);

                    // predicate
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // then_keyword_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->then_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->then_keyword_loc.start, cast->then_keyword_loc.end, source);

                    // statements
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // consequent
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->end_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismIfNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_IMAGINARY_NODE: {
                    VALUE argv[2];

                    // numeric
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismImaginaryNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_IMPLICIT_NODE: {
                    VALUE argv[2];

                    // value
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismImplicitNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_IMPLICIT_REST_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismImplicitRestNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_IN_NODE: {
                    pm_in_node_t *cast = (pm_in_node_t *) node;
                    VALUE argv[5];

                    // pattern
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // statements
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // in_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->in_loc.start, cast->in_loc.end, source);

                    // then_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->then_loc.start == NULL ? Qnil : pm_location_new(parser, cast->then_loc.start, cast->then_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismInNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INDEX_AND_WRITE_NODE: {
                    pm_index_and_write_node_t *cast = (pm_index_and_write_node_t *) node;
                    VALUE argv[10];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[5] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // block
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[7] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[8] = rb_ary_pop(value_stack);

                    // location
                    argv[9] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(10, argv, rb_cPrismIndexAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INDEX_OPERATOR_WRITE_NODE: {
                    pm_index_operator_write_node_t *cast = (pm_index_operator_write_node_t *) node;
                    VALUE argv[11];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[5] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // block
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[7] = rb_id2sym(constants[cast->operator - 1]);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[8] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[9] = rb_ary_pop(value_stack);

                    // location
                    argv[10] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(11, argv, rb_cPrismIndexOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INDEX_OR_WRITE_NODE: {
                    pm_index_or_write_node_t *cast = (pm_index_or_write_node_t *) node;
                    VALUE argv[10];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // call_operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->call_operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->call_operator_loc.start, cast->call_operator_loc.end, source);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[5] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // block
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[7] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[8] = rb_ary_pop(value_stack);

                    // location
                    argv[9] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(10, argv, rb_cPrismIndexOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INDEX_TARGET_NODE: {
                    pm_index_target_node_t *cast = (pm_index_target_node_t *) node;
                    VALUE argv[7];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // receiver
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // block
#line 155 "api_node.c.erb"
                    argv[5] = rb_ary_pop(value_stack);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismIndexTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_AND_WRITE_NODE: {
                    pm_instance_variable_and_write_node_t *cast = (pm_instance_variable_and_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismInstanceVariableAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_instance_variable_operator_write_node_t *cast = (pm_instance_variable_operator_write_node_t *) node;
                    VALUE argv[6];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[4] = rb_id2sym(constants[cast->operator - 1]);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismInstanceVariableOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_OR_WRITE_NODE: {
                    pm_instance_variable_or_write_node_t *cast = (pm_instance_variable_or_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismInstanceVariableOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_READ_NODE: {
                    pm_instance_variable_read_node_t *cast = (pm_instance_variable_read_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismInstanceVariableReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_TARGET_NODE: {
                    pm_instance_variable_target_node_t *cast = (pm_instance_variable_target_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismInstanceVariableTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INSTANCE_VARIABLE_WRITE_NODE: {
                    pm_instance_variable_write_node_t *cast = (pm_instance_variable_write_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismInstanceVariableWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INTEGER_NODE: {
                    VALUE argv[2];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismIntegerNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INTERPOLATED_MATCH_LAST_LINE_NODE: {
                    pm_interpolated_match_last_line_node_t *cast = (pm_interpolated_match_last_line_node_t *) node;
                    VALUE argv[5];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // parts
#line 158 "api_node.c.erb"
                    argv[2] = rb_ary_new_capa(cast->parts.size);
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        rb_ary_push(argv[2], rb_ary_pop(value_stack));
                    }

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismInterpolatedMatchLastLineNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INTERPOLATED_REGULAR_EXPRESSION_NODE: {
                    pm_interpolated_regular_expression_node_t *cast = (pm_interpolated_regular_expression_node_t *) node;
                    VALUE argv[5];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // parts
#line 158 "api_node.c.erb"
                    argv[2] = rb_ary_new_capa(cast->parts.size);
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        rb_ary_push(argv[2], rb_ary_pop(value_stack));
                    }

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismInterpolatedRegularExpressionNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INTERPOLATED_STRING_NODE: {
                    pm_interpolated_string_node_t *cast = (pm_interpolated_string_node_t *) node;
                    VALUE argv[4];

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[0] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // parts
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->parts.size);
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismInterpolatedStringNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INTERPOLATED_SYMBOL_NODE: {
                    pm_interpolated_symbol_node_t *cast = (pm_interpolated_symbol_node_t *) node;
                    VALUE argv[4];

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[0] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // parts
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->parts.size);
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismInterpolatedSymbolNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_INTERPOLATED_X_STRING_NODE: {
                    pm_interpolated_x_string_node_t *cast = (pm_interpolated_x_string_node_t *) node;
                    VALUE argv[4];

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // parts
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->parts.size);
                    for (size_t index = 0; index < cast->parts.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismInterpolatedXStringNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_KEYWORD_HASH_NODE: {
                    pm_keyword_hash_node_t *cast = (pm_keyword_hash_node_t *) node;
                    VALUE argv[3];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // elements
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->elements.size);
                    for (size_t index = 0; index < cast->elements.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismKeywordHashNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_KEYWORD_REST_PARAMETER_NODE: {
                    pm_keyword_rest_parameter_node_t *cast = (pm_keyword_rest_parameter_node_t *) node;
                    VALUE argv[4];

                    // name
                    argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->name_loc.start == NULL ? Qnil : pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismKeywordRestParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LAMBDA_NODE: {
                    pm_lambda_node_t *cast = (pm_lambda_node_t *) node;
                    VALUE argv[8];

                    // locals
#line 173 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // locals_body_index
#line 189 "api_node.c.erb"
                    argv[1] = ULONG2NUM(cast->locals_body_index);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // parameters
#line 155 "api_node.c.erb"
                    argv[5] = rb_ary_pop(value_stack);

                    // body
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // location
                    argv[7] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(8, argv, rb_cPrismLambdaNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_AND_WRITE_NODE: {
                    pm_local_variable_and_write_node_t *cast = (pm_local_variable_and_write_node_t *) node;
                    VALUE argv[6];

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[3] = rb_id2sym(constants[cast->name - 1]);

                    // depth
#line 189 "api_node.c.erb"
                    argv[4] = ULONG2NUM(cast->depth);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismLocalVariableAndWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE: {
                    pm_local_variable_operator_write_node_t *cast = (pm_local_variable_operator_write_node_t *) node;
                    VALUE argv[7];

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[3] = rb_id2sym(constants[cast->name - 1]);

                    // operator
#line 167 "api_node.c.erb"
                    assert(cast->operator != 0);
                    argv[4] = rb_id2sym(constants[cast->operator - 1]);

                    // depth
#line 189 "api_node.c.erb"
                    argv[5] = ULONG2NUM(cast->depth);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismLocalVariableOperatorWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_OR_WRITE_NODE: {
                    pm_local_variable_or_write_node_t *cast = (pm_local_variable_or_write_node_t *) node;
                    VALUE argv[6];

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[3] = rb_id2sym(constants[cast->name - 1]);

                    // depth
#line 189 "api_node.c.erb"
                    argv[4] = ULONG2NUM(cast->depth);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismLocalVariableOrWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_READ_NODE: {
                    pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node;
                    VALUE argv[3];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // depth
#line 189 "api_node.c.erb"
                    argv[1] = ULONG2NUM(cast->depth);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismLocalVariableReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_TARGET_NODE: {
                    pm_local_variable_target_node_t *cast = (pm_local_variable_target_node_t *) node;
                    VALUE argv[3];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // depth
#line 189 "api_node.c.erb"
                    argv[1] = ULONG2NUM(cast->depth);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismLocalVariableTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_LOCAL_VARIABLE_WRITE_NODE: {
                    pm_local_variable_write_node_t *cast = (pm_local_variable_write_node_t *) node;
                    VALUE argv[6];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // depth
#line 189 "api_node.c.erb"
                    argv[1] = ULONG2NUM(cast->depth);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismLocalVariableWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MATCH_LAST_LINE_NODE: {
                    pm_match_last_line_node_t *cast = (pm_match_last_line_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // content_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // unescaped
#line 164 "api_node.c.erb"
                    argv[4] = pm_string_new(&cast->unescaped, encoding);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismMatchLastLineNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MATCH_PREDICATE_NODE: {
                    pm_match_predicate_node_t *cast = (pm_match_predicate_node_t *) node;
                    VALUE argv[4];

                    // value
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // pattern
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismMatchPredicateNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MATCH_REQUIRED_NODE: {
                    pm_match_required_node_t *cast = (pm_match_required_node_t *) node;
                    VALUE argv[4];

                    // value
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // pattern
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismMatchRequiredNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MATCH_WRITE_NODE: {
                    pm_match_write_node_t *cast = (pm_match_write_node_t *) node;
                    VALUE argv[3];

                    // call
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // targets
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->targets.size);
                    for (size_t index = 0; index < cast->targets.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismMatchWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MISSING_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismMissingNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MODULE_NODE: {
                    pm_module_node_t *cast = (pm_module_node_t *) node;
                    VALUE argv[7];

                    // locals
#line 173 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // module_keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->module_keyword_loc.start, cast->module_keyword_loc.end, source);

                    // constant_path
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // body
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[4] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[5] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismModuleNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MULTI_TARGET_NODE: {
                    pm_multi_target_node_t *cast = (pm_multi_target_node_t *) node;
                    VALUE argv[6];

                    // lefts
#line 158 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->lefts.size);
                    for (size_t index = 0; index < cast->lefts.size; index++) {
                        rb_ary_push(argv[0], rb_ary_pop(value_stack));
                    }

                    // rest
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // rights
#line 158 "api_node.c.erb"
                    argv[2] = rb_ary_new_capa(cast->rights.size);
                    for (size_t index = 0; index < cast->rights.size; index++) {
                        rb_ary_push(argv[2], rb_ary_pop(value_stack));
                    }

                    // lparen_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->lparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // rparen_loc
#line 183 "api_node.c.erb"
                    argv[4] = cast->rparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismMultiTargetNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_MULTI_WRITE_NODE: {
                    pm_multi_write_node_t *cast = (pm_multi_write_node_t *) node;
                    VALUE argv[8];

                    // lefts
#line 158 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->lefts.size);
                    for (size_t index = 0; index < cast->lefts.size; index++) {
                        rb_ary_push(argv[0], rb_ary_pop(value_stack));
                    }

                    // rest
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // rights
#line 158 "api_node.c.erb"
                    argv[2] = rb_ary_new_capa(cast->rights.size);
                    for (size_t index = 0; index < cast->rights.size; index++) {
                        rb_ary_push(argv[2], rb_ary_pop(value_stack));
                    }

                    // lparen_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->lparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // rparen_loc
#line 183 "api_node.c.erb"
                    argv[4] = cast->rparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[5] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // location
                    argv[7] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(8, argv, rb_cPrismMultiWriteNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_NEXT_NODE: {
                    pm_next_node_t *cast = (pm_next_node_t *) node;
                    VALUE argv[3];

                    // arguments
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismNextNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_NIL_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismNilNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_NO_KEYWORDS_PARAMETER_NODE: {
                    pm_no_keywords_parameter_node_t *cast = (pm_no_keywords_parameter_node_t *) node;
                    VALUE argv[3];

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismNoKeywordsParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_NUMBERED_PARAMETERS_NODE: {
                    pm_numbered_parameters_node_t *cast = (pm_numbered_parameters_node_t *) node;
                    VALUE argv[2];

                    // maximum
#line 186 "api_node.c.erb"
                    argv[0] = UINT2NUM(cast->maximum);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismNumberedParametersNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_NUMBERED_REFERENCE_READ_NODE: {
                    pm_numbered_reference_read_node_t *cast = (pm_numbered_reference_read_node_t *) node;
                    VALUE argv[2];

                    // number
#line 189 "api_node.c.erb"
                    argv[0] = ULONG2NUM(cast->number);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismNumberedReferenceReadNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_OPTIONAL_KEYWORD_PARAMETER_NODE: {
                    pm_optional_keyword_parameter_node_t *cast = (pm_optional_keyword_parameter_node_t *) node;
                    VALUE argv[4];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismOptionalKeywordParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_OPTIONAL_PARAMETER_NODE: {
                    pm_optional_parameter_node_t *cast = (pm_optional_parameter_node_t *) node;
                    VALUE argv[5];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // value
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismOptionalParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_OR_NODE: {
                    pm_or_node_t *cast = (pm_or_node_t *) node;
                    VALUE argv[4];

                    // left
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // right
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismOrNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_PARAMETERS_NODE: {
                    pm_parameters_node_t *cast = (pm_parameters_node_t *) node;
                    VALUE argv[8];

                    // requireds
#line 158 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->requireds.size);
                    for (size_t index = 0; index < cast->requireds.size; index++) {
                        rb_ary_push(argv[0], rb_ary_pop(value_stack));
                    }

                    // optionals
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->optionals.size);
                    for (size_t index = 0; index < cast->optionals.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // rest
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // posts
#line 158 "api_node.c.erb"
                    argv[3] = rb_ary_new_capa(cast->posts.size);
                    for (size_t index = 0; index < cast->posts.size; index++) {
                        rb_ary_push(argv[3], rb_ary_pop(value_stack));
                    }

                    // keywords
#line 158 "api_node.c.erb"
                    argv[4] = rb_ary_new_capa(cast->keywords.size);
                    for (size_t index = 0; index < cast->keywords.size; index++) {
                        rb_ary_push(argv[4], rb_ary_pop(value_stack));
                    }

                    // keyword_rest
#line 155 "api_node.c.erb"
                    argv[5] = rb_ary_pop(value_stack);

                    // block
#line 155 "api_node.c.erb"
                    argv[6] = rb_ary_pop(value_stack);

                    // location
                    argv[7] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(8, argv, rb_cPrismParametersNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_PARENTHESES_NODE: {
                    pm_parentheses_node_t *cast = (pm_parentheses_node_t *) node;
                    VALUE argv[4];

                    // body
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismParenthesesNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_PINNED_EXPRESSION_NODE: {
                    pm_pinned_expression_node_t *cast = (pm_pinned_expression_node_t *) node;
                    VALUE argv[5];

                    // expression
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // lparen_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // rparen_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismPinnedExpressionNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_PINNED_VARIABLE_NODE: {
                    pm_pinned_variable_node_t *cast = (pm_pinned_variable_node_t *) node;
                    VALUE argv[3];

                    // variable
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismPinnedVariableNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_POST_EXECUTION_NODE: {
                    pm_post_execution_node_t *cast = (pm_post_execution_node_t *) node;
                    VALUE argv[5];

                    // statements
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismPostExecutionNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_PRE_EXECUTION_NODE: {
                    pm_pre_execution_node_t *cast = (pm_pre_execution_node_t *) node;
                    VALUE argv[5];

                    // statements
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismPreExecutionNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_PROGRAM_NODE: {
                    pm_program_node_t *cast = (pm_program_node_t *) node;
                    VALUE argv[3];

                    // locals
#line 173 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // statements
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismProgramNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_RANGE_NODE: {
                    pm_range_node_t *cast = (pm_range_node_t *) node;
                    VALUE argv[5];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // left
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // right
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismRangeNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_RATIONAL_NODE: {
                    VALUE argv[2];

                    // numeric
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismRationalNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_REDO_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismRedoNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_REGULAR_EXPRESSION_NODE: {
                    pm_regular_expression_node_t *cast = (pm_regular_expression_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // content_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // unescaped
#line 164 "api_node.c.erb"
                    argv[4] = pm_string_new(&cast->unescaped, encoding);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismRegularExpressionNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_REQUIRED_KEYWORD_PARAMETER_NODE: {
                    pm_required_keyword_parameter_node_t *cast = (pm_required_keyword_parameter_node_t *) node;
                    VALUE argv[3];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismRequiredKeywordParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_REQUIRED_PARAMETER_NODE: {
                    pm_required_parameter_node_t *cast = (pm_required_parameter_node_t *) node;
                    VALUE argv[2];

                    // name
#line 167 "api_node.c.erb"
                    assert(cast->name != 0);
                    argv[0] = rb_id2sym(constants[cast->name - 1]);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismRequiredParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_RESCUE_MODIFIER_NODE: {
                    pm_rescue_modifier_node_t *cast = (pm_rescue_modifier_node_t *) node;
                    VALUE argv[4];

                    // expression
#line 155 "api_node.c.erb"
                    argv[0] = rb_ary_pop(value_stack);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // rescue_expression
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismRescueModifierNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_RESCUE_NODE: {
                    pm_rescue_node_t *cast = (pm_rescue_node_t *) node;
                    VALUE argv[7];

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // exceptions
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->exceptions.size);
                    for (size_t index = 0; index < cast->exceptions.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // operator_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->operator_loc.start == NULL ? Qnil : pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // reference
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // statements
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // consequent
#line 155 "api_node.c.erb"
                    argv[5] = rb_ary_pop(value_stack);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismRescueNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_REST_PARAMETER_NODE: {
                    pm_rest_parameter_node_t *cast = (pm_rest_parameter_node_t *) node;
                    VALUE argv[4];

                    // name
                    argv[0] = cast->name == 0 ? Qnil : rb_id2sym(constants[cast->name - 1]);

                    // name_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->name_loc.start == NULL ? Qnil : pm_location_new(parser, cast->name_loc.start, cast->name_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismRestParameterNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_RETRY_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismRetryNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_RETURN_NODE: {
                    pm_return_node_t *cast = (pm_return_node_t *) node;
                    VALUE argv[3];

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismReturnNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SELF_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismSelfNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SINGLETON_CLASS_NODE: {
                    pm_singleton_class_node_t *cast = (pm_singleton_class_node_t *) node;
                    VALUE argv[7];

                    // locals
#line 173 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->locals.size);
                    for (size_t index = 0; index < cast->locals.size; index++) {
                        assert(cast->locals.ids[index] != 0);
                        rb_ary_push(argv[0], rb_id2sym(constants[cast->locals.ids[index] - 1]));
                    }

                    // class_keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->class_keyword_loc.start, cast->class_keyword_loc.end, source);

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // expression
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // body
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 180 "api_node.c.erb"
                    argv[5] = pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismSingletonClassNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SOURCE_ENCODING_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismSourceEncodingNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SOURCE_FILE_NODE: {
                    pm_source_file_node_t *cast = (pm_source_file_node_t *) node;
                    VALUE argv[2];

                    // filepath
#line 164 "api_node.c.erb"
                    argv[0] = pm_string_new(&cast->filepath, encoding);

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismSourceFileNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SOURCE_LINE_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismSourceLineNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SPLAT_NODE: {
                    pm_splat_node_t *cast = (pm_splat_node_t *) node;
                    VALUE argv[3];

                    // operator_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->operator_loc.start, cast->operator_loc.end, source);

                    // expression
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismSplatNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_STATEMENTS_NODE: {
                    pm_statements_node_t *cast = (pm_statements_node_t *) node;
                    VALUE argv[2];

                    // body
#line 158 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->body.size);
                    for (size_t index = 0; index < cast->body.size; index++) {
                        rb_ary_push(argv[0], rb_ary_pop(value_stack));
                    }

                    // location
                    argv[1] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(2, argv, rb_cPrismStatementsNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_STRING_NODE: {
                    pm_string_node_t *cast = (pm_string_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // content_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // unescaped
#line 164 "api_node.c.erb"
                    argv[4] = pm_string_new(&cast->unescaped, encoding);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismStringNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SUPER_NODE: {
                    pm_super_node_t *cast = (pm_super_node_t *) node;
                    VALUE argv[6];

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // lparen_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->lparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // rparen_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->rparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // block
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismSuperNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_SYMBOL_NODE: {
                    pm_symbol_node_t *cast = (pm_symbol_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->opening_loc.start == NULL ? Qnil : pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // value_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->value_loc.start == NULL ? Qnil : pm_location_new(parser, cast->value_loc.start, cast->value_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // unescaped
#line 164 "api_node.c.erb"
                    argv[4] = pm_string_new(&cast->unescaped, encoding);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismSymbolNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_TRUE_NODE: {
                    VALUE argv[1];

                    // location
                    argv[0] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(1, argv, rb_cPrismTrueNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_UNDEF_NODE: {
                    pm_undef_node_t *cast = (pm_undef_node_t *) node;
                    VALUE argv[3];

                    // names
#line 158 "api_node.c.erb"
                    argv[0] = rb_ary_new_capa(cast->names.size);
                    for (size_t index = 0; index < cast->names.size; index++) {
                        rb_ary_push(argv[0], rb_ary_pop(value_stack));
                    }

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // location
                    argv[2] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(3, argv, rb_cPrismUndefNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_UNLESS_NODE: {
                    pm_unless_node_t *cast = (pm_unless_node_t *) node;
                    VALUE argv[7];

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // predicate
#line 155 "api_node.c.erb"
                    argv[1] = rb_ary_pop(value_stack);

                    // then_keyword_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->then_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->then_keyword_loc.start, cast->then_keyword_loc.end, source);

                    // statements
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // consequent
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // end_keyword_loc
#line 183 "api_node.c.erb"
                    argv[5] = cast->end_keyword_loc.start == NULL ? Qnil : pm_location_new(parser, cast->end_keyword_loc.start, cast->end_keyword_loc.end, source);

                    // location
                    argv[6] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(7, argv, rb_cPrismUnlessNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_UNTIL_NODE: {
                    pm_until_node_t *cast = (pm_until_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // predicate
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // statements
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismUntilNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_WHEN_NODE: {
                    pm_when_node_t *cast = (pm_when_node_t *) node;
                    VALUE argv[4];

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // conditions
#line 158 "api_node.c.erb"
                    argv[1] = rb_ary_new_capa(cast->conditions.size);
                    for (size_t index = 0; index < cast->conditions.size; index++) {
                        rb_ary_push(argv[1], rb_ary_pop(value_stack));
                    }

                    // statements
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // location
                    argv[3] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(4, argv, rb_cPrismWhenNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_WHILE_NODE: {
                    pm_while_node_t *cast = (pm_while_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // closing_loc
#line 183 "api_node.c.erb"
                    argv[2] = cast->closing_loc.start == NULL ? Qnil : pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // predicate
#line 155 "api_node.c.erb"
                    argv[3] = rb_ary_pop(value_stack);

                    // statements
#line 155 "api_node.c.erb"
                    argv[4] = rb_ary_pop(value_stack);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismWhileNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_X_STRING_NODE: {
                    pm_x_string_node_t *cast = (pm_x_string_node_t *) node;
                    VALUE argv[6];

                    // flags
#line 192 "api_node.c.erb"
                    argv[0] = ULONG2NUM(node->flags & ~PM_NODE_FLAG_COMMON_MASK);

                    // opening_loc
#line 180 "api_node.c.erb"
                    argv[1] = pm_location_new(parser, cast->opening_loc.start, cast->opening_loc.end, source);

                    // content_loc
#line 180 "api_node.c.erb"
                    argv[2] = pm_location_new(parser, cast->content_loc.start, cast->content_loc.end, source);

                    // closing_loc
#line 180 "api_node.c.erb"
                    argv[3] = pm_location_new(parser, cast->closing_loc.start, cast->closing_loc.end, source);

                    // unescaped
#line 164 "api_node.c.erb"
                    argv[4] = pm_string_new(&cast->unescaped, encoding);

                    // location
                    argv[5] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(6, argv, rb_cPrismXStringNode));
                    break;
                }
#line 144 "api_node.c.erb"
                case PM_YIELD_NODE: {
                    pm_yield_node_t *cast = (pm_yield_node_t *) node;
                    VALUE argv[5];

                    // keyword_loc
#line 180 "api_node.c.erb"
                    argv[0] = pm_location_new(parser, cast->keyword_loc.start, cast->keyword_loc.end, source);

                    // lparen_loc
#line 183 "api_node.c.erb"
                    argv[1] = cast->lparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->lparen_loc.start, cast->lparen_loc.end, source);

                    // arguments
#line 155 "api_node.c.erb"
                    argv[2] = rb_ary_pop(value_stack);

                    // rparen_loc
#line 183 "api_node.c.erb"
                    argv[3] = cast->rparen_loc.start == NULL ? Qnil : pm_location_new(parser, cast->rparen_loc.start, cast->rparen_loc.end, source);

                    // location
                    argv[4] = pm_location_new(parser, node->location.start, node->location.end, source);

                    rb_ary_push(value_stack, rb_class_new_instance(5, argv, rb_cPrismYieldNode));
                    break;
                }
                default:
                    rb_raise(rb_eRuntimeError, "unknown node type: %d", PM_NODE_TYPE(node));
            }
        }
    }

    VALUE result = rb_ary_pop(value_stack);
    free(constants);
    return result;
}

void
Init_prism_api_node(void) {
    rb_cPrismAliasGlobalVariableNode = rb_define_class_under(rb_cPrism, "AliasGlobalVariableNode", rb_cPrismNode);
    rb_cPrismAliasMethodNode = rb_define_class_under(rb_cPrism, "AliasMethodNode", rb_cPrismNode);
    rb_cPrismAlternationPatternNode = rb_define_class_under(rb_cPrism, "AlternationPatternNode", rb_cPrismNode);
    rb_cPrismAndNode = rb_define_class_under(rb_cPrism, "AndNode", rb_cPrismNode);
    rb_cPrismArgumentsNode = rb_define_class_under(rb_cPrism, "ArgumentsNode", rb_cPrismNode);
    rb_cPrismArrayNode = rb_define_class_under(rb_cPrism, "ArrayNode", rb_cPrismNode);
    rb_cPrismArrayPatternNode = rb_define_class_under(rb_cPrism, "ArrayPatternNode", rb_cPrismNode);
    rb_cPrismAssocNode = rb_define_class_under(rb_cPrism, "AssocNode", rb_cPrismNode);
    rb_cPrismAssocSplatNode = rb_define_class_under(rb_cPrism, "AssocSplatNode", rb_cPrismNode);
    rb_cPrismBackReferenceReadNode = rb_define_class_under(rb_cPrism, "BackReferenceReadNode", rb_cPrismNode);
    rb_cPrismBeginNode = rb_define_class_under(rb_cPrism, "BeginNode", rb_cPrismNode);
    rb_cPrismBlockArgumentNode = rb_define_class_under(rb_cPrism, "BlockArgumentNode", rb_cPrismNode);
    rb_cPrismBlockLocalVariableNode = rb_define_class_under(rb_cPrism, "BlockLocalVariableNode", rb_cPrismNode);
    rb_cPrismBlockNode = rb_define_class_under(rb_cPrism, "BlockNode", rb_cPrismNode);
    rb_cPrismBlockParameterNode = rb_define_class_under(rb_cPrism, "BlockParameterNode", rb_cPrismNode);
    rb_cPrismBlockParametersNode = rb_define_class_under(rb_cPrism, "BlockParametersNode", rb_cPrismNode);
    rb_cPrismBreakNode = rb_define_class_under(rb_cPrism, "BreakNode", rb_cPrismNode);
    rb_cPrismCallAndWriteNode = rb_define_class_under(rb_cPrism, "CallAndWriteNode", rb_cPrismNode);
    rb_cPrismCallNode = rb_define_class_under(rb_cPrism, "CallNode", rb_cPrismNode);
    rb_cPrismCallOperatorWriteNode = rb_define_class_under(rb_cPrism, "CallOperatorWriteNode", rb_cPrismNode);
    rb_cPrismCallOrWriteNode = rb_define_class_under(rb_cPrism, "CallOrWriteNode", rb_cPrismNode);
    rb_cPrismCallTargetNode = rb_define_class_under(rb_cPrism, "CallTargetNode", rb_cPrismNode);
    rb_cPrismCapturePatternNode = rb_define_class_under(rb_cPrism, "CapturePatternNode", rb_cPrismNode);
    rb_cPrismCaseMatchNode = rb_define_class_under(rb_cPrism, "CaseMatchNode", rb_cPrismNode);
    rb_cPrismCaseNode = rb_define_class_under(rb_cPrism, "CaseNode", rb_cPrismNode);
    rb_cPrismClassNode = rb_define_class_under(rb_cPrism, "ClassNode", rb_cPrismNode);
    rb_cPrismClassVariableAndWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableAndWriteNode", rb_cPrismNode);
    rb_cPrismClassVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableOperatorWriteNode", rb_cPrismNode);
    rb_cPrismClassVariableOrWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableOrWriteNode", rb_cPrismNode);
    rb_cPrismClassVariableReadNode = rb_define_class_under(rb_cPrism, "ClassVariableReadNode", rb_cPrismNode);
    rb_cPrismClassVariableTargetNode = rb_define_class_under(rb_cPrism, "ClassVariableTargetNode", rb_cPrismNode);
    rb_cPrismClassVariableWriteNode = rb_define_class_under(rb_cPrism, "ClassVariableWriteNode", rb_cPrismNode);
    rb_cPrismConstantAndWriteNode = rb_define_class_under(rb_cPrism, "ConstantAndWriteNode", rb_cPrismNode);
    rb_cPrismConstantOperatorWriteNode = rb_define_class_under(rb_cPrism, "ConstantOperatorWriteNode", rb_cPrismNode);
    rb_cPrismConstantOrWriteNode = rb_define_class_under(rb_cPrism, "ConstantOrWriteNode", rb_cPrismNode);
    rb_cPrismConstantPathAndWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathAndWriteNode", rb_cPrismNode);
    rb_cPrismConstantPathNode = rb_define_class_under(rb_cPrism, "ConstantPathNode", rb_cPrismNode);
    rb_cPrismConstantPathOperatorWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathOperatorWriteNode", rb_cPrismNode);
    rb_cPrismConstantPathOrWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathOrWriteNode", rb_cPrismNode);
    rb_cPrismConstantPathTargetNode = rb_define_class_under(rb_cPrism, "ConstantPathTargetNode", rb_cPrismNode);
    rb_cPrismConstantPathWriteNode = rb_define_class_under(rb_cPrism, "ConstantPathWriteNode", rb_cPrismNode);
    rb_cPrismConstantReadNode = rb_define_class_under(rb_cPrism, "ConstantReadNode", rb_cPrismNode);
    rb_cPrismConstantTargetNode = rb_define_class_under(rb_cPrism, "ConstantTargetNode", rb_cPrismNode);
    rb_cPrismConstantWriteNode = rb_define_class_under(rb_cPrism, "ConstantWriteNode", rb_cPrismNode);
    rb_cPrismDefNode = rb_define_class_under(rb_cPrism, "DefNode", rb_cPrismNode);
    rb_cPrismDefinedNode = rb_define_class_under(rb_cPrism, "DefinedNode", rb_cPrismNode);
    rb_cPrismElseNode = rb_define_class_under(rb_cPrism, "ElseNode", rb_cPrismNode);
    rb_cPrismEmbeddedStatementsNode = rb_define_class_under(rb_cPrism, "EmbeddedStatementsNode", rb_cPrismNode);
    rb_cPrismEmbeddedVariableNode = rb_define_class_under(rb_cPrism, "EmbeddedVariableNode", rb_cPrismNode);
    rb_cPrismEnsureNode = rb_define_class_under(rb_cPrism, "EnsureNode", rb_cPrismNode);
    rb_cPrismFalseNode = rb_define_class_under(rb_cPrism, "FalseNode", rb_cPrismNode);
    rb_cPrismFindPatternNode = rb_define_class_under(rb_cPrism, "FindPatternNode", rb_cPrismNode);
    rb_cPrismFlipFlopNode = rb_define_class_under(rb_cPrism, "FlipFlopNode", rb_cPrismNode);
    rb_cPrismFloatNode = rb_define_class_under(rb_cPrism, "FloatNode", rb_cPrismNode);
    rb_cPrismForNode = rb_define_class_under(rb_cPrism, "ForNode", rb_cPrismNode);
    rb_cPrismForwardingArgumentsNode = rb_define_class_under(rb_cPrism, "ForwardingArgumentsNode", rb_cPrismNode);
    rb_cPrismForwardingParameterNode = rb_define_class_under(rb_cPrism, "ForwardingParameterNode", rb_cPrismNode);
    rb_cPrismForwardingSuperNode = rb_define_class_under(rb_cPrism, "ForwardingSuperNode", rb_cPrismNode);
    rb_cPrismGlobalVariableAndWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableAndWriteNode", rb_cPrismNode);
    rb_cPrismGlobalVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableOperatorWriteNode", rb_cPrismNode);
    rb_cPrismGlobalVariableOrWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableOrWriteNode", rb_cPrismNode);
    rb_cPrismGlobalVariableReadNode = rb_define_class_under(rb_cPrism, "GlobalVariableReadNode", rb_cPrismNode);
    rb_cPrismGlobalVariableTargetNode = rb_define_class_under(rb_cPrism, "GlobalVariableTargetNode", rb_cPrismNode);
    rb_cPrismGlobalVariableWriteNode = rb_define_class_under(rb_cPrism, "GlobalVariableWriteNode", rb_cPrismNode);
    rb_cPrismHashNode = rb_define_class_under(rb_cPrism, "HashNode", rb_cPrismNode);
    rb_cPrismHashPatternNode = rb_define_class_under(rb_cPrism, "HashPatternNode", rb_cPrismNode);
    rb_cPrismIfNode = rb_define_class_under(rb_cPrism, "IfNode", rb_cPrismNode);
    rb_cPrismImaginaryNode = rb_define_class_under(rb_cPrism, "ImaginaryNode", rb_cPrismNode);
    rb_cPrismImplicitNode = rb_define_class_under(rb_cPrism, "ImplicitNode", rb_cPrismNode);
    rb_cPrismImplicitRestNode = rb_define_class_under(rb_cPrism, "ImplicitRestNode", rb_cPrismNode);
    rb_cPrismInNode = rb_define_class_under(rb_cPrism, "InNode", rb_cPrismNode);
    rb_cPrismIndexAndWriteNode = rb_define_class_under(rb_cPrism, "IndexAndWriteNode", rb_cPrismNode);
    rb_cPrismIndexOperatorWriteNode = rb_define_class_under(rb_cPrism, "IndexOperatorWriteNode", rb_cPrismNode);
    rb_cPrismIndexOrWriteNode = rb_define_class_under(rb_cPrism, "IndexOrWriteNode", rb_cPrismNode);
    rb_cPrismIndexTargetNode = rb_define_class_under(rb_cPrism, "IndexTargetNode", rb_cPrismNode);
    rb_cPrismInstanceVariableAndWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableAndWriteNode", rb_cPrismNode);
    rb_cPrismInstanceVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableOperatorWriteNode", rb_cPrismNode);
    rb_cPrismInstanceVariableOrWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableOrWriteNode", rb_cPrismNode);
    rb_cPrismInstanceVariableReadNode = rb_define_class_under(rb_cPrism, "InstanceVariableReadNode", rb_cPrismNode);
    rb_cPrismInstanceVariableTargetNode = rb_define_class_under(rb_cPrism, "InstanceVariableTargetNode", rb_cPrismNode);
    rb_cPrismInstanceVariableWriteNode = rb_define_class_under(rb_cPrism, "InstanceVariableWriteNode", rb_cPrismNode);
    rb_cPrismIntegerNode = rb_define_class_under(rb_cPrism, "IntegerNode", rb_cPrismNode);
    rb_cPrismInterpolatedMatchLastLineNode = rb_define_class_under(rb_cPrism, "InterpolatedMatchLastLineNode", rb_cPrismNode);
    rb_cPrismInterpolatedRegularExpressionNode = rb_define_class_under(rb_cPrism, "InterpolatedRegularExpressionNode", rb_cPrismNode);
    rb_cPrismInterpolatedStringNode = rb_define_class_under(rb_cPrism, "InterpolatedStringNode", rb_cPrismNode);
    rb_cPrismInterpolatedSymbolNode = rb_define_class_under(rb_cPrism, "InterpolatedSymbolNode", rb_cPrismNode);
    rb_cPrismInterpolatedXStringNode = rb_define_class_under(rb_cPrism, "InterpolatedXStringNode", rb_cPrismNode);
    rb_cPrismKeywordHashNode = rb_define_class_under(rb_cPrism, "KeywordHashNode", rb_cPrismNode);
    rb_cPrismKeywordRestParameterNode = rb_define_class_under(rb_cPrism, "KeywordRestParameterNode", rb_cPrismNode);
    rb_cPrismLambdaNode = rb_define_class_under(rb_cPrism, "LambdaNode", rb_cPrismNode);
    rb_cPrismLocalVariableAndWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableAndWriteNode", rb_cPrismNode);
    rb_cPrismLocalVariableOperatorWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableOperatorWriteNode", rb_cPrismNode);
    rb_cPrismLocalVariableOrWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableOrWriteNode", rb_cPrismNode);
    rb_cPrismLocalVariableReadNode = rb_define_class_under(rb_cPrism, "LocalVariableReadNode", rb_cPrismNode);
    rb_cPrismLocalVariableTargetNode = rb_define_class_under(rb_cPrism, "LocalVariableTargetNode", rb_cPrismNode);
    rb_cPrismLocalVariableWriteNode = rb_define_class_under(rb_cPrism, "LocalVariableWriteNode", rb_cPrismNode);
    rb_cPrismMatchLastLineNode = rb_define_class_under(rb_cPrism, "MatchLastLineNode", rb_cPrismNode);
    rb_cPrismMatchPredicateNode = rb_define_class_under(rb_cPrism, "MatchPredicateNode", rb_cPrismNode);
    rb_cPrismMatchRequiredNode = rb_define_class_under(rb_cPrism, "MatchRequiredNode", rb_cPrismNode);
    rb_cPrismMatchWriteNode = rb_define_class_under(rb_cPrism, "MatchWriteNode", rb_cPrismNode);
    rb_cPrismMissingNode = rb_define_class_under(rb_cPrism, "MissingNode", rb_cPrismNode);
    rb_cPrismModuleNode = rb_define_class_under(rb_cPrism, "ModuleNode", rb_cPrismNode);
    rb_cPrismMultiTargetNode = rb_define_class_under(rb_cPrism, "MultiTargetNode", rb_cPrismNode);
    rb_cPrismMultiWriteNode = rb_define_class_under(rb_cPrism, "MultiWriteNode", rb_cPrismNode);
    rb_cPrismNextNode = rb_define_class_under(rb_cPrism, "NextNode", rb_cPrismNode);
    rb_cPrismNilNode = rb_define_class_under(rb_cPrism, "NilNode", rb_cPrismNode);
    rb_cPrismNoKeywordsParameterNode = rb_define_class_under(rb_cPrism, "NoKeywordsParameterNode", rb_cPrismNode);
    rb_cPrismNumberedParametersNode = rb_define_class_under(rb_cPrism, "NumberedParametersNode", rb_cPrismNode);
    rb_cPrismNumberedReferenceReadNode = rb_define_class_under(rb_cPrism, "NumberedReferenceReadNode", rb_cPrismNode);
    rb_cPrismOptionalKeywordParameterNode = rb_define_class_under(rb_cPrism, "OptionalKeywordParameterNode", rb_cPrismNode);
    rb_cPrismOptionalParameterNode = rb_define_class_under(rb_cPrism, "OptionalParameterNode", rb_cPrismNode);
    rb_cPrismOrNode = rb_define_class_under(rb_cPrism, "OrNode", rb_cPrismNode);
    rb_cPrismParametersNode = rb_define_class_under(rb_cPrism, "ParametersNode", rb_cPrismNode);
    rb_cPrismParenthesesNode = rb_define_class_under(rb_cPrism, "ParenthesesNode", rb_cPrismNode);
    rb_cPrismPinnedExpressionNode = rb_define_class_under(rb_cPrism, "PinnedExpressionNode", rb_cPrismNode);
    rb_cPrismPinnedVariableNode = rb_define_class_under(rb_cPrism, "PinnedVariableNode", rb_cPrismNode);
    rb_cPrismPostExecutionNode = rb_define_class_under(rb_cPrism, "PostExecutionNode", rb_cPrismNode);
    rb_cPrismPreExecutionNode = rb_define_class_under(rb_cPrism, "PreExecutionNode", rb_cPrismNode);
    rb_cPrismProgramNode = rb_define_class_under(rb_cPrism, "ProgramNode", rb_cPrismNode);
    rb_cPrismRangeNode = rb_define_class_under(rb_cPrism, "RangeNode", rb_cPrismNode);
    rb_cPrismRationalNode = rb_define_class_under(rb_cPrism, "RationalNode", rb_cPrismNode);
    rb_cPrismRedoNode = rb_define_class_under(rb_cPrism, "RedoNode", rb_cPrismNode);
    rb_cPrismRegularExpressionNode = rb_define_class_under(rb_cPrism, "RegularExpressionNode", rb_cPrismNode);
    rb_cPrismRequiredKeywordParameterNode = rb_define_class_under(rb_cPrism, "RequiredKeywordParameterNode", rb_cPrismNode);
    rb_cPrismRequiredParameterNode = rb_define_class_under(rb_cPrism, "RequiredParameterNode", rb_cPrismNode);
    rb_cPrismRescueModifierNode = rb_define_class_under(rb_cPrism, "RescueModifierNode", rb_cPrismNode);
    rb_cPrismRescueNode = rb_define_class_under(rb_cPrism, "RescueNode", rb_cPrismNode);
    rb_cPrismRestParameterNode = rb_define_class_under(rb_cPrism, "RestParameterNode", rb_cPrismNode);
    rb_cPrismRetryNode = rb_define_class_under(rb_cPrism, "RetryNode", rb_cPrismNode);
    rb_cPrismReturnNode = rb_define_class_under(rb_cPrism, "ReturnNode", rb_cPrismNode);
    rb_cPrismSelfNode = rb_define_class_under(rb_cPrism, "SelfNode", rb_cPrismNode);
    rb_cPrismSingletonClassNode = rb_define_class_under(rb_cPrism, "SingletonClassNode", rb_cPrismNode);
    rb_cPrismSourceEncodingNode = rb_define_class_under(rb_cPrism, "SourceEncodingNode", rb_cPrismNode);
    rb_cPrismSourceFileNode = rb_define_class_under(rb_cPrism, "SourceFileNode", rb_cPrismNode);
    rb_cPrismSourceLineNode = rb_define_class_under(rb_cPrism, "SourceLineNode", rb_cPrismNode);
    rb_cPrismSplatNode = rb_define_class_under(rb_cPrism, "SplatNode", rb_cPrismNode);
    rb_cPrismStatementsNode = rb_define_class_under(rb_cPrism, "StatementsNode", rb_cPrismNode);
    rb_cPrismStringNode = rb_define_class_under(rb_cPrism, "StringNode", rb_cPrismNode);
    rb_cPrismSuperNode = rb_define_class_under(rb_cPrism, "SuperNode", rb_cPrismNode);
    rb_cPrismSymbolNode = rb_define_class_under(rb_cPrism, "SymbolNode", rb_cPrismNode);
    rb_cPrismTrueNode = rb_define_class_under(rb_cPrism, "TrueNode", rb_cPrismNode);
    rb_cPrismUndefNode = rb_define_class_under(rb_cPrism, "UndefNode", rb_cPrismNode);
    rb_cPrismUnlessNode = rb_define_class_under(rb_cPrism, "UnlessNode", rb_cPrismNode);
    rb_cPrismUntilNode = rb_define_class_under(rb_cPrism, "UntilNode", rb_cPrismNode);
    rb_cPrismWhenNode = rb_define_class_under(rb_cPrism, "WhenNode", rb_cPrismNode);
    rb_cPrismWhileNode = rb_define_class_under(rb_cPrism, "WhileNode", rb_cPrismNode);
    rb_cPrismXStringNode = rb_define_class_under(rb_cPrism, "XStringNode", rb_cPrismNode);
    rb_cPrismYieldNode = rb_define_class_under(rb_cPrism, "YieldNode", rb_cPrismNode);
}
