-// Parser functions
-
-RET parse_document(PARAMS);
-RET parse_definition(PARAMS);
-RET parse_executable_document(PARAMS);
-RET parse_executable_definition(PARAMS);
-RET parse_operation_definition(PARAMS);
-RET parse_operation_type(PARAMS);
-RET parse_selection_set(PARAMS);
-RET parse_selection(PARAMS);
-RET parse_field(PARAMS);
-RET parse_arguments(PARAMS);
-RET parse_argument(PARAMS);
-RET parse_alias(PARAMS);
-RET parse_fragment_spread(PARAMS);
-RET parse_fragment_definition(PARAMS);
-RET parse_fragment_name(PARAMS);
-RET parse_type_condition(PARAMS);
-RET parse_inline_fragment(PARAMS);
-RET parse_value(PARAMS);
-RET parse_int_value(PARAMS);
-RET parse_negative_sign(PARAMS);
-RET parse_non_zero_digit(PARAMS);
-RET parse_float_value(PARAMS);
-RET parse_boolean_value(PARAMS);
-RET parse_string_value(PARAMS);
-RET parse_string_character(PARAMS);
-RET parse_escaped_unicode(PARAMS);
-RET parse_escaped_character(PARAMS);
-RET parse_block_string_character(PARAMS);
-RET parse_null_value(PARAMS);
-RET parse_enum_value(PARAMS);
-RET parse_list_value(PARAMS);
-RET parse_object_value(PARAMS);
-RET parse_object_field(PARAMS);
-RET parse_variable(PARAMS);
-RET parse_variable_definitions(PARAMS);
-RET parse_variable_definition(PARAMS);
-RET parse_default_value(PARAMS);
-RET parse_type(PARAMS);
-RET parse_named_type(PARAMS);
-RET parse_list_type(PARAMS);
-RET parse_non_null_type(PARAMS);
-RET parse_non_null_type_1(PARAMS);
-RET parse_non_null_type_2(PARAMS);
-RET parse_directives(PARAMS);
-RET parse_directive(PARAMS);
-RET parse_type_system_document(PARAMS);
-RET parse_type_system_definition(PARAMS);
-RET parse_type_system_extension_document(PARAMS);
-RET parse_type_system_definition_or_extension(PARAMS);
-RET parse_type_system_extension(PARAMS);
-RET parse_description(PARAMS);
-RET parse_schema_definition(PARAMS);
-RET parse_root_operation_type_definition(PARAMS);
-RET parse_schema_extension(PARAMS);
-RET parse_type_definition(PARAMS);
-RET parse_type_extension(PARAMS);
-RET parse_scalar_type_definition(PARAMS);
-RET parse_scalar_type_extension(PARAMS);
-RET parse_object_type_definition(PARAMS);
-RET parse_implements_interfaces(PARAMS);
-RET parse_fields_definition(PARAMS);
-RET parse_field_definition(PARAMS);
-RET parse_arguments_definition(PARAMS);
-RET parse_input_value_definition(PARAMS);
-RET parse_object_type_extension(PARAMS);
-RET parse_interface_type_definition(PARAMS);
-RET parse_interface_type_extension(PARAMS);
-RET parse_union_type_definition(PARAMS);
-RET parse_union_member_types(PARAMS);
-RET parse_union_type_extension(PARAMS);
-RET parse_enum_type_definition(PARAMS);
-RET parse_enum_values_definition(PARAMS);
-RET parse_enum_value_definition(PARAMS);
-RET parse_enum_type_extension(PARAMS);
-RET parse_input_object_type_definition(PARAMS);
-RET parse_input_fields_definition(PARAMS);
-RET parse_directive_definition(PARAMS);
-RET parse_directive_locations(PARAMS);
-RET parse_directive_location(PARAMS);
-RET parse_executable_directive_location(PARAMS);
-RET parse_type_system_directive_location(PARAMS);
-
-RET parse_keyword(PARAMS, const char *keyword, const char *errmsg);
-RET parse_punct(PARAMS, int punct);
-RET parse_name(PARAMS);
-RET parse_int(PARAMS);
-RET parse_float(PARAMS);
-RET parse_string(PARAMS);
-
-// Convert input string into AST.
-const char *graphql_lexparse(const char *input, const tal_t *ctx, struct list_head **tokens, struct graphql_executable_document **doc) {
- const char *err = graphql_lex(input, ctx, tokens);
- if (!err)
- err = graphql_parse(*tokens, doc);
- return err;
-}
-
-// Convert lexed tokens into AST.
-const char *graphql_parse(struct list_head *tokens, struct graphql_executable_document **doc) {
- struct list_head used = LIST_HEAD_INIT(used);
- const char *err = NULL;
- *doc = parse_executable_document(tokens, &used, &err);
- return err;
-}
-
-/* The following parser functions follow special rules: