diff --git a/GraphQLParser.cpp b/GraphQLParser.cpp index 9da6923..9f1ebbd 100644 --- a/GraphQLParser.cpp +++ b/GraphQLParser.cpp @@ -20,36 +20,56 @@ namespace graphql { // Given properly-configured yylex, run the parser and return the // result. -static std::unique_ptr doParse(const char **outError, yyscan_t scanner) { +static std::unique_ptr doParse(const char **outError, yyscan_t scanner, bool enableSchema) { Node *outAST; - yy::GraphQLParserImpl parser(&outAST, outError, scanner); + yy::GraphQLParserImpl parser(enableSchema, &outAST, outError, scanner); int failure = parser.parse(); return !failure ? std::unique_ptr(outAST) : nullptr; } -std::unique_ptr parseString(const char *text, const char **error) { +static std::unique_ptr parseStringImpl(const char *text, const char **error, bool enableSchema) { yyscan_t scanner; struct LexerExtra extra; yylex_init_extra(&extra, &scanner); YY_BUFFER_STATE buffer = yy_scan_string(text, scanner); yy_switch_to_buffer(buffer, scanner); - auto result = doParse(error, scanner); + auto result = doParse(error, scanner, enableSchema); yylex_destroy(scanner); return result; } -std::unique_ptr parseFile(FILE *file, const char **error) { +std::unique_ptr parseString(const char *text, const char **error) { + return parseStringImpl(text, error, false); +} + +std::unique_ptr parseStringWithExperimentalSchemaSupport( + const char *text, const char **error) { + return parseStringImpl(text, error, true); +} + +static std::unique_ptr parseFileImpl( + FILE *file, const char **error, bool enableSchema) { yyscan_t scanner; struct LexerExtra extra; yylex_init_extra(&extra, &scanner); yyset_in(file, scanner); - auto result = doParse(error, scanner); + auto result = doParse(error, scanner, enableSchema); yylex_destroy(scanner); return result; } +std::unique_ptr parseFile(FILE *file, const char **error) { + return parseFileImpl(file, error, false); +} + +std::unique_ptr parseFileWithExperimentalSchemaSupport( + FILE *file, const char **error) { + return parseFileImpl(file, error, true); +} + + } } diff --git a/GraphQLParser.h b/GraphQLParser.h index 2a2d5d5..7b02c0a 100644 --- a/GraphQLParser.h +++ b/GraphQLParser.h @@ -32,6 +32,13 @@ namespace ast { */ std::unique_ptr parseString(const char *text, const char **error); +/** + * Like parseString, but enables support for the experimental type + * definition syntax from https://github.com/facebook/graphql/pull/90 . + */ +std::unique_ptr parseStringWithExperimentalSchemaSupport( + const char *text, const char **error); + /** * Read and parse GraphQL source from the given file, returning an * AST. Returns nullptr on error and, if error is not null, places an @@ -39,5 +46,12 @@ std::unique_ptr parseString(const char *text, const char **error); */ std::unique_ptr parseFile(FILE *file, const char **error); +/** + * Like parseFile, but enables support for the experimental type + * definition syntax from https://github.com/facebook/graphql/pull/90 . + */ +std::unique_ptr parseFileWithExperimentalSchemaSupport( + FILE *file, const char **error); + } } diff --git a/ast/ast.ast b/ast/ast.ast index c54fa58..2626b3f 100644 --- a/ast/ast.ast +++ b/ast/ast.ast @@ -7,10 +7,23 @@ # O for option in a union. # Scalar type ontology: string, boolean -# Location tracking for Identifier is probably useful for error messages. +# Definitions other than OperationDefinition and FragmentDefinition +# are experimental additions for schema parsing. (We don't support +# nested unions in the AST mini-language, so I've flattened and elided +# TypeSystemDefinition and TypeDefinition.) U Definition O OperationDefinition O FragmentDefinition +O SchemaDefinition +O ScalarTypeDefinition +O ObjectTypeDefinition +O InterfaceTypeDefinition +O UnionTypeDefinition +O EnumTypeDefinition +O InputObjectTypeDefinition +O TypeExtensionDefinition +O DirectiveDefinition + T Document P Definition definitions @@ -124,3 +137,65 @@ S Type type T Name S string value + +T SchemaDefinition +P? Directive directives +P OperationTypeDefinition operationTypes + +T OperationTypeDefinition +S OperationKind operation +S NamedType type + +T ScalarTypeDefinition +S Name name +P? Directive directives + +T ObjectTypeDefinition +S Name name +P? NamedType interfaces +P? Directive directives +P FieldDefinition fields + +T FieldDefinition +S Name name +P? InputValueDefinition arguments +S Type type +P? Directive directives + +T InputValueDefinition +S Name name +S Type type +S? Value defaultValue +P? Directive directives + +T InterfaceTypeDefinition +S Name name +P? Directive directives +P FieldDefinition fields + +T UnionTypeDefinition +S Name name +P? Directive directives +P NamedType types + +T EnumTypeDefinition +S Name name +P? Directive directives +P EnumValueDefinition values + +T EnumValueDefinition +S Name name +P? Directive directives + +T InputObjectTypeDefinition +S Name name +P? Directive directives +P InputValueDefinition fields + +T TypeExtensionDefinition +S ObjectTypeDefinition definition + +T DirectiveDefinition +S Name name +P? InputValueDefinition arguments +P Name locations diff --git a/c/GraphQLParser.cpp b/c/GraphQLParser.cpp index 871a5f9..2781045 100644 --- a/c/GraphQLParser.cpp +++ b/c/GraphQLParser.cpp @@ -17,10 +17,21 @@ struct GraphQLAstNode *graphql_parse_string(const char *text, const char **error return (struct GraphQLAstNode *)facebook::graphql::parseString(text, error).release(); } +struct GraphQLAstNode *graphql_parse_string_with_experimental_schema_support( + const char *text, const char **error) { + return (struct GraphQLAstNode *)facebook::graphql::parseStringWithExperimentalSchemaSupport( + text, error).release(); +} + struct GraphQLAstNode *graphql_parse_file(FILE *file, const char **error) { return (struct GraphQLAstNode *)facebook::graphql::parseFile(file, error).release(); } +struct GraphQLAstNode *graphql_parse_file_with_experimental_schema_support( + FILE *file, const char **error) { + return (struct GraphQLAstNode *)facebook::graphql::parseFileWithExperimentalSchemaSupport(file, error).release(); +} + void graphql_error_free(const char *error) { std::free((void *)error); } diff --git a/c/GraphQLParser.h b/c/GraphQLParser.h index 54cb334..c4206ee 100644 --- a/c/GraphQLParser.h +++ b/c/GraphQLParser.h @@ -28,8 +28,11 @@ struct GraphQLAstNode; * error message is placed in error and must be freed with * graphql_error_free(). */ -struct GraphQLAstNode *graphql_parse_string(const char *text, - const char **error); +struct GraphQLAstNode *graphql_parse_string( + const char *text, const char **error); + +struct GraphQLAstNode *graphql_parse_string_with_experimental_schema_support( + const char *text, const char **error); /** * Read and parse GraphQL source from the given file, returning an @@ -40,6 +43,9 @@ struct GraphQLAstNode *graphql_parse_string(const char *text, */ struct GraphQLAstNode *graphql_parse_file(FILE *file, const char **error); +struct GraphQLAstNode *graphql_parse_file_with_experimental_schema_support( + FILE *file, const char **error); + /** * Frees an error. */ diff --git a/lexer.cpp b/lexer.cpp index 590b593..6eae313 100644 --- a/lexer.cpp +++ b/lexer.cpp @@ -333,8 +333,8 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner ); yyg->yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 49 -#define YY_END_OF_BUFFER 50 +#define YY_NUM_RULES 59 +#define YY_END_OF_BUFFER 60 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -342,22 +342,28 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[127] = +static const flex_int16_t yy_accept[183] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 50, 48, - 18, 21, 21, 35, 47, 22, 48, 36, 37, 48, - 48, 31, 31, 39, 40, 41, 33, 42, 43, 33, - 33, 33, 33, 33, 33, 33, 44, 45, 46, 48, - 2, 2, 3, 1, 48, 49, 17, 16, 16, 18, - 21, 20, 34, 31, 31, 0, 0, 0, 31, 33, - 33, 33, 33, 33, 27, 33, 33, 33, 0, 3, - 14, 4, 6, 5, 10, 11, 7, 9, 8, 13, - 17, 15, 21, 38, 32, 0, 32, 33, 33, 33, - 33, 33, 33, 33, 19, 0, 33, 33, 33, 26, - - 33, 33, 30, 0, 0, 23, 33, 33, 28, 33, - 0, 33, 33, 33, 12, 33, 33, 33, 24, 25, - 33, 33, 33, 33, 29, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 60, 58, + 18, 21, 21, 45, 57, 22, 58, 46, 47, 58, + 58, 41, 41, 49, 50, 51, 43, 52, 53, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 54, 55, 56, 58, 2, 2, 3, 1, 58, 59, + 17, 16, 16, 18, 21, 20, 44, 41, 41, 0, + 0, 0, 41, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 33, 43, 43, 43, 43, 43, 43, + 0, 3, 14, 4, 6, 5, 10, 11, 7, 9, + 8, 13, 17, 15, 21, 48, 42, 0, 42, 43, + + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 19, 0, 43, 24, + 43, 43, 43, 43, 43, 43, 43, 32, 43, 43, + 43, 43, 38, 39, 43, 0, 0, 43, 43, 26, + 43, 43, 29, 43, 43, 34, 43, 43, 43, 40, + 0, 43, 25, 43, 43, 43, 43, 35, 36, 43, + 12, 43, 43, 43, 43, 43, 43, 43, 27, 43, + 43, 31, 43, 23, 43, 30, 43, 28, 43, 43, + 37, 0 } ; static const YY_CHAR yy_ec[256] = @@ -371,139 +377,167 @@ static const YY_CHAR yy_ec[256] = 20, 10, 10, 21, 22, 22, 22, 22, 23, 22, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 25, 26, 27, 10, 24, 10, 28, 29, 30, 22, + 25, 26, 27, 10, 24, 10, 28, 29, 30, 31, - 31, 32, 33, 24, 34, 24, 24, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 24, 24, 24, - 45, 24, 46, 47, 48, 10, 10, 10, 10, 10, + 32, 33, 34, 35, 36, 24, 24, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 24, 48, + 49, 24, 50, 51, 52, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 49, 10, 10, 10, - 50, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 53, 10, 10, 10, + 54, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 51, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 55, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 } ; -static const YY_CHAR yy_meta[52] = +static const YY_CHAR yy_meta[56] = { 0, 1, 1, 2, 3, 4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 5, 5, 6, 4, 1, 4, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 4, 4, 4, 4, 4, - 4 + 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, + 4, 4, 4, 4, 4 } ; -static const flex_int16_t yy_base[139] = +static const flex_int16_t yy_base[195] = { 0, - 0, 0, 51, 58, 0, 0, 53, 60, 213, 214, - 64, 64, 67, 214, 214, 214, 0, 214, 214, 55, - 197, 59, 63, 214, 214, 214, 0, 214, 214, 47, - 167, 166, 172, 164, 163, 165, 214, 214, 214, 156, - 214, 214, 0, 214, 88, 214, 0, 214, 201, 74, - 88, 93, 0, 70, 85, 188, 81, 92, 104, 0, - 167, 173, 157, 164, 0, 167, 168, 152, 145, 0, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 0, - 0, 214, 108, 214, 116, 106, 119, 152, 160, 164, - 156, 149, 147, 157, 136, 0, 155, 149, 138, 0, - - 135, 144, 0, 97, 0, 0, 114, 110, 0, 102, - 0, 105, 103, 106, 214, 95, 93, 89, 0, 0, - 83, 84, 77, 76, 0, 214, 147, 153, 159, 161, - 163, 166, 172, 178, 102, 84, 82, 78 + 0, 0, 55, 62, 0, 0, 57, 64, 269, 270, + 68, 68, 71, 270, 270, 270, 0, 270, 270, 59, + 253, 63, 67, 270, 270, 270, 0, 270, 270, 231, + 41, 51, 53, 220, 219, 225, 217, 57, 53, 223, + 270, 270, 270, 208, 270, 270, 0, 270, 97, 270, + 0, 270, 257, 95, 102, 104, 0, 78, 97, 244, + 99, 114, 129, 0, 215, 211, 211, 218, 226, 212, + 77, 207, 214, 0, 218, 106, 220, 202, 206, 210, + 191, 0, 270, 270, 270, 270, 270, 270, 270, 270, + 270, 0, 0, 270, 121, 270, 131, 120, 133, 212, + + 205, 210, 197, 206, 202, 192, 205, 208, 198, 191, + 196, 200, 187, 198, 197, 188, 172, 0, 196, 0, + 186, 192, 185, 190, 176, 177, 174, 0, 169, 189, + 178, 185, 0, 0, 175, 160, 0, 167, 180, 0, + 178, 171, 0, 175, 171, 0, 163, 177, 161, 0, + 0, 167, 0, 163, 169, 169, 156, 0, 0, 154, + 270, 115, 115, 120, 128, 118, 115, 123, 0, 108, + 113, 0, 94, 0, 91, 0, 97, 0, 81, 80, + 0, 270, 163, 169, 175, 177, 179, 182, 188, 194, + 106, 104, 93, 78 + } ; -static const flex_int16_t yy_def[139] = +static const flex_int16_t yy_def[195] = { 0, - 126, 1, 127, 127, 128, 128, 129, 129, 126, 126, - 126, 126, 126, 126, 126, 126, 130, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 131, 126, 126, 131, - 131, 131, 131, 131, 131, 131, 126, 126, 126, 126, - 126, 126, 132, 126, 133, 126, 134, 126, 126, 126, - 126, 126, 130, 126, 126, 126, 126, 126, 126, 131, - 131, 131, 131, 131, 131, 131, 131, 131, 126, 132, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 135, - 134, 126, 126, 126, 126, 126, 126, 131, 131, 131, - 131, 131, 131, 131, 126, 136, 131, 131, 131, 131, - - 131, 131, 131, 126, 137, 131, 131, 131, 131, 131, - 138, 131, 131, 131, 126, 131, 131, 131, 131, 131, - 131, 131, 131, 131, 131, 0, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126 + 182, 1, 183, 183, 184, 184, 185, 185, 182, 182, + 182, 182, 182, 182, 182, 182, 186, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 187, 182, 182, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 182, 182, 182, 182, 182, 182, 188, 182, 189, 182, + 190, 182, 182, 182, 182, 182, 186, 182, 182, 182, + 182, 182, 182, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 182, 188, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 191, 190, 182, 182, 182, 182, 182, 182, 187, + + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 182, 192, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 182, 193, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 194, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 182, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 187, 0, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182 + } ; -static const flex_int16_t yy_nxt[266] = +static const flex_int16_t yy_nxt[326] = { 0, 10, 11, 12, 13, 11, 14, 15, 16, 17, 10, 18, 19, 10, 20, 21, 10, 22, 23, 24, 25, 26, 27, 27, 27, 28, 10, 29, 27, 27, 27, - 27, 30, 27, 27, 27, 31, 32, 33, 27, 34, - 27, 35, 36, 27, 27, 37, 38, 39, 10, 10, - 40, 10, 10, 41, 42, 48, 49, 44, 10, 10, - 41, 42, 48, 49, 44, 50, 51, 51, 50, 52, - 51, 54, 55, 57, 61, 50, 45, 57, 50, 59, - 59, 58, 115, 45, 57, 58, 111, 62, 105, 58, - 51, 51, 58, 58, 72, 51, 83, 85, 85, 57, - - 58, 59, 59, 73, 86, 86, 96, 58, 87, 87, - 52, 51, 125, 74, 124, 58, 75, 123, 57, 76, - 59, 59, 87, 87, 77, 122, 58, 121, 78, 120, - 79, 80, 85, 85, 58, 87, 87, 119, 58, 118, - 117, 116, 114, 113, 112, 69, 58, 43, 43, 43, - 43, 43, 43, 46, 46, 46, 46, 46, 46, 47, - 47, 47, 47, 47, 47, 53, 53, 60, 60, 70, - 70, 70, 71, 110, 71, 71, 71, 71, 81, 109, - 108, 81, 81, 81, 107, 106, 104, 103, 102, 101, - 100, 99, 98, 97, 95, 94, 93, 92, 91, 90, - - 89, 88, 84, 82, 69, 68, 67, 66, 65, 64, - 63, 56, 126, 9, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126 + 30, 31, 32, 27, 27, 33, 27, 34, 35, 36, + 27, 37, 27, 38, 39, 40, 27, 27, 27, 41, + 42, 43, 10, 10, 44, 10, 10, 45, 46, 52, + 53, 48, 10, 10, 45, 46, 52, 53, 48, 54, + 55, 55, 54, 56, 55, 58, 59, 61, 68, 66, + 49, 61, 161, 63, 63, 62, 76, 49, 67, 62, + 70, 71, 61, 69, 62, 78, 54, 151, 62, 54, + + 62, 79, 77, 84, 55, 55, 55, 95, 137, 62, + 118, 61, 85, 63, 63, 97, 97, 106, 181, 62, + 180, 107, 86, 56, 55, 87, 98, 98, 62, 88, + 99, 99, 179, 111, 178, 89, 99, 99, 177, 90, + 112, 91, 92, 61, 176, 63, 63, 97, 97, 99, + 99, 62, 175, 62, 174, 173, 172, 171, 170, 169, + 62, 168, 62, 47, 47, 47, 47, 47, 47, 50, + 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, + 51, 57, 57, 64, 64, 82, 82, 82, 83, 167, + 83, 83, 83, 83, 93, 166, 165, 93, 93, 93, + + 164, 163, 162, 160, 159, 158, 157, 156, 155, 154, + 153, 152, 81, 150, 149, 148, 147, 146, 145, 144, + 143, 142, 141, 140, 139, 138, 136, 135, 134, 133, + 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, + 122, 121, 120, 119, 117, 116, 115, 114, 113, 110, + 109, 108, 105, 104, 103, 102, 101, 100, 96, 94, + 81, 80, 75, 74, 73, 72, 65, 60, 182, 9, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182 } ; -static const flex_int16_t yy_chk[266] = +static const flex_int16_t yy_chk[326] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 3, 3, 7, 7, 3, 4, 4, - 4, 4, 8, 8, 4, 11, 12, 12, 11, 13, - 13, 20, 20, 22, 30, 50, 3, 23, 50, 23, - 23, 22, 138, 4, 54, 23, 137, 30, 136, 22, - 51, 51, 54, 23, 45, 52, 52, 57, 57, 55, - - 54, 55, 55, 45, 58, 58, 135, 55, 58, 58, - 83, 83, 124, 45, 123, 55, 45, 122, 59, 45, - 59, 59, 86, 86, 45, 121, 59, 118, 45, 117, - 45, 45, 85, 85, 59, 87, 87, 116, 85, 114, - 113, 112, 110, 108, 107, 104, 85, 127, 127, 127, - 127, 127, 127, 128, 128, 128, 128, 128, 128, 129, - 129, 129, 129, 129, 129, 130, 130, 131, 131, 132, - 132, 132, 133, 102, 133, 133, 133, 133, 134, 101, - 99, 134, 134, 134, 98, 97, 95, 94, 93, 92, - 91, 90, 89, 88, 69, 68, 67, 66, 64, 63, - - 62, 61, 56, 49, 40, 36, 35, 34, 33, 32, - 31, 21, 9, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126 + 1, 1, 1, 1, 1, 3, 3, 3, 3, 7, + 7, 3, 4, 4, 4, 4, 8, 8, 4, 11, + 12, 12, 11, 13, 13, 20, 20, 22, 32, 31, + 3, 23, 194, 23, 23, 22, 38, 4, 31, 23, + 33, 33, 58, 32, 22, 39, 54, 193, 23, 54, + + 58, 39, 38, 49, 55, 55, 56, 56, 192, 58, + 191, 59, 49, 59, 59, 61, 61, 71, 180, 59, + 179, 71, 49, 95, 95, 49, 62, 62, 59, 49, + 62, 62, 177, 76, 175, 49, 98, 98, 173, 49, + 76, 49, 49, 63, 171, 63, 63, 97, 97, 99, + 99, 63, 170, 97, 168, 167, 166, 165, 164, 163, + 63, 162, 97, 183, 183, 183, 183, 183, 183, 184, + 184, 184, 184, 184, 184, 185, 185, 185, 185, 185, + 185, 186, 186, 187, 187, 188, 188, 188, 189, 160, + 189, 189, 189, 189, 190, 157, 156, 190, 190, 190, + + 155, 154, 152, 149, 148, 147, 145, 144, 142, 141, + 139, 138, 136, 135, 132, 131, 130, 129, 127, 126, + 125, 124, 123, 122, 121, 119, 117, 116, 115, 114, + 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, + 103, 102, 101, 100, 81, 80, 79, 78, 77, 75, + 73, 72, 70, 69, 68, 67, 66, 65, 60, 53, + 44, 40, 37, 36, 35, 34, 30, 21, 9, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182 } ; /* The intent behind this definition is that it'll catch @@ -537,10 +571,10 @@ static const flex_int16_t yy_chk[266] = static void escape(char c, char *buf); -#line 540 "lexer.cpp" +#line 574 "lexer.cpp" #define YY_NO_INPUT 1 -#line 543 "lexer.cpp" +#line 577 "lexer.cpp" #define INITIAL 0 #define STRING_STATE 1 @@ -831,7 +865,7 @@ YY_DECL yyextra->loc.step(); -#line 834 "lexer.cpp" +#line 868 "lexer.cpp" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -858,13 +892,13 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 127 ) + if ( yy_current_state >= 183 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_current_state != 126 ); + while ( yy_current_state != 182 ); yy_cp = yyg->yy_last_accepting_cpos; yy_current_state = yyg->yy_last_accepting_state; @@ -1028,139 +1062,189 @@ YY_RULE_SETUP case 23: YY_RULE_SETUP #line 113 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FALSE; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_DIRECTIVE; } YY_BREAK case 24: YY_RULE_SETUP #line 114 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FRAGMENT; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ENUM; } YY_BREAK case 25: YY_RULE_SETUP #line 115 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_MUTATION; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_EXTEND; } YY_BREAK case 26: YY_RULE_SETUP #line 116 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_NULL; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FALSE; } YY_BREAK case 27: YY_RULE_SETUP #line 117 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ON; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FRAGMENT; } YY_BREAK case 28: YY_RULE_SETUP #line 118 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_QUERY; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_IMPLEMENTS; } YY_BREAK case 29: YY_RULE_SETUP #line 119 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SUBSCRIPTION; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INPUT; } YY_BREAK case 30: YY_RULE_SETUP #line 120 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_TRUE; } +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INTERFACE; } YY_BREAK case 31: YY_RULE_SETUP -#line 122 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INTEGER; } +#line 121 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_MUTATION; } YY_BREAK case 32: YY_RULE_SETUP -#line 123 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FLOAT; } +#line 122 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_NULL; } YY_BREAK case 33: YY_RULE_SETUP -#line 124 "lexer.lpp" -{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_IDENTIFIER; } +#line 123 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ON; } YY_BREAK case 34: YY_RULE_SETUP -#line 125 "lexer.lpp" -{ yylval->str = yytext + 1; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_VARIABLE; } +#line 124 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_QUERY; } YY_BREAK case 35: YY_RULE_SETUP -#line 127 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_BANG; } +#line 125 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SCALAR; } YY_BREAK case 36: YY_RULE_SETUP -#line 128 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_LPAREN; } +#line 126 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SCHEMA; } YY_BREAK case 37: YY_RULE_SETUP -#line 129 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_RPAREN; } +#line 127 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SUBSCRIPTION; } YY_BREAK case 38: YY_RULE_SETUP -#line 130 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ELLIPSIS; } +#line 128 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_TRUE; } YY_BREAK case 39: YY_RULE_SETUP -#line 131 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_COLON; } +#line 129 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_TYPE; } YY_BREAK case 40: YY_RULE_SETUP -#line 132 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_EQUAL; } +#line 130 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_UNION; } YY_BREAK case 41: YY_RULE_SETUP -#line 133 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_AT; } +#line 132 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INTEGER; } YY_BREAK case 42: YY_RULE_SETUP -#line 134 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_LBRACKET; } +#line 133 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FLOAT; } YY_BREAK case 43: YY_RULE_SETUP -#line 135 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_RBRACKET; } +#line 134 "lexer.lpp" +{ yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_IDENTIFIER; } YY_BREAK case 44: YY_RULE_SETUP -#line 136 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_LBRACE; } +#line 135 "lexer.lpp" +{ yylval->str = yytext + 1; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_VARIABLE; } YY_BREAK case 45: YY_RULE_SETUP #line 137 "lexer.lpp" -{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_PIPE; } +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_BANG; } YY_BREAK case 46: YY_RULE_SETUP #line 138 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_LPAREN; } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 139 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_RPAREN; } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 140 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ELLIPSIS; } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 141 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_COLON; } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 142 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_EQUAL; } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 143 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_AT; } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 144 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_LBRACKET; } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 145 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_RBRACKET; } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 146 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_LBRACE; } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 147 "lexer.lpp" +{ *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_PIPE; } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 148 "lexer.lpp" { *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_RBRACE; } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 141 "lexer.lpp" +#line 151 "lexer.lpp" { *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_EOF; } YY_BREAK -case 47: +case 57: YY_RULE_SETUP -#line 143 "lexer.lpp" +#line 153 "lexer.lpp" { BEGIN(STRING_STATE); yyextra->str.clear(); } YY_BREAK -case 48: +case 58: YY_RULE_SETUP -#line 149 "lexer.lpp" +#line 159 "lexer.lpp" { char buf[6]; escape(yytext[0], buf); @@ -1169,12 +1253,12 @@ YY_RULE_SETUP std::string("unrecognized character ") + buf); } YY_BREAK -case 49: +case 59: YY_RULE_SETUP -#line 157 "lexer.lpp" +#line 167 "lexer.lpp" ECHO; YY_BREAK -#line 1177 "lexer.cpp" +#line 1261 "lexer.cpp" case YY_STATE_EOF(C_COMMENT_STATE): case YY_STATE_EOF(LINE_COMMENT_STATE): yyterminate(); @@ -1471,7 +1555,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 127 ) + if ( yy_current_state >= 183 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -1500,11 +1584,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 127 ) + if ( yy_current_state >= 183 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 126); + yy_is_jam = (yy_current_state == 182); (void)yyg; return yy_is_jam ? 0 : yy_current_state; @@ -2327,7 +2411,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 157 "lexer.lpp" +#line 167 "lexer.lpp" static void escape(char c, char *buf) { diff --git a/lexer.h b/lexer.h index 59ac9ff..2e8fa4c 100644 --- a/lexer.h +++ b/lexer.h @@ -344,7 +344,7 @@ extern int yylex \ #undef YY_DECL #endif -#line 157 "lexer.lpp" +#line 167 "lexer.lpp" #line 350 "lexer.h" diff --git a/lexer.lpp b/lexer.lpp index 741c97c..b6055e2 100644 --- a/lexer.lpp +++ b/lexer.lpp @@ -109,14 +109,24 @@ notnewline [^\n\r] # {yyextra->loc.step(); BEGIN(LINE_COMMENT_STATE); } + directive { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_DIRECTIVE; } + enum { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ENUM; } + extend { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_EXTEND; } false { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FALSE; } fragment { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FRAGMENT; } + implements { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_IMPLEMENTS; } + input { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INPUT; } + interface { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INTERFACE; } mutation { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_MUTATION; } null { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_NULL; } on { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_ON; } query { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_QUERY; } + scalar { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SCALAR; } + schema { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SCHEMA; } subscription { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_SUBSCRIPTION; } true { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_TRUE; } + type { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_TYPE; } + union { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_UNION; } {INTEGER} { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_INTEGER; } {FLOAT} { yylval->str = yytext; *yylloc = yyextra->loc; return yy::GraphQLParserImpl::token::TOK_FLOAT; } diff --git a/parser.tab.cpp b/parser.tab.cpp index 0d974d4..80b37dc 100644 --- a/parser.tab.cpp +++ b/parser.tab.cpp @@ -49,7 +49,7 @@ #line 51 "parser.tab.cpp" // lalr1.cc:412 // Unqualified %code blocks. -#line 113 "parser.ypp" // lalr1.cc:413 +#line 159 "parser.ypp" // lalr1.cc:413 #include "lexer.h" #include "syntaxdefs.h" @@ -181,12 +181,13 @@ namespace yy { /// Build a parser object. - GraphQLParserImpl::GraphQLParserImpl (Node **outAST_yyarg, const char **outError_yyarg, void *scanner_yyarg) + GraphQLParserImpl::GraphQLParserImpl (bool enableSchema_yyarg, Node **outAST_yyarg, const char **outError_yyarg, void *scanner_yyarg) : #if YYDEBUG yydebug_ (false), yycdebug_ (&std::cerr), #endif + enableSchema (enableSchema_yyarg), outAST (outAST_yyarg), outError (outError_yyarg), scanner (scanner_yyarg) @@ -391,473 +392,711 @@ namespace yy { // User destructor. switch (yysym.type_get ()) { - case 3: // "false" + case 3: // "directive" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 399 "parser.tab.cpp" // lalr1.cc:617 +#line 400 "parser.tab.cpp" // lalr1.cc:617 break; - case 4: // "fragment" + case 4: // "enum" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 406 "parser.tab.cpp" // lalr1.cc:617 +#line 407 "parser.tab.cpp" // lalr1.cc:617 break; - case 5: // "mutation" + case 5: // "extend" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 413 "parser.tab.cpp" // lalr1.cc:617 +#line 414 "parser.tab.cpp" // lalr1.cc:617 break; - case 6: // "null" + case 6: // "false" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 420 "parser.tab.cpp" // lalr1.cc:617 +#line 421 "parser.tab.cpp" // lalr1.cc:617 break; - case 7: // "query" + case 7: // "fragment" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 427 "parser.tab.cpp" // lalr1.cc:617 +#line 428 "parser.tab.cpp" // lalr1.cc:617 break; - case 8: // "on" + case 8: // "implements" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 434 "parser.tab.cpp" // lalr1.cc:617 +#line 435 "parser.tab.cpp" // lalr1.cc:617 break; - case 9: // "subscription" + case 9: // "input" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 441 "parser.tab.cpp" // lalr1.cc:617 +#line 442 "parser.tab.cpp" // lalr1.cc:617 break; - case 10: // "true" + case 10: // "interface" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 448 "parser.tab.cpp" // lalr1.cc:617 +#line 449 "parser.tab.cpp" // lalr1.cc:617 break; - case 23: // VARIABLE + case 11: // "mutation" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 455 "parser.tab.cpp" // lalr1.cc:617 +#line 456 "parser.tab.cpp" // lalr1.cc:617 break; - case 24: // INTEGER + case 12: // "null" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 462 "parser.tab.cpp" // lalr1.cc:617 +#line 463 "parser.tab.cpp" // lalr1.cc:617 break; - case 25: // FLOAT + case 13: // "query" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 469 "parser.tab.cpp" // lalr1.cc:617 +#line 470 "parser.tab.cpp" // lalr1.cc:617 break; - case 26: // STRING + case 14: // "on" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 476 "parser.tab.cpp" // lalr1.cc:617 +#line 477 "parser.tab.cpp" // lalr1.cc:617 break; - case 27: // IDENTIFIER + case 15: // "scalar" -#line 210 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 483 "parser.tab.cpp" // lalr1.cc:617 +#line 484 "parser.tab.cpp" // lalr1.cc:617 break; - case 29: // start + case 16: // "schema" -#line 212 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 { } -#line 490 "parser.tab.cpp" // lalr1.cc:617 +#line 491 "parser.tab.cpp" // lalr1.cc:617 break; - case 30: // fragment_name + case 17: // "subscription" -#line 213 "parser.ypp" // lalr1.cc:617 +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 498 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 18: // "true" + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 505 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 19: // "type" + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 512 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 20: // "union" + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 519 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 33: // VARIABLE + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 526 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 34: // INTEGER + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 533 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 35: // FLOAT + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 540 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 36: // STRING + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 547 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 37: // IDENTIFIER + +#line 291 "parser.ypp" // lalr1.cc:617 + { } +#line 554 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 39: // start + +#line 293 "parser.ypp" // lalr1.cc:617 + { } +#line 561 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 40: // fragment_name + +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.name); } -#line 497 "parser.tab.cpp" // lalr1.cc:617 +#line 568 "parser.tab.cpp" // lalr1.cc:617 break; - case 31: // name + case 41: // name -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.name); } -#line 504 "parser.tab.cpp" // lalr1.cc:617 +#line 575 "parser.tab.cpp" // lalr1.cc:617 break; - case 32: // name_opt + case 42: // name_opt -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.name); } -#line 511 "parser.tab.cpp" // lalr1.cc:617 +#line 582 "parser.tab.cpp" // lalr1.cc:617 break; - case 33: // document + case 43: // document -#line 212 "parser.ypp" // lalr1.cc:617 +#line 293 "parser.ypp" // lalr1.cc:617 { } -#line 518 "parser.tab.cpp" // lalr1.cc:617 +#line 589 "parser.tab.cpp" // lalr1.cc:617 break; - case 34: // definition_list + case 44: // definition_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.definitionList); } -#line 525 "parser.tab.cpp" // lalr1.cc:617 +#line 596 "parser.tab.cpp" // lalr1.cc:617 break; - case 35: // definition + case 45: // definition -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.definition); } -#line 532 "parser.tab.cpp" // lalr1.cc:617 +#line 603 "parser.tab.cpp" // lalr1.cc:617 break; - case 36: // operation_definition + case 46: // schema_gate -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.definition); } +#line 610 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 47: // operation_definition + +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.operationDefinition); } -#line 539 "parser.tab.cpp" // lalr1.cc:617 +#line 617 "parser.tab.cpp" // lalr1.cc:617 break; - case 37: // operation_type + case 48: // operation_type -#line 211 "parser.ypp" // lalr1.cc:617 +#line 292 "parser.ypp" // lalr1.cc:617 { free((void *)(yysym.value.heapStr)); } -#line 546 "parser.tab.cpp" // lalr1.cc:617 +#line 624 "parser.tab.cpp" // lalr1.cc:617 break; - case 38: // variable_definitions + case 49: // variable_definitions -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.variableDefinitionList); } -#line 553 "parser.tab.cpp" // lalr1.cc:617 +#line 631 "parser.tab.cpp" // lalr1.cc:617 break; - case 39: // variable_definition_list + case 50: // variable_definition_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.variableDefinitionList); } -#line 560 "parser.tab.cpp" // lalr1.cc:617 +#line 638 "parser.tab.cpp" // lalr1.cc:617 break; - case 40: // variable + case 51: // variable -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.variable); } -#line 567 "parser.tab.cpp" // lalr1.cc:617 +#line 645 "parser.tab.cpp" // lalr1.cc:617 break; - case 41: // variable_definition + case 52: // variable_definition -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.variableDefinition); } -#line 574 "parser.tab.cpp" // lalr1.cc:617 +#line 652 "parser.tab.cpp" // lalr1.cc:617 break; - case 42: // default_value_opt + case 53: // default_value_opt -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.value); } -#line 581 "parser.tab.cpp" // lalr1.cc:617 +#line 659 "parser.tab.cpp" // lalr1.cc:617 break; - case 43: // default_value + case 54: // default_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.value); } -#line 588 "parser.tab.cpp" // lalr1.cc:617 +#line 666 "parser.tab.cpp" // lalr1.cc:617 break; - case 44: // selection_set + case 55: // selection_set -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.selectionSet); } -#line 595 "parser.tab.cpp" // lalr1.cc:617 +#line 673 "parser.tab.cpp" // lalr1.cc:617 break; - case 45: // selection_set_opt + case 56: // selection_set_opt -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.selectionSet); } -#line 602 "parser.tab.cpp" // lalr1.cc:617 +#line 680 "parser.tab.cpp" // lalr1.cc:617 break; - case 46: // selection_list + case 57: // selection_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.selectionList); } -#line 609 "parser.tab.cpp" // lalr1.cc:617 +#line 687 "parser.tab.cpp" // lalr1.cc:617 break; - case 47: // selection + case 58: // selection -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.selection); } -#line 616 "parser.tab.cpp" // lalr1.cc:617 +#line 694 "parser.tab.cpp" // lalr1.cc:617 break; - case 48: // field + case 59: // field -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.field); } -#line 623 "parser.tab.cpp" // lalr1.cc:617 +#line 701 "parser.tab.cpp" // lalr1.cc:617 break; - case 49: // arguments + case 60: // arguments -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.argumentList); } -#line 630 "parser.tab.cpp" // lalr1.cc:617 +#line 708 "parser.tab.cpp" // lalr1.cc:617 break; - case 50: // arguments_opt + case 61: // arguments_opt -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.argumentList); } -#line 637 "parser.tab.cpp" // lalr1.cc:617 +#line 715 "parser.tab.cpp" // lalr1.cc:617 break; - case 51: // argument_list + case 62: // argument_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.argumentList); } -#line 644 "parser.tab.cpp" // lalr1.cc:617 +#line 722 "parser.tab.cpp" // lalr1.cc:617 break; - case 52: // argument + case 63: // argument -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.argument); } -#line 651 "parser.tab.cpp" // lalr1.cc:617 +#line 729 "parser.tab.cpp" // lalr1.cc:617 break; - case 53: // fragment_spread + case 64: // fragment_spread -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.fragmentSpread); } -#line 658 "parser.tab.cpp" // lalr1.cc:617 +#line 736 "parser.tab.cpp" // lalr1.cc:617 break; - case 54: // inline_fragment + case 65: // inline_fragment -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.inlineFragment); } -#line 665 "parser.tab.cpp" // lalr1.cc:617 +#line 743 "parser.tab.cpp" // lalr1.cc:617 break; - case 55: // fragment_definition + case 66: // fragment_definition -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.fragmentDefinition); } -#line 672 "parser.tab.cpp" // lalr1.cc:617 +#line 750 "parser.tab.cpp" // lalr1.cc:617 break; - case 56: // type_condition + case 67: // type_condition -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.namedType); } -#line 679 "parser.tab.cpp" // lalr1.cc:617 +#line 757 "parser.tab.cpp" // lalr1.cc:617 break; - case 57: // value + case 68: // value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.value); } -#line 686 "parser.tab.cpp" // lalr1.cc:617 +#line 764 "parser.tab.cpp" // lalr1.cc:617 break; - case 58: // int_value + case 69: // int_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.intValue); } -#line 693 "parser.tab.cpp" // lalr1.cc:617 +#line 771 "parser.tab.cpp" // lalr1.cc:617 break; - case 59: // float_value + case 70: // float_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.floatValue); } -#line 700 "parser.tab.cpp" // lalr1.cc:617 +#line 778 "parser.tab.cpp" // lalr1.cc:617 break; - case 60: // string_value + case 71: // string_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.stringValue); } -#line 707 "parser.tab.cpp" // lalr1.cc:617 +#line 785 "parser.tab.cpp" // lalr1.cc:617 break; - case 61: // value_const + case 72: // value_const -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.value); } -#line 714 "parser.tab.cpp" // lalr1.cc:617 +#line 792 "parser.tab.cpp" // lalr1.cc:617 break; - case 62: // boolean_value + case 73: // boolean_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.booleanValue); } -#line 721 "parser.tab.cpp" // lalr1.cc:617 +#line 799 "parser.tab.cpp" // lalr1.cc:617 break; - case 63: // null_value + case 74: // null_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.nullValue); } -#line 728 "parser.tab.cpp" // lalr1.cc:617 +#line 806 "parser.tab.cpp" // lalr1.cc:617 break; - case 64: // enum_value + case 75: // enum_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.enumValue); } -#line 735 "parser.tab.cpp" // lalr1.cc:617 +#line 813 "parser.tab.cpp" // lalr1.cc:617 break; - case 65: // list_value + case 76: // list_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.arrayValue); } -#line 742 "parser.tab.cpp" // lalr1.cc:617 +#line 820 "parser.tab.cpp" // lalr1.cc:617 break; - case 66: // value_list + case 77: // value_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.valueList); } -#line 749 "parser.tab.cpp" // lalr1.cc:617 +#line 827 "parser.tab.cpp" // lalr1.cc:617 break; - case 67: // list_value_const + case 78: // list_value_const -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.arrayValue); } -#line 756 "parser.tab.cpp" // lalr1.cc:617 +#line 834 "parser.tab.cpp" // lalr1.cc:617 break; - case 68: // value_const_list + case 79: // value_const_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.valueList); } -#line 763 "parser.tab.cpp" // lalr1.cc:617 +#line 841 "parser.tab.cpp" // lalr1.cc:617 break; - case 69: // object_value + case 80: // object_value -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.objectValue); } -#line 770 "parser.tab.cpp" // lalr1.cc:617 +#line 848 "parser.tab.cpp" // lalr1.cc:617 break; - case 70: // object_field_list + case 81: // object_field_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.objectFieldList); } -#line 777 "parser.tab.cpp" // lalr1.cc:617 +#line 855 "parser.tab.cpp" // lalr1.cc:617 break; - case 71: // object_field + case 82: // object_field -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.objectField); } -#line 784 "parser.tab.cpp" // lalr1.cc:617 +#line 862 "parser.tab.cpp" // lalr1.cc:617 break; - case 72: // object_value_const + case 83: // object_value_const -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.objectValue); } -#line 791 "parser.tab.cpp" // lalr1.cc:617 +#line 869 "parser.tab.cpp" // lalr1.cc:617 break; - case 73: // object_field_const_list + case 84: // object_field_const_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.objectFieldList); } -#line 798 "parser.tab.cpp" // lalr1.cc:617 +#line 876 "parser.tab.cpp" // lalr1.cc:617 break; - case 74: // object_field_const + case 85: // object_field_const -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.objectField); } -#line 805 "parser.tab.cpp" // lalr1.cc:617 +#line 883 "parser.tab.cpp" // lalr1.cc:617 break; - case 75: // directives + case 86: // directives -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.directiveList); } -#line 812 "parser.tab.cpp" // lalr1.cc:617 +#line 890 "parser.tab.cpp" // lalr1.cc:617 break; - case 76: // directives_opt + case 87: // directives_opt -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.directiveList); } -#line 819 "parser.tab.cpp" // lalr1.cc:617 +#line 897 "parser.tab.cpp" // lalr1.cc:617 break; - case 77: // directive_list + case 88: // directive_list -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.directiveList); } -#line 826 "parser.tab.cpp" // lalr1.cc:617 +#line 904 "parser.tab.cpp" // lalr1.cc:617 break; - case 78: // directive + case 89: // directive -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.directive); } -#line 833 "parser.tab.cpp" // lalr1.cc:617 +#line 911 "parser.tab.cpp" // lalr1.cc:617 break; - case 79: // type + case 90: // type -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.type); } -#line 840 "parser.tab.cpp" // lalr1.cc:617 +#line 918 "parser.tab.cpp" // lalr1.cc:617 break; - case 80: // type_name + case 91: // type_name -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.namedType); } -#line 847 "parser.tab.cpp" // lalr1.cc:617 +#line 925 "parser.tab.cpp" // lalr1.cc:617 break; - case 81: // list_type + case 92: // list_type -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.listType); } -#line 854 "parser.tab.cpp" // lalr1.cc:617 +#line 932 "parser.tab.cpp" // lalr1.cc:617 break; - case 82: // non_null_type + case 93: // non_null_type -#line 213 "parser.ypp" // lalr1.cc:617 +#line 294 "parser.ypp" // lalr1.cc:617 { delete (yysym.value.nonNullType); } -#line 861 "parser.tab.cpp" // lalr1.cc:617 +#line 939 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 94: // schema_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.schemaDefinition); } +#line 946 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 95: // operation_type_definition_list + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.operationTypeDefinitionList); } +#line 953 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 96: // operation_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.operationTypeDefinition); } +#line 960 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 97: // scalar_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.scalarTypeDefinition); } +#line 967 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 98: // object_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.objectTypeDefinition); } +#line 974 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 99: // implements_interfaces_opt + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.typeNameList); } +#line 981 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 100: // type_name_list + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.typeNameList); } +#line 988 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 101: // field_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.fieldDefinition); } +#line 995 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 102: // field_definition_list + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.fieldDefinitionList); } +#line 1002 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 103: // arguments_definition_opt + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.inputValueDefinitionList); } +#line 1009 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 104: // arguments_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.inputValueDefinitionList); } +#line 1016 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 105: // input_value_definition_list + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.inputValueDefinitionList); } +#line 1023 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 106: // input_value_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.inputValueDefinition); } +#line 1030 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 107: // interface_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.interfaceTypeDefinition); } +#line 1037 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 108: // union_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.unionTypeDefinition); } +#line 1044 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 109: // union_members + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.typeNameList); } +#line 1051 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 110: // enum_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.enumTypeDefinition); } +#line 1058 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 111: // enum_value_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.enumValueDefinition); } +#line 1065 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 112: // enum_value_definition_list + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.enumValueDefinitionList); } +#line 1072 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 113: // input_object_type_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.inputObjectTypeDefinition); } +#line 1079 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 114: // type_extension_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.typeExtensionDefinition); } +#line 1086 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 115: // directive_definition + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.directiveDefinition); } +#line 1093 "parser.tab.cpp" // lalr1.cc:617 + break; + + case 116: // directive_locations + +#line 294 "parser.ypp" // lalr1.cc:617 + { delete (yysym.value.nameList); } +#line 1100 "parser.tab.cpp" // lalr1.cc:617 break; @@ -884,95 +1123,165 @@ namespace yy { << yysym.location << ": "; switch (yytype) { - case 3: // "false" + case 3: // "directive" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1131 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 4: // "enum" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1138 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 5: // "extend" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1145 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 6: // "false" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1152 "parser.tab.cpp" // lalr1.cc:636 + break; -#line 215 "parser.ypp" // lalr1.cc:636 + case 7: // "fragment" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1159 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 8: // "implements" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1166 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 9: // "input" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1173 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 10: // "interface" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1180 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 11: // "mutation" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1187 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 12: // "null" + +#line 296 "parser.ypp" // lalr1.cc:636 + { yyoutput << (yysym.value.str); } +#line 1194 "parser.tab.cpp" // lalr1.cc:636 + break; + + case 13: // "query" + +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 892 "parser.tab.cpp" // lalr1.cc:636 +#line 1201 "parser.tab.cpp" // lalr1.cc:636 break; - case 4: // "fragment" + case 14: // "on" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 899 "parser.tab.cpp" // lalr1.cc:636 +#line 1208 "parser.tab.cpp" // lalr1.cc:636 break; - case 5: // "mutation" + case 15: // "scalar" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 906 "parser.tab.cpp" // lalr1.cc:636 +#line 1215 "parser.tab.cpp" // lalr1.cc:636 break; - case 6: // "null" + case 16: // "schema" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 913 "parser.tab.cpp" // lalr1.cc:636 +#line 1222 "parser.tab.cpp" // lalr1.cc:636 break; - case 7: // "query" + case 17: // "subscription" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 920 "parser.tab.cpp" // lalr1.cc:636 +#line 1229 "parser.tab.cpp" // lalr1.cc:636 break; - case 8: // "on" + case 18: // "true" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 927 "parser.tab.cpp" // lalr1.cc:636 +#line 1236 "parser.tab.cpp" // lalr1.cc:636 break; - case 9: // "subscription" + case 19: // "type" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 934 "parser.tab.cpp" // lalr1.cc:636 +#line 1243 "parser.tab.cpp" // lalr1.cc:636 break; - case 10: // "true" + case 20: // "union" -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 941 "parser.tab.cpp" // lalr1.cc:636 +#line 1250 "parser.tab.cpp" // lalr1.cc:636 break; - case 23: // VARIABLE + case 33: // VARIABLE -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 948 "parser.tab.cpp" // lalr1.cc:636 +#line 1257 "parser.tab.cpp" // lalr1.cc:636 break; - case 24: // INTEGER + case 34: // INTEGER -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 955 "parser.tab.cpp" // lalr1.cc:636 +#line 1264 "parser.tab.cpp" // lalr1.cc:636 break; - case 25: // FLOAT + case 35: // FLOAT -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 962 "parser.tab.cpp" // lalr1.cc:636 +#line 1271 "parser.tab.cpp" // lalr1.cc:636 break; - case 26: // STRING + case 36: // STRING -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 969 "parser.tab.cpp" // lalr1.cc:636 +#line 1278 "parser.tab.cpp" // lalr1.cc:636 break; - case 27: // IDENTIFIER + case 37: // IDENTIFIER -#line 215 "parser.ypp" // lalr1.cc:636 +#line 296 "parser.ypp" // lalr1.cc:636 { yyoutput << (yysym.value.str); } -#line 976 "parser.tab.cpp" // lalr1.cc:636 +#line 1285 "parser.tab.cpp" // lalr1.cc:636 break; @@ -1190,655 +1499,1036 @@ namespace yy { switch (yyn) { case 2: -#line 219 "parser.ypp" // lalr1.cc:859 +#line 300 "parser.ypp" // lalr1.cc:859 { *outAST = (yystack_[0].value.document); } -#line 1196 "parser.tab.cpp" // lalr1.cc:859 +#line 1505 "parser.tab.cpp" // lalr1.cc:859 break; case 3: -#line 224 "parser.ypp" // lalr1.cc:859 +#line 305 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1202 "parser.tab.cpp" // lalr1.cc:859 +#line 1511 "parser.tab.cpp" // lalr1.cc:859 break; case 4: -#line 225 "parser.ypp" // lalr1.cc:859 +#line 306 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1208 "parser.tab.cpp" // lalr1.cc:859 +#line 1517 "parser.tab.cpp" // lalr1.cc:859 break; case 5: -#line 226 "parser.ypp" // lalr1.cc:859 +#line 307 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1214 "parser.tab.cpp" // lalr1.cc:859 +#line 1523 "parser.tab.cpp" // lalr1.cc:859 break; case 6: -#line 227 "parser.ypp" // lalr1.cc:859 +#line 308 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1220 "parser.tab.cpp" // lalr1.cc:859 +#line 1529 "parser.tab.cpp" // lalr1.cc:859 break; case 7: -#line 228 "parser.ypp" // lalr1.cc:859 +#line 309 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1226 "parser.tab.cpp" // lalr1.cc:859 +#line 1535 "parser.tab.cpp" // lalr1.cc:859 break; case 8: -#line 229 "parser.ypp" // lalr1.cc:859 +#line 310 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1232 "parser.tab.cpp" // lalr1.cc:859 +#line 1541 "parser.tab.cpp" // lalr1.cc:859 break; case 9: -#line 230 "parser.ypp" // lalr1.cc:859 +#line 311 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1238 "parser.tab.cpp" // lalr1.cc:859 +#line 1547 "parser.tab.cpp" // lalr1.cc:859 break; case 10: -#line 231 "parser.ypp" // lalr1.cc:859 +#line 312 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1553 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 11: +#line 313 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1244 "parser.tab.cpp" // lalr1.cc:859 +#line 1559 "parser.tab.cpp" // lalr1.cc:859 break; case 12: -#line 235 "parser.ypp" // lalr1.cc:859 +#line 314 "parser.ypp" // lalr1.cc:859 { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } -#line 1250 "parser.tab.cpp" // lalr1.cc:859 +#line 1565 "parser.tab.cpp" // lalr1.cc:859 break; case 13: -#line 239 "parser.ypp" // lalr1.cc:859 - {(yylhs.value.name) = nullptr;} -#line 1256 "parser.tab.cpp" // lalr1.cc:859 +#line 315 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1571 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 14: +#line 316 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1577 "parser.tab.cpp" // lalr1.cc:859 break; case 15: -#line 245 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.document) = new Document(yylhs.location, (yystack_[0].value.definitionList)); } -#line 1262 "parser.tab.cpp" // lalr1.cc:859 +#line 317 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1583 "parser.tab.cpp" // lalr1.cc:859 break; case 16: -#line 248 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.definitionList) = new std::vector>(); (yylhs.value.definitionList)->emplace_back((yystack_[0].value.definition)); } -#line 1268 "parser.tab.cpp" // lalr1.cc:859 +#line 318 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1589 "parser.tab.cpp" // lalr1.cc:859 break; case 17: -#line 249 "parser.ypp" // lalr1.cc:859 - { (yystack_[1].value.definitionList)->emplace_back((yystack_[0].value.definition)); (yylhs.value.definitionList) = (yystack_[1].value.definitionList); } -#line 1274 "parser.tab.cpp" // lalr1.cc:859 +#line 319 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1595 "parser.tab.cpp" // lalr1.cc:859 break; case 18: -#line 252 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.definition) = static_cast((yystack_[0].value.operationDefinition)); } -#line 1280 "parser.tab.cpp" // lalr1.cc:859 +#line 320 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1601 "parser.tab.cpp" // lalr1.cc:859 break; case 19: -#line 253 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.definition) = static_cast((yystack_[0].value.fragmentDefinition));} -#line 1286 "parser.tab.cpp" // lalr1.cc:859 +#line 321 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1607 "parser.tab.cpp" // lalr1.cc:859 break; case 20: -#line 259 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, strdup("query"), nullptr, nullptr, nullptr, (yystack_[0].value.selectionSet)); } -#line 1292 "parser.tab.cpp" // lalr1.cc:859 - break; - - case 21: -#line 260 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[2].value.heapStr), (yystack_[1].value.name), nullptr, nullptr, (yystack_[0].value.selectionSet)); } -#line 1298 "parser.tab.cpp" // lalr1.cc:859 +#line 322 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1613 "parser.tab.cpp" // lalr1.cc:859 break; case 22: -#line 261 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[3].value.heapStr), (yystack_[2].value.name), (yystack_[1].value.variableDefinitionList), nullptr, (yystack_[0].value.selectionSet)); } -#line 1304 "parser.tab.cpp" // lalr1.cc:859 +#line 326 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.name) = new Name(yystack_[0].location, strdup((yystack_[0].value.str))); } +#line 1619 "parser.tab.cpp" // lalr1.cc:859 break; case 23: -#line 262 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[3].value.heapStr), (yystack_[2].value.name), nullptr, (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1310 "parser.tab.cpp" // lalr1.cc:859 - break; - - case 24: -#line 263 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[4].value.heapStr), (yystack_[3].value.name), (yystack_[2].value.variableDefinitionList), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1316 "parser.tab.cpp" // lalr1.cc:859 +#line 330 "parser.ypp" // lalr1.cc:859 + {(yylhs.value.name) = nullptr;} +#line 1625 "parser.tab.cpp" // lalr1.cc:859 break; case 25: -#line 266 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.heapStr) = strdup((yystack_[0].value.str)); } -#line 1322 "parser.tab.cpp" // lalr1.cc:859 +#line 336 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.document) = new Document(yylhs.location, (yystack_[0].value.definitionList)); } +#line 1631 "parser.tab.cpp" // lalr1.cc:859 break; case 26: -#line 267 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.heapStr) = strdup((yystack_[0].value.str)); } -#line 1328 "parser.tab.cpp" // lalr1.cc:859 +#line 339 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definitionList) = new std::vector>(); (yylhs.value.definitionList)->emplace_back((yystack_[0].value.definition)); } +#line 1637 "parser.tab.cpp" // lalr1.cc:859 break; case 27: -#line 268 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.heapStr) = strdup((yystack_[0].value.str)); } -#line 1334 "parser.tab.cpp" // lalr1.cc:859 +#line 340 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.definitionList)->emplace_back((yystack_[0].value.definition)); (yylhs.value.definitionList) = (yystack_[1].value.definitionList); } +#line 1643 "parser.tab.cpp" // lalr1.cc:859 break; case 28: -#line 272 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.variableDefinitionList) = (yystack_[1].value.variableDefinitionList); } -#line 1340 "parser.tab.cpp" // lalr1.cc:859 +#line 343 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.operationDefinition)); } +#line 1649 "parser.tab.cpp" // lalr1.cc:859 break; case 29: -#line 276 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.variableDefinitionList) = new std::vector>(); (yylhs.value.variableDefinitionList)->emplace_back((yystack_[0].value.variableDefinition)); } -#line 1346 "parser.tab.cpp" // lalr1.cc:859 +#line 344 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.fragmentDefinition)); } +#line 1655 "parser.tab.cpp" // lalr1.cc:859 break; case 30: -#line 277 "parser.ypp" // lalr1.cc:859 - { (yystack_[1].value.variableDefinitionList)->emplace_back((yystack_[0].value.variableDefinition)); (yylhs.value.variableDefinitionList) = (yystack_[1].value.variableDefinitionList); } -#line 1352 "parser.tab.cpp" // lalr1.cc:859 +#line 345 "parser.ypp" // lalr1.cc:859 + { + if (!enableSchema) { + error(yylhs.location, "schema support disabled"); + // %destructor doesn't work with YYERROR. See + // https://www.gnu.org/software/bison/manual/html_node/Destructor-Decl.html + delete (yylhs.value.definition); + YYERROR; + } + (yylhs.value.definition) = static_cast((yystack_[0].value.definition)); + } +#line 1670 "parser.tab.cpp" // lalr1.cc:859 break; case 31: -#line 280 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.variable) = new Variable(yylhs.location, new Name(yystack_[0].location, strdup((yystack_[0].value.str)))); } -#line 1358 "parser.tab.cpp" // lalr1.cc:859 +#line 357 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.schemaDefinition)); } +#line 1676 "parser.tab.cpp" // lalr1.cc:859 break; case 32: -#line 284 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.variableDefinition) = new VariableDefinition(yylhs.location, (yystack_[3].value.variable), (yystack_[1].value.type), (yystack_[0].value.value)); } -#line 1364 "parser.tab.cpp" // lalr1.cc:859 +#line 358 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.scalarTypeDefinition)); } +#line 1682 "parser.tab.cpp" // lalr1.cc:859 break; case 33: -#line 288 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.value) = nullptr; } -#line 1370 "parser.tab.cpp" // lalr1.cc:859 +#line 359 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.objectTypeDefinition)); } +#line 1688 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 34: +#line 360 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.interfaceTypeDefinition)); } +#line 1694 "parser.tab.cpp" // lalr1.cc:859 break; case 35: -#line 292 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.value) = (yystack_[0].value.value); } -#line 1376 "parser.tab.cpp" // lalr1.cc:859 +#line 361 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.unionTypeDefinition)); } +#line 1700 "parser.tab.cpp" // lalr1.cc:859 break; case 36: -#line 296 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.selectionSet) = new SelectionSet(yylhs.location, (yystack_[1].value.selectionList)); } -#line 1382 "parser.tab.cpp" // lalr1.cc:859 +#line 362 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.enumTypeDefinition)); } +#line 1706 "parser.tab.cpp" // lalr1.cc:859 break; case 37: -#line 300 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.selectionSet) = nullptr; } -#line 1388 "parser.tab.cpp" // lalr1.cc:859 +#line 363 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.inputObjectTypeDefinition)); } +#line 1712 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 38: +#line 364 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.typeExtensionDefinition)); } +#line 1718 "parser.tab.cpp" // lalr1.cc:859 break; case 39: -#line 303 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.selectionList) = new std::vector>(); (yylhs.value.selectionList)->emplace_back((yystack_[0].value.selection)); } -#line 1394 "parser.tab.cpp" // lalr1.cc:859 +#line 365 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.definition) = static_cast((yystack_[0].value.directiveDefinition)); } +#line 1724 "parser.tab.cpp" // lalr1.cc:859 break; case 40: -#line 304 "parser.ypp" // lalr1.cc:859 - { (yystack_[1].value.selectionList)->emplace_back((yystack_[0].value.selection)); (yylhs.value.selectionList) = (yystack_[1].value.selectionList); } -#line 1400 "parser.tab.cpp" // lalr1.cc:859 +#line 371 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, strdup("query"), nullptr, nullptr, nullptr, (yystack_[0].value.selectionSet)); } +#line 1730 "parser.tab.cpp" // lalr1.cc:859 break; case 41: -#line 307 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.selection) = static_cast((yystack_[0].value.field)); } -#line 1406 "parser.tab.cpp" // lalr1.cc:859 +#line 372 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[2].value.heapStr), (yystack_[1].value.name), nullptr, nullptr, (yystack_[0].value.selectionSet)); } +#line 1736 "parser.tab.cpp" // lalr1.cc:859 break; case 42: -#line 308 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.selection) = static_cast((yystack_[0].value.fragmentSpread)); } -#line 1412 "parser.tab.cpp" // lalr1.cc:859 +#line 373 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[3].value.heapStr), (yystack_[2].value.name), (yystack_[1].value.variableDefinitionList), nullptr, (yystack_[0].value.selectionSet)); } +#line 1742 "parser.tab.cpp" // lalr1.cc:859 break; case 43: -#line 309 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.selection) = static_cast((yystack_[0].value.inlineFragment)); } -#line 1418 "parser.tab.cpp" // lalr1.cc:859 +#line 374 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[3].value.heapStr), (yystack_[2].value.name), nullptr, (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } +#line 1748 "parser.tab.cpp" // lalr1.cc:859 break; case 44: -#line 312 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.field) = new Field(yylhs.location, nullptr, (yystack_[3].value.name), (yystack_[2].value.argumentList), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1424 "parser.tab.cpp" // lalr1.cc:859 +#line 375 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationDefinition) = new OperationDefinition(yylhs.location, (yystack_[4].value.heapStr), (yystack_[3].value.name), (yystack_[2].value.variableDefinitionList), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } +#line 1754 "parser.tab.cpp" // lalr1.cc:859 break; case 45: -#line 313 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.field) = new Field(yylhs.location, (yystack_[5].value.name), (yystack_[3].value.name), (yystack_[2].value.argumentList), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1430 "parser.tab.cpp" // lalr1.cc:859 +#line 378 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.heapStr) = strdup((yystack_[0].value.str)); } +#line 1760 "parser.tab.cpp" // lalr1.cc:859 break; case 46: -#line 316 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.argumentList) = (yystack_[1].value.argumentList); } -#line 1436 "parser.tab.cpp" // lalr1.cc:859 +#line 379 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.heapStr) = strdup((yystack_[0].value.str)); } +#line 1766 "parser.tab.cpp" // lalr1.cc:859 break; case 47: -#line 319 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.argumentList) = nullptr; } -#line 1442 "parser.tab.cpp" // lalr1.cc:859 +#line 380 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.heapStr) = strdup((yystack_[0].value.str)); } +#line 1772 "parser.tab.cpp" // lalr1.cc:859 break; case 48: -#line 320 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.argumentList) = (yystack_[0].value.argumentList); } -#line 1448 "parser.tab.cpp" // lalr1.cc:859 +#line 384 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.variableDefinitionList) = (yystack_[1].value.variableDefinitionList); } +#line 1778 "parser.tab.cpp" // lalr1.cc:859 break; case 49: -#line 323 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.argumentList) = new std::vector>(); (yylhs.value.argumentList)->emplace_back((yystack_[0].value.argument)); } -#line 1454 "parser.tab.cpp" // lalr1.cc:859 +#line 388 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.variableDefinitionList) = new std::vector>(); (yylhs.value.variableDefinitionList)->emplace_back((yystack_[0].value.variableDefinition)); } +#line 1784 "parser.tab.cpp" // lalr1.cc:859 break; case 50: -#line 324 "parser.ypp" // lalr1.cc:859 - { (yystack_[1].value.argumentList)->emplace_back((yystack_[0].value.argument)); (yylhs.value.argumentList) = (yystack_[1].value.argumentList); } -#line 1460 "parser.tab.cpp" // lalr1.cc:859 +#line 389 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.variableDefinitionList)->emplace_back((yystack_[0].value.variableDefinition)); (yylhs.value.variableDefinitionList) = (yystack_[1].value.variableDefinitionList); } +#line 1790 "parser.tab.cpp" // lalr1.cc:859 break; case 51: -#line 327 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.argument) = new Argument(yylhs.location, (yystack_[2].value.name), (yystack_[0].value.value)); } -#line 1466 "parser.tab.cpp" // lalr1.cc:859 +#line 392 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.variable) = new Variable(yylhs.location, new Name(yystack_[0].location, strdup((yystack_[0].value.str)))); } +#line 1796 "parser.tab.cpp" // lalr1.cc:859 break; case 52: -#line 332 "parser.ypp" // lalr1.cc:859 - { (yylhs.value.fragmentSpread) = new FragmentSpread(yylhs.location, (yystack_[1].value.name), (yystack_[0].value.directiveList)); } -#line 1472 "parser.tab.cpp" // lalr1.cc:859 +#line 396 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.variableDefinition) = new VariableDefinition(yylhs.location, (yystack_[3].value.variable), (yystack_[1].value.type), (yystack_[0].value.value)); } +#line 1802 "parser.tab.cpp" // lalr1.cc:859 break; case 53: -#line 336 "parser.ypp" // lalr1.cc:859 +#line 400 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.value) = nullptr; } +#line 1808 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 55: +#line 404 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.value) = (yystack_[0].value.value); } +#line 1814 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 56: +#line 408 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.selectionSet) = new SelectionSet(yylhs.location, (yystack_[1].value.selectionList)); } +#line 1820 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 57: +#line 412 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.selectionSet) = nullptr; } +#line 1826 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 59: +#line 415 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.selectionList) = new std::vector>(); (yylhs.value.selectionList)->emplace_back((yystack_[0].value.selection)); } +#line 1832 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 60: +#line 416 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.selectionList)->emplace_back((yystack_[0].value.selection)); (yylhs.value.selectionList) = (yystack_[1].value.selectionList); } +#line 1838 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 61: +#line 419 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.selection) = static_cast((yystack_[0].value.field)); } +#line 1844 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 62: +#line 420 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.selection) = static_cast((yystack_[0].value.fragmentSpread)); } +#line 1850 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 63: +#line 421 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.selection) = static_cast((yystack_[0].value.inlineFragment)); } +#line 1856 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 64: +#line 424 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.field) = new Field(yylhs.location, nullptr, (yystack_[3].value.name), (yystack_[2].value.argumentList), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } +#line 1862 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 65: +#line 425 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.field) = new Field(yylhs.location, (yystack_[5].value.name), (yystack_[3].value.name), (yystack_[2].value.argumentList), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } +#line 1868 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 66: +#line 428 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.argumentList) = (yystack_[1].value.argumentList); } +#line 1874 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 67: +#line 431 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.argumentList) = nullptr; } +#line 1880 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 68: +#line 432 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.argumentList) = (yystack_[0].value.argumentList); } +#line 1886 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 69: +#line 435 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.argumentList) = new std::vector>(); (yylhs.value.argumentList)->emplace_back((yystack_[0].value.argument)); } +#line 1892 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 70: +#line 436 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.argumentList)->emplace_back((yystack_[0].value.argument)); (yylhs.value.argumentList) = (yystack_[1].value.argumentList); } +#line 1898 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 71: +#line 439 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.argument) = new Argument(yylhs.location, (yystack_[2].value.name), (yystack_[0].value.value)); } +#line 1904 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 72: +#line 444 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.fragmentSpread) = new FragmentSpread(yylhs.location, (yystack_[1].value.name), (yystack_[0].value.directiveList)); } +#line 1910 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 73: +#line 448 "parser.ypp" // lalr1.cc:859 { (yylhs.value.inlineFragment) = new InlineFragment(yylhs.location, (yystack_[2].value.namedType), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1478 "parser.tab.cpp" // lalr1.cc:859 +#line 1916 "parser.tab.cpp" // lalr1.cc:859 break; - case 54: -#line 337 "parser.ypp" // lalr1.cc:859 + case 74: +#line 449 "parser.ypp" // lalr1.cc:859 { (yylhs.value.inlineFragment) = new InlineFragment(yylhs.location, nullptr, (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1484 "parser.tab.cpp" // lalr1.cc:859 +#line 1922 "parser.tab.cpp" // lalr1.cc:859 break; - case 55: -#line 341 "parser.ypp" // lalr1.cc:859 + case 75: +#line 453 "parser.ypp" // lalr1.cc:859 { (yylhs.value.fragmentDefinition) = new FragmentDefinition(yylhs.location, (yystack_[4].value.name), (yystack_[2].value.namedType), (yystack_[1].value.directiveList), (yystack_[0].value.selectionSet)); } -#line 1490 "parser.tab.cpp" // lalr1.cc:859 +#line 1928 "parser.tab.cpp" // lalr1.cc:859 break; - case 57: -#line 348 "parser.ypp" // lalr1.cc:859 + case 77: +#line 460 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.variable)); } -#line 1496 "parser.tab.cpp" // lalr1.cc:859 +#line 1934 "parser.tab.cpp" // lalr1.cc:859 break; - case 58: -#line 349 "parser.ypp" // lalr1.cc:859 + case 78: +#line 461 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.intValue)); } -#line 1502 "parser.tab.cpp" // lalr1.cc:859 +#line 1940 "parser.tab.cpp" // lalr1.cc:859 break; - case 59: -#line 350 "parser.ypp" // lalr1.cc:859 + case 79: +#line 462 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.floatValue)); } -#line 1508 "parser.tab.cpp" // lalr1.cc:859 +#line 1946 "parser.tab.cpp" // lalr1.cc:859 break; - case 60: -#line 351 "parser.ypp" // lalr1.cc:859 + case 80: +#line 463 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.stringValue)); } -#line 1514 "parser.tab.cpp" // lalr1.cc:859 +#line 1952 "parser.tab.cpp" // lalr1.cc:859 break; - case 61: -#line 352 "parser.ypp" // lalr1.cc:859 + case 81: +#line 464 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.booleanValue)); } -#line 1520 "parser.tab.cpp" // lalr1.cc:859 +#line 1958 "parser.tab.cpp" // lalr1.cc:859 break; - case 62: -#line 353 "parser.ypp" // lalr1.cc:859 + case 82: +#line 465 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.nullValue)); } -#line 1526 "parser.tab.cpp" // lalr1.cc:859 +#line 1964 "parser.tab.cpp" // lalr1.cc:859 break; - case 63: -#line 354 "parser.ypp" // lalr1.cc:859 + case 83: +#line 466 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.enumValue)); } -#line 1532 "parser.tab.cpp" // lalr1.cc:859 +#line 1970 "parser.tab.cpp" // lalr1.cc:859 break; - case 64: -#line 355 "parser.ypp" // lalr1.cc:859 + case 84: +#line 467 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.arrayValue)); } -#line 1538 "parser.tab.cpp" // lalr1.cc:859 +#line 1976 "parser.tab.cpp" // lalr1.cc:859 break; - case 65: -#line 356 "parser.ypp" // lalr1.cc:859 + case 85: +#line 468 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.objectValue)); } -#line 1544 "parser.tab.cpp" // lalr1.cc:859 +#line 1982 "parser.tab.cpp" // lalr1.cc:859 break; - case 66: -#line 359 "parser.ypp" // lalr1.cc:859 + case 86: +#line 471 "parser.ypp" // lalr1.cc:859 { (yylhs.value.intValue) = new IntValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1550 "parser.tab.cpp" // lalr1.cc:859 +#line 1988 "parser.tab.cpp" // lalr1.cc:859 break; - case 67: -#line 362 "parser.ypp" // lalr1.cc:859 + case 87: +#line 474 "parser.ypp" // lalr1.cc:859 { (yylhs.value.floatValue) = new FloatValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1556 "parser.tab.cpp" // lalr1.cc:859 +#line 1994 "parser.tab.cpp" // lalr1.cc:859 break; - case 68: -#line 365 "parser.ypp" // lalr1.cc:859 + case 88: +#line 477 "parser.ypp" // lalr1.cc:859 { (yylhs.value.stringValue) = new StringValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1562 "parser.tab.cpp" // lalr1.cc:859 +#line 2000 "parser.tab.cpp" // lalr1.cc:859 break; - case 69: -#line 368 "parser.ypp" // lalr1.cc:859 + case 89: +#line 480 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.intValue)); } -#line 1568 "parser.tab.cpp" // lalr1.cc:859 +#line 2006 "parser.tab.cpp" // lalr1.cc:859 break; - case 70: -#line 369 "parser.ypp" // lalr1.cc:859 + case 90: +#line 481 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.floatValue)); } -#line 1574 "parser.tab.cpp" // lalr1.cc:859 +#line 2012 "parser.tab.cpp" // lalr1.cc:859 break; - case 71: -#line 370 "parser.ypp" // lalr1.cc:859 + case 91: +#line 482 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.stringValue)); } -#line 1580 "parser.tab.cpp" // lalr1.cc:859 +#line 2018 "parser.tab.cpp" // lalr1.cc:859 break; - case 72: -#line 371 "parser.ypp" // lalr1.cc:859 + case 92: +#line 483 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.booleanValue)); } -#line 1586 "parser.tab.cpp" // lalr1.cc:859 +#line 2024 "parser.tab.cpp" // lalr1.cc:859 break; - case 73: -#line 372 "parser.ypp" // lalr1.cc:859 + case 93: +#line 484 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.nullValue)); } -#line 1592 "parser.tab.cpp" // lalr1.cc:859 +#line 2030 "parser.tab.cpp" // lalr1.cc:859 break; - case 74: -#line 373 "parser.ypp" // lalr1.cc:859 + case 94: +#line 485 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.enumValue)); } -#line 1598 "parser.tab.cpp" // lalr1.cc:859 +#line 2036 "parser.tab.cpp" // lalr1.cc:859 break; - case 75: -#line 374 "parser.ypp" // lalr1.cc:859 + case 95: +#line 486 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.arrayValue)); } -#line 1604 "parser.tab.cpp" // lalr1.cc:859 +#line 2042 "parser.tab.cpp" // lalr1.cc:859 break; - case 76: -#line 375 "parser.ypp" // lalr1.cc:859 + case 96: +#line 487 "parser.ypp" // lalr1.cc:859 { (yylhs.value.value) = static_cast((yystack_[0].value.objectValue)); } -#line 1610 "parser.tab.cpp" // lalr1.cc:859 +#line 2048 "parser.tab.cpp" // lalr1.cc:859 break; - case 77: -#line 378 "parser.ypp" // lalr1.cc:859 + case 97: +#line 490 "parser.ypp" // lalr1.cc:859 { (yylhs.value.booleanValue) = new BooleanValue(yylhs.location, true); } -#line 1616 "parser.tab.cpp" // lalr1.cc:859 +#line 2054 "parser.tab.cpp" // lalr1.cc:859 break; - case 78: -#line 379 "parser.ypp" // lalr1.cc:859 + case 98: +#line 491 "parser.ypp" // lalr1.cc:859 { (yylhs.value.booleanValue) = new BooleanValue(yylhs.location, false); } -#line 1622 "parser.tab.cpp" // lalr1.cc:859 +#line 2060 "parser.tab.cpp" // lalr1.cc:859 break; - case 79: -#line 382 "parser.ypp" // lalr1.cc:859 + case 99: +#line 494 "parser.ypp" // lalr1.cc:859 { (yylhs.value.nullValue) = new NullValue(yylhs.location); } -#line 1628 "parser.tab.cpp" // lalr1.cc:859 +#line 2066 "parser.tab.cpp" // lalr1.cc:859 break; - case 80: -#line 385 "parser.ypp" // lalr1.cc:859 + case 100: +#line 497 "parser.ypp" // lalr1.cc:859 { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1634 "parser.tab.cpp" // lalr1.cc:859 +#line 2072 "parser.tab.cpp" // lalr1.cc:859 break; - case 81: -#line 386 "parser.ypp" // lalr1.cc:859 + case 101: +#line 498 "parser.ypp" // lalr1.cc:859 { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1640 "parser.tab.cpp" // lalr1.cc:859 +#line 2078 "parser.tab.cpp" // lalr1.cc:859 break; - case 82: -#line 387 "parser.ypp" // lalr1.cc:859 + case 102: +#line 499 "parser.ypp" // lalr1.cc:859 { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1646 "parser.tab.cpp" // lalr1.cc:859 +#line 2084 "parser.tab.cpp" // lalr1.cc:859 break; - case 83: -#line 388 "parser.ypp" // lalr1.cc:859 + case 103: +#line 500 "parser.ypp" // lalr1.cc:859 { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1652 "parser.tab.cpp" // lalr1.cc:859 +#line 2090 "parser.tab.cpp" // lalr1.cc:859 break; - case 84: -#line 389 "parser.ypp" // lalr1.cc:859 + case 104: +#line 501 "parser.ypp" // lalr1.cc:859 { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1658 "parser.tab.cpp" // lalr1.cc:859 +#line 2096 "parser.tab.cpp" // lalr1.cc:859 break; - case 85: -#line 390 "parser.ypp" // lalr1.cc:859 + case 105: +#line 502 "parser.ypp" // lalr1.cc:859 { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } -#line 1664 "parser.tab.cpp" // lalr1.cc:859 +#line 2102 "parser.tab.cpp" // lalr1.cc:859 break; - case 86: -#line 397 "parser.ypp" // lalr1.cc:859 + case 106: +#line 503 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2108 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 107: +#line 504 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2114 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 108: +#line 505 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2120 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 109: +#line 506 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2126 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 110: +#line 507 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2132 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 111: +#line 508 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2138 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 112: +#line 509 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2144 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 113: +#line 510 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2150 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 114: +#line 511 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2156 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 115: +#line 512 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValue) = new EnumValue(yylhs.location, strdup((yystack_[0].value.str))); } +#line 2162 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 116: +#line 519 "parser.ypp" // lalr1.cc:859 { (yylhs.value.arrayValue) = new ListValue(yylhs.location, new std::vector>()); } -#line 1670 "parser.tab.cpp" // lalr1.cc:859 +#line 2168 "parser.tab.cpp" // lalr1.cc:859 break; - case 87: -#line 398 "parser.ypp" // lalr1.cc:859 + case 117: +#line 520 "parser.ypp" // lalr1.cc:859 { (yylhs.value.arrayValue) = new ListValue(yylhs.location, (yystack_[1].value.valueList)); } -#line 1676 "parser.tab.cpp" // lalr1.cc:859 +#line 2174 "parser.tab.cpp" // lalr1.cc:859 break; - case 88: -#line 401 "parser.ypp" // lalr1.cc:859 + case 118: +#line 523 "parser.ypp" // lalr1.cc:859 { (yylhs.value.valueList) = new std::vector>(); (yylhs.value.valueList)->emplace_back((yystack_[0].value.value)); } -#line 1682 "parser.tab.cpp" // lalr1.cc:859 +#line 2180 "parser.tab.cpp" // lalr1.cc:859 break; - case 89: -#line 402 "parser.ypp" // lalr1.cc:859 + case 119: +#line 524 "parser.ypp" // lalr1.cc:859 { (yystack_[1].value.valueList)->emplace_back((yystack_[0].value.value)); (yylhs.value.valueList) = (yystack_[1].value.valueList); } -#line 1688 "parser.tab.cpp" // lalr1.cc:859 +#line 2186 "parser.tab.cpp" // lalr1.cc:859 break; - case 90: -#line 406 "parser.ypp" // lalr1.cc:859 + case 120: +#line 528 "parser.ypp" // lalr1.cc:859 { (yylhs.value.arrayValue) = new ListValue(yylhs.location, new std::vector>()); } -#line 1694 "parser.tab.cpp" // lalr1.cc:859 +#line 2192 "parser.tab.cpp" // lalr1.cc:859 break; - case 91: -#line 407 "parser.ypp" // lalr1.cc:859 + case 121: +#line 529 "parser.ypp" // lalr1.cc:859 { (yylhs.value.arrayValue) = new ListValue(yylhs.location, (yystack_[1].value.valueList)); } -#line 1700 "parser.tab.cpp" // lalr1.cc:859 +#line 2198 "parser.tab.cpp" // lalr1.cc:859 break; - case 92: -#line 411 "parser.ypp" // lalr1.cc:859 + case 122: +#line 533 "parser.ypp" // lalr1.cc:859 { (yylhs.value.valueList) = new std::vector>(); (yylhs.value.valueList)->emplace_back((yystack_[0].value.value)); } -#line 1706 "parser.tab.cpp" // lalr1.cc:859 +#line 2204 "parser.tab.cpp" // lalr1.cc:859 break; - case 93: -#line 412 "parser.ypp" // lalr1.cc:859 + case 123: +#line 534 "parser.ypp" // lalr1.cc:859 { (yystack_[1].value.valueList)->emplace_back((yystack_[0].value.value)); (yylhs.value.valueList) = (yystack_[1].value.valueList); } -#line 1712 "parser.tab.cpp" // lalr1.cc:859 +#line 2210 "parser.tab.cpp" // lalr1.cc:859 break; - case 94: -#line 417 "parser.ypp" // lalr1.cc:859 + case 124: +#line 539 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectValue) = new ObjectValue(yylhs.location, new std::vector>()); } -#line 1718 "parser.tab.cpp" // lalr1.cc:859 +#line 2216 "parser.tab.cpp" // lalr1.cc:859 break; - case 95: -#line 418 "parser.ypp" // lalr1.cc:859 + case 125: +#line 540 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectValue) = new ObjectValue(yylhs.location, (yystack_[1].value.objectFieldList)); } -#line 1724 "parser.tab.cpp" // lalr1.cc:859 +#line 2222 "parser.tab.cpp" // lalr1.cc:859 break; - case 96: -#line 422 "parser.ypp" // lalr1.cc:859 + case 126: +#line 544 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectFieldList) = new std::vector>(); (yylhs.value.objectFieldList)->emplace_back((yystack_[0].value.objectField)); } -#line 1730 "parser.tab.cpp" // lalr1.cc:859 +#line 2228 "parser.tab.cpp" // lalr1.cc:859 break; - case 97: -#line 423 "parser.ypp" // lalr1.cc:859 + case 127: +#line 545 "parser.ypp" // lalr1.cc:859 { (yystack_[1].value.objectFieldList)->emplace_back((yystack_[0].value.objectField)); (yylhs.value.objectFieldList) = (yystack_[1].value.objectFieldList); } -#line 1736 "parser.tab.cpp" // lalr1.cc:859 +#line 2234 "parser.tab.cpp" // lalr1.cc:859 break; - case 98: -#line 426 "parser.ypp" // lalr1.cc:859 + case 128: +#line 548 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectField) = new ObjectField(yylhs.location, (yystack_[2].value.name), (yystack_[0].value.value)); } -#line 1742 "parser.tab.cpp" // lalr1.cc:859 +#line 2240 "parser.tab.cpp" // lalr1.cc:859 break; - case 99: -#line 430 "parser.ypp" // lalr1.cc:859 + case 129: +#line 552 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectValue) = new ObjectValue(yylhs.location, new std::vector>()); } -#line 1748 "parser.tab.cpp" // lalr1.cc:859 +#line 2246 "parser.tab.cpp" // lalr1.cc:859 break; - case 100: -#line 431 "parser.ypp" // lalr1.cc:859 + case 130: +#line 553 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectValue) = new ObjectValue(yylhs.location, (yystack_[1].value.objectFieldList)); } -#line 1754 "parser.tab.cpp" // lalr1.cc:859 +#line 2252 "parser.tab.cpp" // lalr1.cc:859 break; - case 101: -#line 435 "parser.ypp" // lalr1.cc:859 + case 131: +#line 557 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectFieldList) = new std::vector>(); (yylhs.value.objectFieldList)->emplace_back((yystack_[0].value.objectField)); } -#line 1760 "parser.tab.cpp" // lalr1.cc:859 +#line 2258 "parser.tab.cpp" // lalr1.cc:859 break; - case 102: -#line 436 "parser.ypp" // lalr1.cc:859 + case 132: +#line 558 "parser.ypp" // lalr1.cc:859 { (yystack_[1].value.objectFieldList)->emplace_back((yystack_[0].value.objectField)); (yylhs.value.objectFieldList) = (yystack_[1].value.objectFieldList); } -#line 1766 "parser.tab.cpp" // lalr1.cc:859 +#line 2264 "parser.tab.cpp" // lalr1.cc:859 break; - case 103: -#line 439 "parser.ypp" // lalr1.cc:859 + case 133: +#line 561 "parser.ypp" // lalr1.cc:859 { (yylhs.value.objectField) = new ObjectField(yylhs.location, (yystack_[2].value.name), (yystack_[0].value.value)); } -#line 1772 "parser.tab.cpp" // lalr1.cc:859 +#line 2270 "parser.tab.cpp" // lalr1.cc:859 break; - case 105: -#line 447 "parser.ypp" // lalr1.cc:859 + case 135: +#line 569 "parser.ypp" // lalr1.cc:859 { (yylhs.value.directiveList) = nullptr; } -#line 1778 "parser.tab.cpp" // lalr1.cc:859 +#line 2276 "parser.tab.cpp" // lalr1.cc:859 break; - case 107: -#line 451 "parser.ypp" // lalr1.cc:859 + case 137: +#line 573 "parser.ypp" // lalr1.cc:859 { (yylhs.value.directiveList) = new std::vector>(); (yylhs.value.directiveList)->emplace_back((yystack_[0].value.directive)); } -#line 1784 "parser.tab.cpp" // lalr1.cc:859 +#line 2282 "parser.tab.cpp" // lalr1.cc:859 break; - case 108: -#line 452 "parser.ypp" // lalr1.cc:859 + case 138: +#line 574 "parser.ypp" // lalr1.cc:859 { (yystack_[1].value.directiveList)->emplace_back((yystack_[0].value.directive)); (yylhs.value.directiveList) = (yystack_[1].value.directiveList); } -#line 1790 "parser.tab.cpp" // lalr1.cc:859 +#line 2288 "parser.tab.cpp" // lalr1.cc:859 break; - case 109: -#line 455 "parser.ypp" // lalr1.cc:859 + case 139: +#line 577 "parser.ypp" // lalr1.cc:859 { (yylhs.value.directive) = new Directive(yylhs.location, (yystack_[1].value.name), (yystack_[0].value.argumentList)); } -#line 1796 "parser.tab.cpp" // lalr1.cc:859 +#line 2294 "parser.tab.cpp" // lalr1.cc:859 break; - case 110: -#line 460 "parser.ypp" // lalr1.cc:859 + case 140: +#line 582 "parser.ypp" // lalr1.cc:859 { (yylhs.value.type) = static_cast((yystack_[0].value.namedType)); } -#line 1802 "parser.tab.cpp" // lalr1.cc:859 +#line 2300 "parser.tab.cpp" // lalr1.cc:859 break; - case 111: -#line 461 "parser.ypp" // lalr1.cc:859 + case 141: +#line 583 "parser.ypp" // lalr1.cc:859 { (yylhs.value.type) = static_cast((yystack_[0].value.listType)); } -#line 1808 "parser.tab.cpp" // lalr1.cc:859 +#line 2306 "parser.tab.cpp" // lalr1.cc:859 break; - case 112: -#line 462 "parser.ypp" // lalr1.cc:859 + case 142: +#line 584 "parser.ypp" // lalr1.cc:859 { (yylhs.value.type) = static_cast((yystack_[0].value.nonNullType)); } -#line 1814 "parser.tab.cpp" // lalr1.cc:859 +#line 2312 "parser.tab.cpp" // lalr1.cc:859 break; - case 113: -#line 465 "parser.ypp" // lalr1.cc:859 + case 143: +#line 587 "parser.ypp" // lalr1.cc:859 { (yylhs.value.namedType) = new NamedType(yylhs.location, (yystack_[0].value.name)); } -#line 1820 "parser.tab.cpp" // lalr1.cc:859 +#line 2318 "parser.tab.cpp" // lalr1.cc:859 break; - case 114: -#line 468 "parser.ypp" // lalr1.cc:859 + case 144: +#line 590 "parser.ypp" // lalr1.cc:859 { (yylhs.value.listType) = new ListType(yylhs.location, (yystack_[1].value.type)); } -#line 1826 "parser.tab.cpp" // lalr1.cc:859 +#line 2324 "parser.tab.cpp" // lalr1.cc:859 break; - case 115: -#line 471 "parser.ypp" // lalr1.cc:859 + case 145: +#line 593 "parser.ypp" // lalr1.cc:859 { (yylhs.value.nonNullType) = new NonNullType(yylhs.location, (yystack_[1].value.namedType)); } -#line 1832 "parser.tab.cpp" // lalr1.cc:859 +#line 2330 "parser.tab.cpp" // lalr1.cc:859 break; - case 116: -#line 472 "parser.ypp" // lalr1.cc:859 + case 146: +#line 594 "parser.ypp" // lalr1.cc:859 { (yylhs.value.nonNullType) = new NonNullType(yylhs.location, (yystack_[1].value.listType)); } -#line 1838 "parser.tab.cpp" // lalr1.cc:859 +#line 2336 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 147: +#line 599 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.schemaDefinition) = new SchemaDefinition(yylhs.location, (yystack_[3].value.directiveList), (yystack_[1].value.operationTypeDefinitionList)); } +#line 2342 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 148: +#line 603 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationTypeDefinitionList) = new std::vector>(); (yylhs.value.operationTypeDefinitionList)->emplace_back((yystack_[0].value.operationTypeDefinition)); } +#line 2348 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 149: +#line 604 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.operationTypeDefinitionList)->emplace_back((yystack_[0].value.operationTypeDefinition)); (yylhs.value.operationTypeDefinitionList) = (yystack_[1].value.operationTypeDefinitionList); } +#line 2354 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 150: +#line 608 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.operationTypeDefinition) = new OperationTypeDefinition(yylhs.location, (yystack_[2].value.heapStr), (yystack_[0].value.namedType)); } +#line 2360 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 151: +#line 611 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.scalarTypeDefinition) = new ScalarTypeDefinition(yylhs.location, (yystack_[1].value.name), (yystack_[0].value.directiveList)); } +#line 2366 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 152: +#line 614 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.objectTypeDefinition) = new ObjectTypeDefinition(yylhs.location, (yystack_[5].value.name), (yystack_[4].value.typeNameList), (yystack_[3].value.directiveList), (yystack_[1].value.fieldDefinitionList)); } +#line 2372 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 153: +#line 617 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.typeNameList) = nullptr; } +#line 2378 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 154: +#line 618 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.typeNameList) = (yystack_[0].value.typeNameList); } +#line 2384 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 155: +#line 621 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.typeNameList) = new std::vector>(); (yylhs.value.typeNameList)->emplace_back((yystack_[0].value.namedType)); } +#line 2390 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 156: +#line 622 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.typeNameList)->emplace_back((yystack_[0].value.namedType)); (yylhs.value.typeNameList) = (yystack_[1].value.typeNameList); } +#line 2396 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 157: +#line 625 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.fieldDefinition) = new FieldDefinition(yylhs.location, (yystack_[4].value.name), (yystack_[3].value.inputValueDefinitionList), (yystack_[1].value.type), (yystack_[0].value.directiveList)); } +#line 2402 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 158: +#line 629 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.fieldDefinitionList) = new std::vector>(); (yylhs.value.fieldDefinitionList)->emplace_back((yystack_[0].value.fieldDefinition)); } +#line 2408 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 159: +#line 630 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.fieldDefinitionList)->emplace_back((yystack_[0].value.fieldDefinition)); (yylhs.value.fieldDefinitionList) = (yystack_[1].value.fieldDefinitionList); } +#line 2414 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 160: +#line 633 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.inputValueDefinitionList) = nullptr; } +#line 2420 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 161: +#line 634 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.inputValueDefinitionList) = (yystack_[0].value.inputValueDefinitionList); } +#line 2426 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 162: +#line 637 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.inputValueDefinitionList) = (yystack_[1].value.inputValueDefinitionList); } +#line 2432 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 163: +#line 640 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.inputValueDefinitionList) = new std::vector>(); (yylhs.value.inputValueDefinitionList)->emplace_back((yystack_[0].value.inputValueDefinition)); } +#line 2438 "parser.tab.cpp" // lalr1.cc:859 break; + case 164: +#line 641 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.inputValueDefinitionList)->emplace_back((yystack_[0].value.inputValueDefinition)); (yylhs.value.inputValueDefinitionList) = (yystack_[1].value.inputValueDefinitionList); } +#line 2444 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 165: +#line 644 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.inputValueDefinition) = new InputValueDefinition(yylhs.location, (yystack_[4].value.name), (yystack_[2].value.type), (yystack_[1].value.value), (yystack_[0].value.directiveList)); } +#line 2450 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 166: +#line 646 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.interfaceTypeDefinition) = new InterfaceTypeDefinition(yylhs.location, (yystack_[4].value.name), (yystack_[3].value.directiveList), (yystack_[1].value.fieldDefinitionList)); } +#line 2456 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 167: +#line 649 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.unionTypeDefinition) = new UnionTypeDefinition(yylhs.location, (yystack_[3].value.name), (yystack_[2].value.directiveList), (yystack_[0].value.typeNameList)); } +#line 2462 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 168: +#line 652 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.typeNameList) = new std::vector>(); (yylhs.value.typeNameList)->emplace_back((yystack_[0].value.namedType)); } +#line 2468 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 169: +#line 653 "parser.ypp" // lalr1.cc:859 + { (yystack_[2].value.typeNameList)->emplace_back((yystack_[0].value.namedType)); (yylhs.value.typeNameList) = (yystack_[2].value.typeNameList); } +#line 2474 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 170: +#line 656 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumTypeDefinition) = new EnumTypeDefinition(yylhs.location, (yystack_[4].value.name), (yystack_[3].value.directiveList), (yystack_[1].value.enumValueDefinitionList)); } +#line 2480 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 171: +#line 659 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValueDefinition) = new EnumValueDefinition(yylhs.location, (yystack_[1].value.name), (yystack_[0].value.directiveList)); } +#line 2486 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 172: +#line 663 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.enumValueDefinitionList) = new std::vector>(); (yylhs.value.enumValueDefinitionList)->emplace_back((yystack_[0].value.enumValueDefinition)); } +#line 2492 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 173: +#line 664 "parser.ypp" // lalr1.cc:859 + { (yystack_[1].value.enumValueDefinitionList)->emplace_back((yystack_[0].value.enumValueDefinition)); (yylhs.value.enumValueDefinitionList) = (yystack_[1].value.enumValueDefinitionList); } +#line 2498 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 174: +#line 667 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.inputObjectTypeDefinition) = new InputObjectTypeDefinition(yylhs.location, (yystack_[4].value.name), (yystack_[3].value.directiveList), (yystack_[1].value.inputValueDefinitionList)); } +#line 2504 "parser.tab.cpp" // lalr1.cc:859 + break; -#line 1842 "parser.tab.cpp" // lalr1.cc:859 + case 175: +#line 670 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.typeExtensionDefinition) = new TypeExtensionDefinition(yylhs.location, (yystack_[0].value.objectTypeDefinition)); } +#line 2510 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 176: +#line 673 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.directiveDefinition) = new DirectiveDefinition(yylhs.location, (yystack_[3].value.name), (yystack_[2].value.inputValueDefinitionList), (yystack_[0].value.nameList)); } +#line 2516 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 177: +#line 677 "parser.ypp" // lalr1.cc:859 + { (yylhs.value.nameList) = new std::vector>(); (yylhs.value.nameList)->emplace_back((yystack_[0].value.name)); } +#line 2522 "parser.tab.cpp" // lalr1.cc:859 + break; + + case 178: +#line 678 "parser.ypp" // lalr1.cc:859 + { (yystack_[2].value.nameList)->emplace_back((yystack_[0].value.name)); (yylhs.value.nameList) = (yystack_[2].value.nameList); } +#line 2528 "parser.tab.cpp" // lalr1.cc:859 + break; + + +#line 2532 "parser.tab.cpp" // lalr1.cc:859 default: break; } @@ -2093,228 +2783,381 @@ namespace yy { } - const signed char GraphQLParserImpl::yypact_ninf_ = -105; + const short int GraphQLParserImpl::yypact_ninf_ = -228; const signed char GraphQLParserImpl::yytable_ninf_ = -1; const short int GraphQLParserImpl::yypact_[] = { - 8, 403, -105, -105, -105, 274, 9, -105, 8, -105, - -105, 395, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, 21, -105, 286, -105, 73, 249, -105, -105, - -105, -105, -105, -105, -105, 56, 395, 395, 395, 17, - -105, 18, 17, -105, 395, 395, -105, 17, -105, -105, - 24, 70, -105, 18, -105, 17, -105, 17, 39, -105, - -105, -105, 40, 301, -105, 39, 18, -105, -9, 44, - -105, -105, 18, -105, 18, 18, -105, 149, -105, -105, - 17, -105, -105, -105, -105, 312, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -105, 91, 328, -105, - -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, 18, 312, 48, 49, 55, -105, -105, - -105, 118, -105, 57, 337, -105, -105, 51, 224, -105, - -105, -105, -105, -105, -105, 149, -105, -105, -105, 174, - 362, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, 199, -105, 65, 370, -105, -105, -105, - 224, -105, -105, -105 + 198, -11, 895, 6, 918, 895, 895, -228, -228, 895, + 13, -228, 895, 895, 440, 50, -228, 198, -228, -228, + -228, 895, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, 895, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, 13, -228, 58, 13, 13, 13, + 895, -228, 44, 13, -228, 79, 13, 475, 74, 405, + -228, -228, -228, -228, -228, -228, -228, 76, 54, 52, + 895, 65, 67, -228, 94, 100, -228, 895, 13, 84, + 895, 13, 89, 895, 895, -228, 13, -228, -228, 87, + 88, -228, 89, 895, 109, -228, 895, -228, 13, -228, + 895, 895, -228, 99, 68, -228, -228, 895, 95, 895, + 13, -228, -228, 101, 510, -228, 94, 89, -228, -9, + 103, -228, -228, 89, -228, 104, 545, -228, 895, 13, + -228, 580, 89, 615, 54, -228, 650, 895, -228, -228, + -228, 895, -228, 102, 89, 265, -228, -228, 13, -228, + -228, -228, -228, 685, -228, 685, -228, -228, -228, 106, + -228, -228, -228, -228, -228, 105, -228, -228, -228, 720, + 895, -228, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, -228, -228, -228, -228, + 150, 755, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, 89, 685, 112, 110, + 111, -228, 112, 895, 685, -228, -228, -228, -228, 228, + -228, 115, 790, -228, -228, 113, 370, -228, -228, -228, + -228, 13, -228, 13, -228, -228, 265, -228, -228, -228, + 300, 825, -228, -228, -228, -228, -228, -228, -228, -228, + -228, -228, -228, -228, -228, -228, 335, -228, 118, 860, + -228, -228, -228, 370, -228, -228, -228 }; const unsigned char GraphQLParserImpl::yydefact_[] = { - 0, 0, 26, 25, 27, 0, 0, 2, 15, 16, - 18, 13, 20, 19, 4, 5, 6, 7, 8, 9, - 10, 3, 0, 12, 105, 11, 47, 0, 39, 41, - 42, 43, 1, 17, 14, 0, 0, 0, 0, 105, - 106, 0, 104, 107, 0, 0, 48, 105, 36, 40, - 0, 0, 21, 0, 113, 105, 56, 105, 47, 52, - 54, 108, 0, 0, 49, 47, 37, 31, 0, 0, - 29, 22, 0, 23, 0, 0, 109, 0, 46, 50, - 105, 38, 44, 28, 30, 0, 24, 55, 53, 78, - 81, 82, 79, 84, 83, 85, 77, 0, 0, 66, - 67, 68, 80, 57, 51, 58, 59, 60, 61, 62, - 63, 64, 65, 37, 0, 33, 110, 111, 112, 86, - 88, 0, 94, 0, 0, 96, 45, 0, 0, 32, - 34, 115, 116, 87, 89, 0, 95, 97, 114, 0, - 0, 69, 70, 71, 35, 72, 73, 74, 75, 76, - 98, 90, 92, 0, 99, 0, 0, 101, 91, 93, - 0, 100, 102, 103 + 0, 0, 0, 0, 0, 0, 0, 46, 45, 0, + 135, 47, 0, 0, 0, 0, 2, 25, 26, 30, + 28, 23, 40, 29, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 0, 3, 4, 5, 6, 7, 9, + 10, 11, 12, 13, 14, 22, 15, 16, 17, 18, + 19, 20, 8, 21, 135, 175, 0, 135, 135, 135, + 0, 136, 0, 134, 137, 153, 135, 135, 67, 0, + 59, 61, 62, 63, 1, 27, 24, 0, 160, 0, + 0, 0, 0, 151, 67, 0, 138, 0, 135, 0, + 0, 135, 0, 0, 0, 68, 135, 56, 60, 0, + 0, 41, 0, 0, 0, 161, 0, 143, 135, 76, + 0, 0, 139, 0, 0, 148, 155, 154, 0, 0, + 135, 72, 74, 0, 0, 69, 67, 57, 51, 0, + 0, 49, 42, 0, 43, 0, 0, 163, 0, 135, + 172, 0, 0, 0, 160, 158, 0, 0, 147, 149, + 156, 0, 168, 167, 0, 0, 66, 70, 135, 58, + 64, 48, 50, 0, 44, 0, 162, 164, 177, 176, + 171, 170, 173, 75, 174, 0, 166, 159, 150, 0, + 0, 73, 100, 101, 102, 98, 103, 105, 106, 107, + 108, 99, 110, 109, 111, 112, 113, 97, 114, 115, + 0, 0, 86, 87, 88, 104, 77, 71, 78, 79, + 80, 81, 82, 83, 84, 85, 57, 0, 53, 140, + 141, 142, 53, 0, 0, 152, 169, 116, 118, 0, + 124, 0, 0, 126, 65, 0, 0, 52, 54, 145, + 146, 135, 178, 135, 117, 119, 0, 125, 127, 144, + 0, 0, 89, 90, 91, 55, 92, 93, 94, 95, + 96, 165, 157, 128, 120, 122, 0, 129, 0, 0, + 131, 121, 123, 0, 130, 132, 133 }; - const signed char + const short int GraphQLParserImpl::yypgoto_[] = { - -105, -105, 7, -5, -105, -105, -105, 81, -105, -105, - -105, -105, -43, 13, -105, -105, -30, -22, -105, 75, - -105, -105, -39, -105, 29, -105, -105, -105, 66, -94, - -104, -91, -82, -86, -78, -76, -74, -105, -105, -105, - -105, -105, -105, -20, -105, -105, -51, -19, -37, -105, - 64, -7, -84, -105, -105 + -228, -228, 1, -2, -228, -228, -228, 128, -228, -228, + -52, -228, -228, -84, 17, -87, -228, -64, -69, -228, + 81, -228, -228, -82, -228, 24, -228, -228, -228, 61, + -194, -227, -218, -193, -224, -189, -180, -161, -228, -228, + -228, -228, -228, -228, -61, -228, -228, -97, -12, -37, + -228, 119, -164, -53, -228, -228, -228, -228, 59, -228, + 171, -228, -228, -138, 25, 31, -228, 71, -29, -228, + -228, -228, -228, 47, -228, -228, -228, -228, -228 }; const short int GraphQLParserImpl::yydefgoto_[] = { - -1, 6, 25, 54, 35, 7, 8, 9, 10, 11, - 51, 68, 103, 70, 129, 130, 12, 82, 27, 28, - 29, 46, 47, 63, 64, 30, 31, 13, 55, 104, - 105, 106, 107, 144, 108, 109, 110, 111, 121, 148, - 153, 112, 124, 125, 149, 156, 157, 40, 41, 42, - 43, 115, 56, 117, 118 + -1, 15, 53, 107, 77, 16, 17, 18, 19, 20, + 21, 100, 129, 206, 131, 237, 238, 22, 160, 69, + 70, 71, 95, 96, 124, 125, 72, 73, 23, 108, + 207, 208, 209, 210, 255, 211, 212, 213, 214, 229, + 259, 266, 215, 232, 233, 260, 269, 270, 61, 62, + 63, 64, 218, 219, 220, 221, 24, 114, 115, 25, + 26, 88, 117, 145, 146, 104, 105, 136, 137, 27, + 28, 153, 29, 140, 141, 30, 31, 32, 169 }; - const unsigned char + const unsigned short int GraphQLParserImpl::yytable_[] = { - 26, 116, 59, 120, 83, 52, 34, 69, 22, 32, - 66, 60, 1, 2, 67, 3, 53, 4, 74, 76, - 75, 71, 26, 73, 141, 69, 80, 134, 5, 36, - 116, 39, 72, 58, 38, 141, 81, 142, 5, 62, - 65, 150, 86, 113, 87, 88, 143, 67, 142, 141, - 145, 44, 146, 152, 147, 77, 141, 143, 62, 85, - 131, 145, 142, 146, 128, 147, 132, 159, 50, 142, - 138, 143, 135, 38, 163, 145, 5, 146, 143, 147, - 160, 84, 145, 81, 146, 44, 147, 38, 45, 33, - 5, 126, 79, 123, 89, 90, 91, 92, 93, 94, - 95, 96, 49, 57, 137, 162, 61, 127, 0, 97, - 119, 98, 0, 0, 67, 99, 100, 101, 102, 123, - 0, 89, 90, 91, 92, 93, 94, 95, 96, 0, - 0, 0, 0, 0, 0, 155, 97, 133, 98, 0, - 0, 67, 99, 100, 101, 102, 0, 0, 0, 0, - 0, 155, 89, 90, 91, 92, 93, 94, 95, 96, - 0, 0, 0, 0, 0, 0, 0, 97, 0, 98, - 0, 0, 67, 99, 100, 101, 102, 89, 90, 91, - 92, 93, 94, 95, 96, 0, 0, 0, 0, 0, - 0, 0, 139, 151, 140, 0, 0, 0, 99, 100, - 101, 102, 89, 90, 91, 92, 93, 94, 95, 96, - 0, 0, 0, 0, 0, 0, 0, 139, 158, 140, - 0, 0, 0, 99, 100, 101, 102, 89, 90, 91, - 92, 93, 94, 95, 96, 0, 0, 0, 0, 0, - 0, 0, 139, 0, 140, 0, 0, 0, 99, 100, - 101, 102, 14, 15, 16, 17, 18, 23, 19, 20, - 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, - 0, 48, 0, 0, 0, 0, 21, 14, 15, 16, - 17, 18, 23, 19, 20, 0, 0, 0, 24, 14, - 15, 16, 17, 18, 37, 19, 20, 0, 0, 0, - 0, 21, 0, 38, 14, 15, 16, 17, 18, 23, - 19, 20, 0, 21, 78, 14, 15, 16, 17, 18, - 23, 19, 20, 0, 0, 0, 0, 0, 21, 0, - 114, 14, 15, 16, 17, 18, 23, 19, 20, 21, - 14, 15, 16, 17, 18, 23, 19, 20, 0, 0, - 122, 0, 0, 0, 0, 21, 0, 0, 0, 136, - 0, 0, 0, 0, 21, 14, 15, 16, 17, 18, - 23, 19, 20, 14, 15, 16, 17, 18, 23, 19, - 20, 0, 0, 0, 154, 0, 0, 0, 0, 21, - 0, 0, 161, 0, 0, 0, 0, 21, 14, 15, - 16, 17, 18, 23, 19, 20, 14, 15, 16, 17, - 18, 0, 19, 20, 0, 0, 0, 0, 0, 0, - 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, - 21 + 54, 222, 112, 57, 58, 56, 228, 59, 177, 252, + 65, 66, 68, 101, 161, 130, 33, 79, 253, 76, + 81, 82, 83, 252, 128, 12, 265, 109, 122, 89, + 92, 78, 253, 113, 116, 245, 132, 109, 134, 252, + 60, 177, 272, 254, 158, 130, 252, 256, 253, 276, + 74, 118, 263, 235, 121, 253, 257, 254, 84, 127, + 243, 256, 113, 159, 150, 102, 152, 68, 91, 164, + 257, 142, 80, 254, 85, 258, 103, 256, 173, 7, + 254, 8, 106, 154, 256, 11, 257, 87, 133, 258, + 181, 123, 126, 257, 178, 110, 93, 111, 99, 94, + 148, 135, 170, 60, 139, 258, 14, 167, 135, 144, + 119, 7, 258, 8, 167, 60, 93, 11, 14, 14, + 128, 216, 123, 138, 147, 151, 155, 226, 163, 165, + 224, 239, 240, 180, 135, 241, 168, 223, 236, 139, + 246, 135, 249, 273, 144, 75, 162, 234, 157, 144, + 98, 120, 159, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 248, 275, 149, 55, 175, 179, 144, 200, 227, + 201, 143, 86, 128, 202, 203, 204, 205, 172, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, + 0, 1, 2, 3, 261, 4, 262, 5, 6, 7, + 0, 8, 0, 9, 10, 11, 0, 12, 13, 0, + 0, 242, 0, 0, 0, 0, 0, 0, 14, 0, + 231, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 268, + 0, 0, 0, 0, 0, 0, 200, 244, 201, 0, + 0, 128, 202, 203, 204, 205, 0, 268, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 0, 0, 0, 0, + 0, 0, 0, 200, 0, 201, 0, 0, 128, 202, + 203, 204, 205, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 0, 0, 0, 0, 0, 0, 0, 250, 264, + 251, 0, 0, 0, 202, 203, 204, 205, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 0, 0, 0, 0, + 0, 0, 0, 250, 271, 251, 0, 0, 0, 202, + 203, 204, 205, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 0, 0, 0, 0, 0, 0, 0, 250, 0, + 251, 0, 0, 0, 202, 203, 204, 205, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 67, + 0, 0, 0, 0, 0, 0, 0, 97, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 0, 67, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 90, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 156, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 166, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 171, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 174, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 176, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 0, 0, 0, 217, 0, 0, 0, 0, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 225, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 247, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 267, 0, 0, + 0, 0, 52, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 274, 0, 0, 0, 0, 52, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, + 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 52, 46, 47, 48, 49, 50, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 52 }; const short int GraphQLParserImpl::yycheck_[] = { - 5, 85, 39, 97, 13, 35, 11, 50, 1, 0, - 47, 41, 4, 5, 23, 7, 35, 9, 55, 58, - 57, 51, 27, 53, 128, 68, 65, 121, 20, 8, - 114, 24, 51, 38, 17, 139, 66, 128, 20, 44, - 45, 135, 72, 80, 74, 75, 128, 23, 139, 153, - 128, 12, 128, 139, 128, 15, 160, 139, 63, 15, - 11, 139, 153, 139, 16, 139, 11, 153, 12, 160, - 19, 153, 15, 17, 160, 153, 20, 153, 160, 153, - 15, 68, 160, 113, 160, 12, 160, 17, 15, 8, - 20, 113, 63, 98, 3, 4, 5, 6, 7, 8, - 9, 10, 27, 37, 124, 156, 42, 114, -1, 18, - 19, 20, -1, -1, 23, 24, 25, 26, 27, 124, - -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, - -1, -1, -1, -1, -1, 140, 18, 19, 20, -1, - -1, 23, 24, 25, 26, 27, -1, -1, -1, -1, - -1, 156, 3, 4, 5, 6, 7, 8, 9, 10, - -1, -1, -1, -1, -1, -1, -1, 18, -1, 20, - -1, -1, 23, 24, 25, 26, 27, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - -1, -1, 18, 19, 20, -1, -1, -1, 24, 25, - 26, 27, 3, 4, 5, 6, 7, 8, 9, 10, - -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, - -1, -1, -1, 24, 25, 26, 27, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, - 26, 27, 3, 4, 5, 6, 7, 8, 9, 10, - -1, -1, -1, 14, -1, -1, -1, -1, -1, -1, - -1, 22, -1, -1, -1, -1, 27, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, 14, 3, - 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, - -1, 27, -1, 17, 3, 4, 5, 6, 7, 8, - 9, 10, -1, 27, 13, 3, 4, 5, 6, 7, - 8, 9, 10, -1, -1, -1, -1, -1, 27, -1, - 18, 3, 4, 5, 6, 7, 8, 9, 10, 27, - 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, - 22, -1, -1, -1, -1, 27, -1, -1, -1, 22, - -1, -1, -1, -1, 27, 3, 4, 5, 6, 7, - 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, - 10, -1, -1, -1, 22, -1, -1, -1, -1, 27, - -1, -1, 22, -1, -1, -1, -1, 27, 3, 4, - 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, - 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, + 2, 165, 84, 5, 6, 4, 200, 9, 146, 236, + 12, 13, 14, 77, 23, 99, 27, 54, 236, 21, + 57, 58, 59, 250, 33, 19, 250, 80, 92, 66, + 67, 33, 250, 85, 87, 229, 100, 90, 102, 266, + 27, 179, 266, 236, 126, 129, 273, 236, 266, 273, + 0, 88, 246, 217, 91, 273, 236, 250, 60, 96, + 224, 250, 114, 127, 117, 77, 119, 69, 67, 133, + 250, 108, 14, 266, 30, 236, 22, 266, 142, 11, + 273, 13, 30, 120, 273, 17, 266, 8, 100, 250, + 154, 93, 94, 273, 147, 30, 22, 30, 22, 25, + 32, 103, 139, 27, 106, 266, 30, 136, 110, 111, + 26, 11, 273, 13, 143, 27, 22, 17, 30, 30, + 33, 158, 124, 14, 25, 30, 25, 180, 25, 25, + 25, 21, 21, 31, 136, 222, 138, 31, 26, 141, + 25, 143, 29, 25, 146, 17, 129, 216, 124, 151, + 69, 90, 216, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 232, 269, 114, 3, 144, 151, 179, 28, 29, + 30, 110, 63, 33, 34, 35, 36, 37, 141, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 201, + -1, 3, 4, 5, 241, 7, 243, 9, 10, 11, + -1, 13, -1, 15, 16, 17, -1, 19, 20, -1, + -1, 223, -1, -1, -1, -1, -1, -1, 30, -1, + 232, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 251, + -1, -1, -1, -1, -1, -1, 28, 29, 30, -1, + -1, 33, 34, 35, 36, 37, -1, 269, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, 28, -1, 30, -1, -1, 33, 34, + 35, 36, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, 28, 29, + 30, -1, -1, -1, 34, 35, 36, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, 28, 29, 30, -1, -1, -1, 34, + 35, 36, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, 28, -1, + 30, -1, -1, -1, 34, 35, 36, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, 24, + -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, 24, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, - 27 + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, 23, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, 23, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, + -1, -1, 37, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 32, -1, -1, -1, -1, 37, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, + -1, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 37, 15, 16, 17, 18, 19, 20, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37 }; const unsigned char GraphQLParserImpl::yystos_[] = { - 0, 4, 5, 7, 9, 20, 29, 33, 34, 35, - 36, 37, 44, 55, 3, 4, 5, 6, 7, 9, - 10, 27, 30, 8, 14, 30, 31, 46, 47, 48, - 53, 54, 0, 35, 31, 32, 8, 8, 17, 30, - 75, 76, 77, 78, 12, 15, 49, 50, 22, 47, - 12, 38, 44, 75, 31, 56, 80, 56, 31, 76, - 44, 78, 31, 51, 52, 31, 76, 23, 39, 40, - 41, 44, 75, 44, 76, 76, 50, 15, 13, 52, - 50, 44, 45, 13, 41, 15, 44, 44, 44, 3, - 4, 5, 6, 7, 8, 9, 10, 18, 20, 24, - 25, 26, 27, 40, 57, 58, 59, 60, 62, 63, - 64, 65, 69, 76, 18, 79, 80, 81, 82, 19, - 57, 66, 22, 31, 70, 71, 45, 79, 16, 42, - 43, 11, 11, 19, 57, 15, 22, 71, 19, 18, - 20, 58, 59, 60, 61, 62, 63, 64, 67, 72, - 57, 19, 61, 68, 22, 31, 73, 74, 19, 61, - 15, 22, 74, 61 + 0, 3, 4, 5, 7, 9, 10, 11, 13, 15, + 16, 17, 19, 20, 30, 39, 43, 44, 45, 46, + 47, 48, 55, 66, 94, 97, 98, 107, 108, 110, + 113, 114, 115, 27, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 37, 40, 41, 98, 40, 41, 41, 41, + 27, 86, 87, 88, 89, 41, 41, 24, 41, 57, + 58, 59, 64, 65, 0, 45, 41, 42, 41, 87, + 14, 87, 87, 87, 41, 30, 89, 8, 99, 87, + 14, 40, 87, 22, 25, 60, 61, 32, 58, 22, + 49, 55, 86, 22, 103, 104, 30, 41, 67, 91, + 30, 30, 61, 48, 95, 96, 91, 100, 87, 26, + 67, 87, 55, 41, 62, 63, 41, 87, 33, 50, + 51, 52, 55, 86, 55, 41, 105, 106, 14, 41, + 111, 112, 87, 105, 41, 101, 102, 25, 32, 96, + 91, 30, 91, 109, 87, 25, 23, 63, 61, 55, + 56, 23, 52, 25, 55, 25, 23, 106, 41, 116, + 87, 32, 111, 55, 32, 103, 32, 101, 91, 102, + 31, 55, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 28, 30, 34, 35, 36, 37, 51, 68, 69, 70, + 71, 73, 74, 75, 76, 80, 87, 28, 90, 91, + 92, 93, 90, 31, 25, 32, 91, 29, 68, 77, + 32, 41, 81, 82, 56, 90, 26, 53, 54, 21, + 21, 53, 41, 90, 29, 68, 25, 32, 82, 29, + 28, 30, 69, 70, 71, 72, 73, 74, 75, 78, + 83, 87, 87, 68, 29, 72, 79, 32, 41, 84, + 85, 29, 72, 25, 32, 85, 72 }; const unsigned char GraphQLParserImpl::yyr1_[] = { - 0, 28, 29, 30, 30, 30, 30, 30, 30, 30, - 30, 31, 31, 32, 32, 33, 34, 34, 35, 35, - 36, 36, 36, 36, 36, 37, 37, 37, 38, 39, - 39, 40, 41, 42, 42, 43, 44, 45, 45, 46, - 46, 47, 47, 47, 48, 48, 49, 50, 50, 51, - 51, 52, 53, 54, 54, 55, 56, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 58, 59, 60, 61, - 61, 61, 61, 61, 61, 61, 61, 62, 62, 63, - 64, 64, 64, 64, 64, 64, 65, 65, 66, 66, - 67, 67, 68, 68, 69, 69, 70, 70, 71, 72, - 72, 73, 73, 74, 75, 76, 76, 77, 77, 78, - 79, 79, 79, 80, 81, 82, 82 + 0, 38, 39, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 41, 41, 42, 42, 43, 44, 44, 45, 45, + 45, 46, 46, 46, 46, 46, 46, 46, 46, 46, + 47, 47, 47, 47, 47, 48, 48, 48, 49, 50, + 50, 51, 52, 53, 53, 54, 55, 56, 56, 57, + 57, 58, 58, 58, 59, 59, 60, 61, 61, 62, + 62, 63, 64, 65, 65, 66, 67, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 69, 70, 71, 72, + 72, 72, 72, 72, 72, 72, 72, 73, 73, 74, + 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 76, 76, 77, 77, + 78, 78, 79, 79, 80, 80, 81, 81, 82, 83, + 83, 84, 84, 85, 86, 87, 87, 88, 88, 89, + 90, 90, 90, 91, 92, 93, 93, 94, 95, 95, + 96, 97, 98, 99, 99, 100, 100, 101, 102, 102, + 103, 103, 104, 105, 105, 106, 107, 108, 109, 109, + 110, 111, 112, 112, 113, 114, 115, 116, 116 }; const unsigned char GraphQLParserImpl::yyr2_[] = { 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 4, 5, 1, 1, 1, 3, 1, 2, 1, 4, 0, 1, 2, 3, 0, 1, 1, 2, 1, 1, 1, 4, 6, 3, 0, 1, 1, 2, 3, 3, 5, 3, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 2, 3, 1, 2, 2, 3, 1, 2, 3, 2, 3, 1, 2, 3, 1, 0, 1, 1, 2, 3, - 1, 1, 1, 1, 3, 2, 2 + 1, 1, 1, 1, 3, 2, 2, 5, 1, 2, + 3, 3, 7, 0, 2, 1, 2, 5, 1, 2, + 0, 1, 3, 1, 2, 5, 6, 5, 1, 3, + 6, 2, 1, 2, 6, 2, 6, 1, 3 }; @@ -2324,13 +3167,15 @@ namespace yy { const char* const GraphQLParserImpl::yytname_[] = { - "EOF", "error", "$undefined", "\"false\"", "\"fragment\"", - "\"mutation\"", "\"null\"", "\"query\"", "\"on\"", "\"subscription\"", - "\"true\"", "\"!\"", "\"(\"", "\")\"", "\"...\"", "\":\"", "\"=\"", + "EOF", "error", "$undefined", "\"directive\"", "\"enum\"", "\"extend\"", + "\"false\"", "\"fragment\"", "\"implements\"", "\"input\"", + "\"interface\"", "\"mutation\"", "\"null\"", "\"query\"", "\"on\"", + "\"scalar\"", "\"schema\"", "\"subscription\"", "\"true\"", "\"type\"", + "\"union\"", "\"!\"", "\"(\"", "\")\"", "\"...\"", "\":\"", "\"=\"", "\"@\"", "\"[\"", "\"]\"", "\"{\"", "\"|\"", "\"}\"", "VARIABLE", "INTEGER", "FLOAT", "STRING", "IDENTIFIER", "$accept", "start", "fragment_name", "name", "name_opt", "document", "definition_list", - "definition", "operation_definition", "operation_type", + "definition", "schema_gate", "operation_definition", "operation_type", "variable_definitions", "variable_definition_list", "variable", "variable_definition", "default_value_opt", "default_value", "selection_set", "selection_set_opt", "selection_list", "selection", @@ -2342,25 +3187,41 @@ namespace yy { "object_field_list", "object_field", "object_value_const", "object_field_const_list", "object_field_const", "directives", "directives_opt", "directive_list", "directive", "type", "type_name", - "list_type", "non_null_type", YY_NULLPTR + "list_type", "non_null_type", "schema_definition", + "operation_type_definition_list", "operation_type_definition", + "scalar_type_definition", "object_type_definition", + "implements_interfaces_opt", "type_name_list", "field_definition", + "field_definition_list", "arguments_definition_opt", + "arguments_definition", "input_value_definition_list", + "input_value_definition", "interface_type_definition", + "union_type_definition", "union_members", "enum_type_definition", + "enum_value_definition", "enum_value_definition_list", + "input_object_type_definition", "type_extension_definition", + "directive_definition", "directive_locations", YY_NULLPTR }; #if YYDEBUG const unsigned short int GraphQLParserImpl::yyrline_[] = { - 0, 219, 219, 224, 225, 226, 227, 228, 229, 230, - 231, 234, 235, 239, 240, 245, 248, 249, 252, 253, - 259, 260, 261, 262, 263, 266, 267, 268, 272, 276, - 277, 280, 284, 288, 289, 292, 296, 300, 301, 303, - 304, 307, 308, 309, 312, 313, 316, 319, 320, 323, - 324, 327, 332, 336, 337, 341, 344, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 359, 362, 365, 368, - 369, 370, 371, 372, 373, 374, 375, 378, 379, 382, - 385, 386, 387, 388, 389, 390, 397, 398, 401, 402, - 406, 407, 411, 412, 417, 418, 422, 423, 426, 430, - 431, 435, 436, 439, 444, 447, 448, 451, 452, 455, - 460, 461, 462, 465, 468, 471, 472 + 0, 300, 300, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 325, 326, 330, 331, 336, 339, 340, 343, 344, + 345, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 371, 372, 373, 374, 375, 378, 379, 380, 384, 388, + 389, 392, 396, 400, 401, 404, 408, 412, 413, 415, + 416, 419, 420, 421, 424, 425, 428, 431, 432, 435, + 436, 439, 444, 448, 449, 453, 456, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 471, 474, 477, 480, + 481, 482, 483, 484, 485, 486, 487, 490, 491, 494, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 519, 520, 523, 524, + 528, 529, 533, 534, 539, 540, 544, 545, 548, 552, + 553, 557, 558, 561, 566, 569, 570, 573, 574, 577, + 582, 583, 584, 587, 590, 593, 594, 599, 603, 604, + 608, 611, 614, 617, 618, 621, 622, 625, 629, 630, + 633, 634, 637, 640, 641, 644, 646, 649, 652, 653, + 656, 659, 663, 664, 667, 670, 673, 677, 678 }; // Print the state stack on the debug stream. @@ -2429,9 +3290,10 @@ namespace yy { 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27 + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37 }; - const unsigned int user_token_number_max_ = 282; + const unsigned int user_token_number_max_ = 292; const token_number_type undef_token_ = 2; if (static_cast(t) <= yyeof_) @@ -2444,8 +3306,9 @@ namespace yy { } // yy -#line 2448 "parser.tab.cpp" // lalr1.cc:1167 -#line 474 "parser.ypp" // lalr1.cc:1168 +#line 3310 "parser.tab.cpp" // lalr1.cc:1167 +#line 681 "parser.ypp" // lalr1.cc:1168 + void yy::GraphQLParserImpl::error(const yy::location &loc, const std::string &str) { std::ostringstream out; diff --git a/parser.tab.hpp b/parser.tab.hpp index ec8ed86..8c17e21 100644 --- a/parser.tab.hpp +++ b/parser.tab.hpp @@ -80,6 +80,30 @@ using facebook::graphql::ast::NamedType; using facebook::graphql::ast::ListType; using facebook::graphql::ast::NonNullType; +// Experimental schema support. +using facebook::graphql::ast::SchemaDefinition; +using facebook::graphql::ast::ScalarTypeDefinition; +using facebook::graphql::ast::ObjectTypeDefinition; +using facebook::graphql::ast::InterfaceTypeDefinition; +using facebook::graphql::ast::UnionTypeDefinition; +using facebook::graphql::ast::EnumTypeDefinition; +using facebook::graphql::ast::InputObjectTypeDefinition; +using facebook::graphql::ast::TypeExtensionDefinition; +using facebook::graphql::ast::DirectiveDefinition; +using facebook::graphql::ast::SchemaDefinition; +using facebook::graphql::ast::OperationTypeDefinition; +using facebook::graphql::ast::ScalarTypeDefinition; +using facebook::graphql::ast::ObjectTypeDefinition; +using facebook::graphql::ast::FieldDefinition; +using facebook::graphql::ast::InputValueDefinition; +using facebook::graphql::ast::InterfaceTypeDefinition; +using facebook::graphql::ast::UnionTypeDefinition; +using facebook::graphql::ast::EnumTypeDefinition; +using facebook::graphql::ast::EnumValueDefinition; +using facebook::graphql::ast::InputObjectTypeDefinition; +using facebook::graphql::ast::TypeExtensionDefinition; +using facebook::graphql::ast::DirectiveDefinition; + union yystype { \ const char *str; \ const char *heapStr; \ @@ -120,12 +144,34 @@ union yystype { \ std::vector> *valueList; \ std::vector> *objectFieldList; \ std::vector> *directiveList; \ + \ + SchemaDefinition *schemaDefinition; \ + ScalarTypeDefinition *scalarTypeDefinition; \ + ObjectTypeDefinition *objectTypeDefinition; \ + InterfaceTypeDefinition *interfaceTypeDefinition; \ + UnionTypeDefinition *unionTypeDefinition; \ + EnumTypeDefinition *enumTypeDefinition; \ + InputObjectTypeDefinition *inputObjectTypeDefinition; \ + TypeExtensionDefinition *typeExtensionDefinition; \ + DirectiveDefinition *directiveDefinition; \ + OperationTypeDefinition *operationTypeDefinition; \ + InputValueDefinition *inputValueDefinition; \ + FieldDefinition *fieldDefinition; \ + EnumValueDefinition *enumValueDefinition; \ + \ + std::vector> *operationTypeDefinitionList; \ + std::vector> *typeNameList; \ + std::vector> *inputValueDefinitionList; \ + std::vector> *fieldDefinitionList; \ + std::vector> *nameList; \ + std::vector> *enumValueDefinitionList; \ }; #define YYSTYPE union yystype #define YYLTYPE yy::location -#line 129 "parser.tab.hpp" // lalr1.cc:392 + +#line 175 "parser.tab.hpp" // lalr1.cc:392 # include // std::abort @@ -197,7 +243,7 @@ union yystype { \ namespace yy { -#line 201 "parser.tab.hpp" // lalr1.cc:392 +#line 247 "parser.tab.hpp" // lalr1.cc:392 @@ -229,31 +275,41 @@ namespace yy { enum yytokentype { TOK_EOF = 0, - TOK_FALSE = 258, - TOK_FRAGMENT = 259, - TOK_MUTATION = 260, - TOK_NULL = 261, - TOK_QUERY = 262, - TOK_ON = 263, - TOK_SUBSCRIPTION = 264, - TOK_TRUE = 265, - TOK_BANG = 266, - TOK_LPAREN = 267, - TOK_RPAREN = 268, - TOK_ELLIPSIS = 269, - TOK_COLON = 270, - TOK_EQUAL = 271, - TOK_AT = 272, - TOK_LBRACKET = 273, - TOK_RBRACKET = 274, - TOK_LBRACE = 275, - TOK_PIPE = 276, - TOK_RBRACE = 277, - TOK_VARIABLE = 278, - TOK_INTEGER = 279, - TOK_FLOAT = 280, - TOK_STRING = 281, - TOK_IDENTIFIER = 282 + TOK_DIRECTIVE = 258, + TOK_ENUM = 259, + TOK_EXTEND = 260, + TOK_FALSE = 261, + TOK_FRAGMENT = 262, + TOK_IMPLEMENTS = 263, + TOK_INPUT = 264, + TOK_INTERFACE = 265, + TOK_MUTATION = 266, + TOK_NULL = 267, + TOK_QUERY = 268, + TOK_ON = 269, + TOK_SCALAR = 270, + TOK_SCHEMA = 271, + TOK_SUBSCRIPTION = 272, + TOK_TRUE = 273, + TOK_TYPE = 274, + TOK_UNION = 275, + TOK_BANG = 276, + TOK_LPAREN = 277, + TOK_RPAREN = 278, + TOK_ELLIPSIS = 279, + TOK_COLON = 280, + TOK_EQUAL = 281, + TOK_AT = 282, + TOK_LBRACKET = 283, + TOK_RBRACKET = 284, + TOK_LBRACE = 285, + TOK_PIPE = 286, + TOK_RBRACE = 287, + TOK_VARIABLE = 288, + TOK_INTEGER = 289, + TOK_FLOAT = 290, + TOK_STRING = 291, + TOK_IDENTIFIER = 292 }; }; @@ -358,7 +414,7 @@ namespace yy { /// Build a parser object. - GraphQLParserImpl (Node **outAST_yyarg, const char **outError_yyarg, void *scanner_yyarg); + GraphQLParserImpl (bool enableSchema_yyarg, Node **outAST_yyarg, const char **outError_yyarg, void *scanner_yyarg); virtual ~GraphQLParserImpl (); /// Parse. @@ -414,7 +470,7 @@ namespace yy { /// \param yyvalue the value to check static bool yy_table_value_is_error_ (int yyvalue); - static const signed char yypact_ninf_; + static const short int yypact_ninf_; static const signed char yytable_ninf_; /// Convert a scanner token number \a t to a symbol number. @@ -431,7 +487,7 @@ namespace yy { static const unsigned char yydefact_[]; // YYPGOTO[NTERM-NUM]. - static const signed char yypgoto_[]; + static const short int yypgoto_[]; // YYDEFGOTO[NTERM-NUM]. static const short int yydefgoto_[]; @@ -439,7 +495,7 @@ namespace yy { // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If // positive, shift that token. If negative, reduce the rule whose // number is the opposite. If YYTABLE_NINF, syntax error. - static const unsigned char yytable_[]; + static const unsigned short int yytable_[]; static const short int yycheck_[]; @@ -561,16 +617,17 @@ namespace yy { enum { yyeof_ = 0, - yylast_ = 430, ///< Last index in yytable_. - yynnts_ = 55, ///< Number of nonterminal symbols. - yyfinal_ = 32, ///< Termination state number. + yylast_ = 955, ///< Last index in yytable_. + yynnts_ = 79, ///< Number of nonterminal symbols. + yyfinal_ = 74, ///< Termination state number. yyterror_ = 1, yyerrcode_ = 256, - yyntokens_ = 28 ///< Number of tokens. + yyntokens_ = 38 ///< Number of tokens. }; // User arguments. + bool enableSchema; Node **outAST; const char **outError; void *scanner; @@ -579,7 +636,7 @@ namespace yy { } // yy -#line 583 "parser.tab.hpp" // lalr1.cc:392 +#line 640 "parser.tab.hpp" // lalr1.cc:392 diff --git a/parser.ypp b/parser.ypp index ea99259..2afbcac 100644 --- a/parser.ypp +++ b/parser.ypp @@ -58,6 +58,30 @@ using facebook::graphql::ast::NamedType; using facebook::graphql::ast::ListType; using facebook::graphql::ast::NonNullType; +// Experimental schema support. +using facebook::graphql::ast::SchemaDefinition; +using facebook::graphql::ast::ScalarTypeDefinition; +using facebook::graphql::ast::ObjectTypeDefinition; +using facebook::graphql::ast::InterfaceTypeDefinition; +using facebook::graphql::ast::UnionTypeDefinition; +using facebook::graphql::ast::EnumTypeDefinition; +using facebook::graphql::ast::InputObjectTypeDefinition; +using facebook::graphql::ast::TypeExtensionDefinition; +using facebook::graphql::ast::DirectiveDefinition; +using facebook::graphql::ast::SchemaDefinition; +using facebook::graphql::ast::OperationTypeDefinition; +using facebook::graphql::ast::ScalarTypeDefinition; +using facebook::graphql::ast::ObjectTypeDefinition; +using facebook::graphql::ast::FieldDefinition; +using facebook::graphql::ast::InputValueDefinition; +using facebook::graphql::ast::InterfaceTypeDefinition; +using facebook::graphql::ast::UnionTypeDefinition; +using facebook::graphql::ast::EnumTypeDefinition; +using facebook::graphql::ast::EnumValueDefinition; +using facebook::graphql::ast::InputObjectTypeDefinition; +using facebook::graphql::ast::TypeExtensionDefinition; +using facebook::graphql::ast::DirectiveDefinition; + union yystype { \ const char *str; \ const char *heapStr; \ @@ -98,14 +122,36 @@ union yystype { \ std::vector> *valueList; \ std::vector> *objectFieldList; \ std::vector> *directiveList; \ + \ + SchemaDefinition *schemaDefinition; \ + ScalarTypeDefinition *scalarTypeDefinition; \ + ObjectTypeDefinition *objectTypeDefinition; \ + InterfaceTypeDefinition *interfaceTypeDefinition; \ + UnionTypeDefinition *unionTypeDefinition; \ + EnumTypeDefinition *enumTypeDefinition; \ + InputObjectTypeDefinition *inputObjectTypeDefinition; \ + TypeExtensionDefinition *typeExtensionDefinition; \ + DirectiveDefinition *directiveDefinition; \ + OperationTypeDefinition *operationTypeDefinition; \ + InputValueDefinition *inputValueDefinition; \ + FieldDefinition *fieldDefinition; \ + EnumValueDefinition *enumValueDefinition; \ + \ + std::vector> *operationTypeDefinitionList; \ + std::vector> *typeNameList; \ + std::vector> *inputValueDefinitionList; \ + std::vector> *fieldDefinitionList; \ + std::vector> *nameList; \ + std::vector> *enumValueDefinitionList; \ }; #define YYSTYPE union yystype #define YYLTYPE yy::location + } %lex-param { void *scanner } -%parse-param { Node **outAST } { const char **outError } { void *scanner } +%parse-param { bool enableSchema } { Node **outAST } { const char **outError } { void *scanner } %locations @@ -116,14 +162,24 @@ union yystype { \ } %token EOF 0 +%token DIRECTIVE "directive" +%token ENUM "enum" +%token EXTEND "extend" %token FALSE "false" %token FRAGMENT "fragment" +%token IMPLEMENTS "implements" +%token INPUT "input" +%token INTERFACE "interface" %token MUTATION "mutation" %token NULL "null" %token QUERY "query" %token ON "on" +%token SCALAR "scalar" +%token SCHEMA "schema" %token SUBSCRIPTION "subscription" %token TRUE "true" +%token TYPE "type" +%token UNION "union" %token BANG "!" %token LPAREN "(" %token RPAREN ")" @@ -156,6 +212,7 @@ union yystype { \ %type definition_list %type definition +%type schema_gate %type operation_definition %type variable_definitions @@ -207,6 +264,30 @@ union yystype { \ %type operation_type +%type schema_definition; +%type scalar_type_definition; +%type object_type_definition; +%type interface_type_definition; +%type union_type_definition; +%type enum_type_definition; +%type input_object_type_definition; +%type type_extension_definition; +%type directive_definition; +%type operation_type_definition; +%type operation_type_definition_list; +%type type_name_list; +%type implements_interfaces_opt; +%type union_members; +%type field_definition; +%type field_definition_list; +%type arguments_definition_opt; +%type arguments_definition; +%type input_value_definition_list; +%type input_value_definition; +%type enum_value_definition; +%type directive_locations; +%type enum_value_definition_list; + %destructor { } %destructor { free((void *)$$); } %destructor { } /* we steal it and put it in outAST, don't free! */ @@ -221,14 +302,24 @@ start: document { *outAST = $1; } /* All of the non-identifier tokens are to accommodate various flavors of name that don't include those tokens. */ -fragment_name: IDENTIFIER { $$ = new Name(@1, strdup($1)); } +fragment_name: DIRECTIVE { $$ = new Name(@1, strdup($1)); } + | ENUM { $$ = new Name(@1, strdup($1)); } + | EXTEND { $$ = new Name(@1, strdup($1)); } | FALSE { $$ = new Name(@1, strdup($1)); } | FRAGMENT { $$ = new Name(@1, strdup($1)); } + | IDENTIFIER { $$ = new Name(@1, strdup($1)); } + | IMPLEMENTS { $$ = new Name(@1, strdup($1)); } + | INPUT { $$ = new Name(@1, strdup($1)); } + | INTERFACE { $$ = new Name(@1, strdup($1)); } | MUTATION { $$ = new Name(@1, strdup($1)); } | NULL { $$ = new Name(@1, strdup($1)); } | QUERY { $$ = new Name(@1, strdup($1)); } + | SCALAR { $$ = new Name(@1, strdup($1)); } + | SCHEMA { $$ = new Name(@1, strdup($1)); } | SUBSCRIPTION { $$ = new Name(@1, strdup($1)); } | TRUE { $$ = new Name(@1, strdup($1)); } + | TYPE { $$ = new Name(@1, strdup($1)); } + | UNION { $$ = new Name(@1, strdup($1)); } ; name: fragment_name @@ -250,7 +341,28 @@ definition_list:definition { $$ = new std::vector>() ; definition: operation_definition { $$ = static_cast($1); } - | fragment_definition { $$ = static_cast($1);} + | fragment_definition { $$ = static_cast($1); } + | schema_gate { + if (!enableSchema) { + error(@$, "schema support disabled"); + // %destructor doesn't work with YYERROR. See + // https://www.gnu.org/software/bison/manual/html_node/Destructor-Decl.html + delete $$; + YYERROR; + } + $$ = static_cast($1); + } + ; + +schema_gate: schema_definition { $$ = static_cast($1); } + | scalar_type_definition { $$ = static_cast($1); } + | object_type_definition { $$ = static_cast($1); } + | interface_type_definition { $$ = static_cast($1); } + | union_type_definition { $$ = static_cast($1); } + | enum_type_definition { $$ = static_cast($1); } + | input_object_type_definition { $$ = static_cast($1); } + | type_extension_definition { $$ = static_cast($1); } + | directive_definition { $$ = static_cast($1); } ; @@ -382,12 +494,22 @@ boolean_value: TRUE { $$ = new BooleanValue(@$, true); } null_value: NULL { $$ = new NullValue(@$); } ; -enum_value: IDENTIFIER { $$ = new EnumValue(@$, strdup($1)); } +enum_value: DIRECTIVE { $$ = new EnumValue(@$, strdup($1)); } + | ENUM { $$ = new EnumValue(@$, strdup($1)); } + | EXTEND { $$ = new EnumValue(@$, strdup($1)); } | FRAGMENT { $$ = new EnumValue(@$, strdup($1)); } + | IDENTIFIER { $$ = new EnumValue(@$, strdup($1)); } + | IMPLEMENTS { $$ = new EnumValue(@$, strdup($1)); } + | INPUT { $$ = new EnumValue(@$, strdup($1)); } + | INTERFACE { $$ = new EnumValue(@$, strdup($1)); } | MUTATION { $$ = new EnumValue(@$, strdup($1)); } | ON { $$ = new EnumValue(@$, strdup($1)); } | QUERY { $$ = new EnumValue(@$, strdup($1)); } + | SCALAR { $$ = new EnumValue(@$, strdup($1)); } + | SCHEMA { $$ = new EnumValue(@$, strdup($1)); } | SUBSCRIPTION { $$ = new EnumValue(@$, strdup($1)); } + | TYPE { $$ = new EnumValue(@$, strdup($1)); } + | UNION { $$ = new EnumValue(@$, strdup($1)); } ; /* 2.2.7.6 List Value */ @@ -471,7 +593,93 @@ list_type: "[" type "]" { $$ = new ListType(@$, $2); } non_null_type: type_name "!" { $$ = new NonNullType(@$, $1); } | list_type "!" { $$ = new NonNullType(@$, $1); } ; + +/* Experimental schema parsing support. */ + +schema_definition: SCHEMA directives_opt "{" operation_type_definition_list "}" { $$ = new SchemaDefinition(@$, $2, $4); } + ; + +operation_type_definition_list: + operation_type_definition { $$ = new std::vector>(); $$->emplace_back($1); } + | operation_type_definition_list operation_type_definition { $1->emplace_back($2); $$ = $1; } + ; + +operation_type_definition: + operation_type ":" type_name { $$ = new OperationTypeDefinition(@$, $1, $3); } + ; + +scalar_type_definition: SCALAR name directives_opt { $$ = new ScalarTypeDefinition(@$, $2, $3); } + ; + +object_type_definition: TYPE name implements_interfaces_opt directives_opt "{" field_definition_list "}" { $$ = new ObjectTypeDefinition(@$, $2, $3, $4, $6); } + ; + +implements_interfaces_opt: %empty { $$ = nullptr; } + | IMPLEMENTS type_name_list { $$ = $2; } + ; + +type_name_list: type_name { $$ = new std::vector>(); $$->emplace_back($1); } + | type_name_list type_name { $1->emplace_back($2); $$ = $1; } + ; + +field_definition: name arguments_definition_opt ":" type directives_opt { $$ = new FieldDefinition(@$, $1, $2, $4, $5); } + ; + +field_definition_list: + field_definition { $$ = new std::vector>(); $$->emplace_back($1); } + | field_definition_list field_definition { $1->emplace_back($2); $$ = $1; } + ; + +arguments_definition_opt: %empty { $$ = nullptr; } + | arguments_definition { $$ = $1; } + ; + +arguments_definition: "(" input_value_definition_list ")" { $$ = $2; } + ; + +input_value_definition_list: input_value_definition { $$ = new std::vector>(); $$->emplace_back($1); } + | input_value_definition_list input_value_definition { $1->emplace_back($2); $$ = $1; } + ; + +input_value_definition: name ":" type default_value_opt directives_opt { $$ = new InputValueDefinition(@$, $1, $3, $4, $5); } + +interface_type_definition: INTERFACE name directives_opt "{" field_definition_list "}" { $$ = new InterfaceTypeDefinition(@$, $2, $3, $5); } + ; + +union_type_definition: UNION name directives_opt "=" union_members { $$ = new UnionTypeDefinition(@$, $2, $3, $5); } + ; + +union_members: type_name { $$ = new std::vector>(); $$->emplace_back($1); } + | union_members "|" type_name { $1->emplace_back($3); $$ = $1; } + ; + +enum_type_definition: ENUM name directives_opt "{" enum_value_definition_list "}" { $$ = new EnumTypeDefinition(@$, $2, $3, $5); } + ; + +enum_value_definition: name directives_opt { $$ = new EnumValueDefinition(@$, $1, $2); } + ; + +enum_value_definition_list: + enum_value_definition { $$ = new std::vector>(); $$->emplace_back($1); } + | enum_value_definition_list enum_value_definition { $1->emplace_back($2); $$ = $1; } + ; + +input_object_type_definition: INPUT name directives_opt "{" input_value_definition_list "}" { $$ = new InputObjectTypeDefinition(@$, $2, $3, $5); } + ; + +type_extension_definition: EXTEND object_type_definition { $$ = new TypeExtensionDefinition(@$, $2); } + ; + +directive_definition: DIRECTIVE "@" name arguments_definition_opt ON directive_locations { $$ = new DirectiveDefinition(@$, $3, $4, $6); } + ; + +directive_locations: + name { $$ = new std::vector>(); $$->emplace_back($1); } + | directive_locations "|" name { $1->emplace_back($3); $$ = $1; } + ; + %% + void yy::GraphQLParserImpl::error(const yy::location &loc, const std::string &str) { std::ostringstream out; out << loc << ": " << str; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index de8349f..7e22436 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,6 +10,10 @@ FILE(COPY kitchen-sink.graphql DESTINATION .) FILE(COPY kitchen-sink.json DESTINATION .) +FILE(COPY schema-kitchen-sink.graphql DESTINATION .) + +FILE(COPY schema-kitchen-sink.json DESTINATION .) + ADD_EXECUTABLE(runTests ParserTests.cpp JsonVisitorTests.cpp BuildCAPI.c) TARGET_LINK_LIBRARIES(runTests gtest gtest_main) diff --git a/test/ParserTests.cpp b/test/ParserTests.cpp index 378b4d5..6c0812d 100644 --- a/test/ParserTests.cpp +++ b/test/ParserTests.cpp @@ -25,14 +25,16 @@ static void expectError(const char *queryStr, const char *expectedError) { auto ast = parseString(queryStr, &actualError); EXPECT_FALSE(ast); - EXPECT_STREQ(expectedError, actualError); + EXPECT_STREQ(actualError, expectedError); std::free((void *)actualError); } -static void expectSuccess(const char *queryStr) { +static void expectSuccessImpl(const char *queryStr, bool enableSchema) { const char *actualError = nullptr; - auto ast = parseString(queryStr, &actualError); + auto ast = enableSchema + ? parseStringWithExperimentalSchemaSupport(queryStr, &actualError) + : parseString(queryStr, &actualError); EXPECT_TRUE(ast != nullptr); EXPECT_STREQ(nullptr, actualError); @@ -40,6 +42,14 @@ static void expectSuccess(const char *queryStr) { std::free((void *)actualError); } +static void expectSuccess(const char *queryStr) { + expectSuccessImpl(queryStr, false); +} + +static void expectSchemaSuccess(const char *queryStr) { + expectSuccessImpl(queryStr, true); +} + static void checkSimpleError() { expectError("query myquery on type { field }", "1.15-16: syntax error, unexpected on, expecting ( or @ or {"); @@ -263,19 +273,25 @@ TEST(ParserTests, AllowsNonKeywordsForNames) { } } -TEST(ParserTests, ProducesCorrectOutputForKitchenSink) { - // Make sure we produce correct saved output for - // kitchen-sink.graphql from graphql-js. - FILE *fp = fopen("test/kitchen-sink.graphql", "r"); +static void testCorrectOutputForStockFile( + const char *inputFileName, + const char *outputFileName, + bool withSchemaParsing) { + FILE *fp = fopen(inputFileName, "r"); ASSERT_NE(nullptr, fp); const char *error = nullptr; - auto ast = parseFile(fp, &error); + std::unique_ptr ast; + if (withSchemaParsing) { + ast = parseFileWithExperimentalSchemaSupport(fp, &error); + } else { + ast = parseFile(fp, &error); + } ASSERT_TRUE(ast); ASSERT_FALSE(error); fclose(fp); const char *json = graphql_ast_to_json((const struct GraphQLAstNode *)ast.get()); - std::ifstream ifs("test/kitchen-sink.json"); + std::ifstream ifs(outputFileName); std::stringstream ss; ss << ifs.rdbuf(); EXPECT_STREQ( @@ -283,3 +299,52 @@ TEST(ParserTests, ProducesCorrectOutputForKitchenSink) { ss.str().c_str()); free((void *)json); } + +TEST(ParserTests, ProducesCorrectOutputForKitchenSink) { + SCOPED_TRACE("KitchenSink"); + testCorrectOutputForStockFile( + "test/kitchen-sink.graphql", + "test/kitchen-sink.json", + false); +} + +TEST(ParserTests, ProducesCorrectOutputForSchemaKitchenSink) { + SCOPED_TRACE("SchemaKitchenSink"); + testCorrectOutputForStockFile( + "test/schema-kitchen-sink.graphql", + "test/schema-kitchen-sink.json", + true); +} + +static void expectSchemaParsing(const char *queryStr) { + char buf[strlen("1.1-XXX: schema support disabled") + 1]; + ASSERT_LT(strlen(queryStr), 999); + snprintf( + buf, + sizeof(buf), + "1.1-%lu: schema support disabled", + strlen(queryStr)); + expectError(queryStr, buf); + expectSchemaSuccess(queryStr); +} + +#define DIRECTIVES "@d1(a: 1) @d2(a: 2)" + +TEST(SchemaParserTests, SimpleSchema) { + expectSchemaParsing( + "schema " DIRECTIVES " { query: QueryType, mutation: MutType }"); + expectSchemaParsing("scalar SomeScalar " DIRECTIVES); + expectSchemaParsing("type SomeObject implements SomeInterface " DIRECTIVES + " { someField : SomeType }"); + expectSchemaParsing("interface SomeInterface " DIRECTIVES + " { someField : SomeType }"); + expectSchemaParsing("union SomeUnion " DIRECTIVES + " = SomeType | SomeOtherType"); + expectSchemaParsing("enum SomeEnum " DIRECTIVES " { VALUE, OTHER_VALUE }"); + expectSchemaParsing("input SomeInput " DIRECTIVES "{ someField: SomeType, " + "otherField: otherType }"); + expectSchemaParsing("extend type SomeType " DIRECTIVES + "{ anotherField : AnotherType }"); + expectSchemaParsing("directive @somedirective(a1 : t1 = 1 " DIRECTIVES + ", a2 : t2) on foo | bar"); +} diff --git a/test/schema-kitchen-sink.graphql b/test/schema-kitchen-sink.graphql new file mode 100644 index 0000000..d3dd1fe --- /dev/null +++ b/test/schema-kitchen-sink.graphql @@ -0,0 +1,78 @@ +# Copyright (c) 2015, Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +schema { + query: QueryType + mutation: MutationType +} + +type Foo implements Bar { + one: Type + two(argument: InputType!): Type + three(argument: InputType, other: String): Int + four(argument: String = "string"): String + five(argument: [String] = ["string", "string"]): String + six(argument: InputType = {key: "value"}): Type + seven(argument: Int = null): Type +} + +type AnnotatedObject @onObject(arg: "value") { + annotatedField(arg: Type = "default" @onArg): Type @onField +} + +interface Bar { + one: Type + four(argument: String = "string"): String +} + +interface AnnotatedInterface @onInterface { + annotatedField(arg: Type @onArg): Type @onField +} + +union Feed = Story | Article | Advert + +union AnnotatedUnion @onUnion = A | B + +scalar CustomScalar + +scalar AnnotatedScalar @onScalar + +enum Site { + DESKTOP + MOBILE +} + +enum AnnotatedEnum @onEnum { + ANNOTATED_VALUE @onEnumValue + OTHER_VALUE +} + +input InputType { + key: String! + answer: Int = 42 +} + +input AnnotatedInput @onInputObjectType { + annotatedField: Type @onField +} + +extend type Foo { + seven(argument: [String]): Type +} + +# NOTE: out-of-spec test cases commented out until the spec is clarified; see +# https://github.com/graphql/graphql-js/issues/650 . +# extend type Foo @onType {} + +#type NoFields {} + +directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT + +directive @include(if: Boolean!) + on FIELD + | FRAGMENT_SPREAD + | INLINE_FRAGMENT diff --git a/test/schema-kitchen-sink.json b/test/schema-kitchen-sink.json new file mode 100644 index 0000000..5c96efb --- /dev/null +++ b/test/schema-kitchen-sink.json @@ -0,0 +1 @@ +{"kind":"Document","loc":{"start":1,"end":21},"definitions":[{"kind":"SchemaDefinition","loc":{"start":1,"end":2},"directives":null,"operationTypes":[{"kind":"OperationTypeDefinition","loc":{"start":3,"end":19},"operation":"query","type":{"kind":"NamedType","loc":{"start":10,"end":19},"name":{"kind":"Name","loc":{"start":10,"end":19},"value":"QueryType"}}},{"kind":"OperationTypeDefinition","loc":{"start":3,"end":25},"operation":"mutation","type":{"kind":"NamedType","loc":{"start":13,"end":25},"name":{"kind":"Name","loc":{"start":13,"end":25},"value":"MutationType"}}}]},{"kind":"ObjectTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":6,"end":9},"value":"Foo"},"interfaces":[{"kind":"NamedType","loc":{"start":21,"end":24},"name":{"kind":"Name","loc":{"start":21,"end":24},"value":"Bar"}}],"directives":null,"fields":[{"kind":"FieldDefinition","loc":{"start":3,"end":12},"name":{"kind":"Name","loc":{"start":3,"end":6},"value":"one"},"arguments":null,"type":{"kind":"NamedType","loc":{"start":8,"end":12},"name":{"kind":"Name","loc":{"start":8,"end":12},"value":"Type"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":34},"name":{"kind":"Name","loc":{"start":3,"end":6},"value":"two"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":7,"end":27},"name":{"kind":"Name","loc":{"start":7,"end":15},"value":"argument"},"type":{"kind":"NonNullType","loc":{"start":17,"end":27},"type":{"kind":"NamedType","loc":{"start":17,"end":26},"name":{"kind":"Name","loc":{"start":17,"end":26},"value":"InputType"}}},"defaultValue":null,"directives":null}],"type":{"kind":"NamedType","loc":{"start":30,"end":34},"name":{"kind":"Name","loc":{"start":30,"end":34},"value":"Type"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":49},"name":{"kind":"Name","loc":{"start":3,"end":8},"value":"three"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":9,"end":28},"name":{"kind":"Name","loc":{"start":9,"end":17},"value":"argument"},"type":{"kind":"NamedType","loc":{"start":19,"end":28},"name":{"kind":"Name","loc":{"start":19,"end":28},"value":"InputType"}},"defaultValue":null,"directives":null},{"kind":"InputValueDefinition","loc":{"start":30,"end":43},"name":{"kind":"Name","loc":{"start":30,"end":35},"value":"other"},"type":{"kind":"NamedType","loc":{"start":37,"end":43},"name":{"kind":"Name","loc":{"start":37,"end":43},"value":"String"}},"defaultValue":null,"directives":null}],"type":{"kind":"NamedType","loc":{"start":46,"end":49},"name":{"kind":"Name","loc":{"start":46,"end":49},"value":"Int"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":50},"name":{"kind":"Name","loc":{"start":3,"end":7},"value":"four"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":8,"end":26},"name":{"kind":"Name","loc":{"start":8,"end":16},"value":"argument"},"type":{"kind":"NamedType","loc":{"start":18,"end":24},"name":{"kind":"Name","loc":{"start":18,"end":24},"value":"String"}},"defaultValue":{"kind":"StringValue","loc":{"start":25,"end":26},"value":"string"},"directives":null}],"type":{"kind":"NamedType","loc":{"start":44,"end":50},"name":{"kind":"Name","loc":{"start":44,"end":50},"value":"String"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":70},"name":{"kind":"Name","loc":{"start":3,"end":7},"value":"five"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":8,"end":61},"name":{"kind":"Name","loc":{"start":8,"end":16},"value":"argument"},"type":{"kind":"ListType","loc":{"start":18,"end":26},"type":{"kind":"NamedType","loc":{"start":19,"end":25},"name":{"kind":"Name","loc":{"start":19,"end":25},"value":"String"}}},"defaultValue":{"kind":"ListValue","loc":{"start":29,"end":61},"values":[{"kind":"StringValue","loc":{"start":29,"end":30},"value":"string"},{"kind":"StringValue","loc":{"start":29,"end":30},"value":"string"}]},"directives":null}],"type":{"kind":"NamedType","loc":{"start":64,"end":70},"name":{"kind":"Name","loc":{"start":64,"end":70},"value":"String"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":55},"name":{"kind":"Name","loc":{"start":3,"end":6},"value":"six"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":7,"end":48},"name":{"kind":"Name","loc":{"start":7,"end":15},"value":"argument"},"type":{"kind":"NamedType","loc":{"start":17,"end":26},"name":{"kind":"Name","loc":{"start":17,"end":26},"value":"InputType"}},"defaultValue":{"kind":"ObjectValue","loc":{"start":29,"end":48},"fields":[{"kind":"ObjectField","loc":{"start":30,"end":34},"name":{"kind":"Name","loc":{"start":30,"end":33},"value":"key"},"value":{"kind":"StringValue","loc":{"start":33,"end":34},"value":"value"}}]},"directives":null}],"type":{"kind":"NamedType","loc":{"start":51,"end":55},"name":{"kind":"Name","loc":{"start":51,"end":55},"value":"Type"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":36},"name":{"kind":"Name","loc":{"start":3,"end":8},"value":"seven"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":9,"end":29},"name":{"kind":"Name","loc":{"start":9,"end":17},"value":"argument"},"type":{"kind":"NamedType","loc":{"start":19,"end":22},"name":{"kind":"Name","loc":{"start":19,"end":22},"value":"Int"}},"defaultValue":{"kind":"NullValue","loc":{"start":25,"end":29}},"directives":null}],"type":{"kind":"NamedType","loc":{"start":32,"end":36},"name":{"kind":"Name","loc":{"start":32,"end":36},"value":"Type"}},"directives":null}]},{"kind":"ObjectTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":6,"end":21},"value":"AnnotatedObject"},"interfaces":null,"directives":[{"kind":"Directive","loc":{"start":22,"end":50},"name":{"kind":"Name","loc":{"start":23,"end":31},"value":"onObject"},"arguments":[{"kind":"Argument","loc":{"start":32,"end":36},"name":{"kind":"Name","loc":{"start":32,"end":35},"value":"arg"},"value":{"kind":"StringValue","loc":{"start":35,"end":36},"value":"value"}}]}],"fields":[{"kind":"FieldDefinition","loc":{"start":3,"end":69},"name":{"kind":"Name","loc":{"start":3,"end":17},"value":"annotatedField"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":18,"end":53},"name":{"kind":"Name","loc":{"start":18,"end":21},"value":"arg"},"type":{"kind":"NamedType","loc":{"start":23,"end":27},"name":{"kind":"Name","loc":{"start":23,"end":27},"value":"Type"}},"defaultValue":{"kind":"StringValue","loc":{"start":28,"end":29},"value":"default"},"directives":[{"kind":"Directive","loc":{"start":47,"end":53},"name":{"kind":"Name","loc":{"start":48,"end":53},"value":"onArg"},"arguments":null}]}],"type":{"kind":"NamedType","loc":{"start":56,"end":60},"name":{"kind":"Name","loc":{"start":56,"end":60},"value":"Type"}},"directives":[{"kind":"Directive","loc":{"start":61,"end":69},"name":{"kind":"Name","loc":{"start":62,"end":69},"value":"onField"},"arguments":null}]}]},{"kind":"InterfaceTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":11,"end":14},"value":"Bar"},"directives":null,"fields":[{"kind":"FieldDefinition","loc":{"start":3,"end":12},"name":{"kind":"Name","loc":{"start":3,"end":6},"value":"one"},"arguments":null,"type":{"kind":"NamedType","loc":{"start":8,"end":12},"name":{"kind":"Name","loc":{"start":8,"end":12},"value":"Type"}},"directives":null},{"kind":"FieldDefinition","loc":{"start":3,"end":50},"name":{"kind":"Name","loc":{"start":3,"end":7},"value":"four"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":8,"end":26},"name":{"kind":"Name","loc":{"start":8,"end":16},"value":"argument"},"type":{"kind":"NamedType","loc":{"start":18,"end":24},"name":{"kind":"Name","loc":{"start":18,"end":24},"value":"String"}},"defaultValue":{"kind":"StringValue","loc":{"start":25,"end":26},"value":"string"},"directives":null}],"type":{"kind":"NamedType","loc":{"start":44,"end":50},"name":{"kind":"Name","loc":{"start":44,"end":50},"value":"String"}},"directives":null}]},{"kind":"InterfaceTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":11,"end":29},"value":"AnnotatedInterface"},"directives":[{"kind":"Directive","loc":{"start":30,"end":42},"name":{"kind":"Name","loc":{"start":31,"end":42},"value":"onInterface"},"arguments":null}],"fields":[{"kind":"FieldDefinition","loc":{"start":3,"end":50},"name":{"kind":"Name","loc":{"start":3,"end":17},"value":"annotatedField"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":18,"end":34},"name":{"kind":"Name","loc":{"start":18,"end":21},"value":"arg"},"type":{"kind":"NamedType","loc":{"start":23,"end":27},"name":{"kind":"Name","loc":{"start":23,"end":27},"value":"Type"}},"defaultValue":null,"directives":[{"kind":"Directive","loc":{"start":28,"end":34},"name":{"kind":"Name","loc":{"start":29,"end":34},"value":"onArg"},"arguments":null}]}],"type":{"kind":"NamedType","loc":{"start":37,"end":41},"name":{"kind":"Name","loc":{"start":37,"end":41},"value":"Type"}},"directives":[{"kind":"Directive","loc":{"start":42,"end":50},"name":{"kind":"Name","loc":{"start":43,"end":50},"value":"onField"},"arguments":null}]}]},{"kind":"UnionTypeDefinition","loc":{"start":1,"end":38},"name":{"kind":"Name","loc":{"start":7,"end":11},"value":"Feed"},"directives":null,"types":[{"kind":"NamedType","loc":{"start":14,"end":19},"name":{"kind":"Name","loc":{"start":14,"end":19},"value":"Story"}},{"kind":"NamedType","loc":{"start":22,"end":29},"name":{"kind":"Name","loc":{"start":22,"end":29},"value":"Article"}},{"kind":"NamedType","loc":{"start":32,"end":38},"name":{"kind":"Name","loc":{"start":32,"end":38},"value":"Advert"}}]},{"kind":"UnionTypeDefinition","loc":{"start":1,"end":38},"name":{"kind":"Name","loc":{"start":7,"end":21},"value":"AnnotatedUnion"},"directives":[{"kind":"Directive","loc":{"start":22,"end":30},"name":{"kind":"Name","loc":{"start":23,"end":30},"value":"onUnion"},"arguments":null}],"types":[{"kind":"NamedType","loc":{"start":33,"end":34},"name":{"kind":"Name","loc":{"start":33,"end":34},"value":"A"}},{"kind":"NamedType","loc":{"start":37,"end":38},"name":{"kind":"Name","loc":{"start":37,"end":38},"value":"B"}}]},{"kind":"ScalarTypeDefinition","loc":{"start":1,"end":20},"name":{"kind":"Name","loc":{"start":8,"end":20},"value":"CustomScalar"},"directives":null},{"kind":"ScalarTypeDefinition","loc":{"start":1,"end":33},"name":{"kind":"Name","loc":{"start":8,"end":23},"value":"AnnotatedScalar"},"directives":[{"kind":"Directive","loc":{"start":24,"end":33},"name":{"kind":"Name","loc":{"start":25,"end":33},"value":"onScalar"},"arguments":null}]},{"kind":"EnumTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":6,"end":10},"value":"Site"},"directives":null,"values":[{"kind":"EnumValueDefinition","loc":{"start":3,"end":10},"name":{"kind":"Name","loc":{"start":3,"end":10},"value":"DESKTOP"},"directives":null},{"kind":"EnumValueDefinition","loc":{"start":3,"end":9},"name":{"kind":"Name","loc":{"start":3,"end":9},"value":"MOBILE"},"directives":null}]},{"kind":"EnumTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":6,"end":19},"value":"AnnotatedEnum"},"directives":[{"kind":"Directive","loc":{"start":20,"end":27},"name":{"kind":"Name","loc":{"start":21,"end":27},"value":"onEnum"},"arguments":null}],"values":[{"kind":"EnumValueDefinition","loc":{"start":3,"end":31},"name":{"kind":"Name","loc":{"start":3,"end":18},"value":"ANNOTATED_VALUE"},"directives":[{"kind":"Directive","loc":{"start":19,"end":31},"name":{"kind":"Name","loc":{"start":20,"end":31},"value":"onEnumValue"},"arguments":null}]},{"kind":"EnumValueDefinition","loc":{"start":3,"end":14},"name":{"kind":"Name","loc":{"start":3,"end":14},"value":"OTHER_VALUE"},"directives":null}]},{"kind":"InputObjectTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":7,"end":16},"value":"InputType"},"directives":null,"fields":[{"kind":"InputValueDefinition","loc":{"start":3,"end":15},"name":{"kind":"Name","loc":{"start":3,"end":6},"value":"key"},"type":{"kind":"NonNullType","loc":{"start":8,"end":15},"type":{"kind":"NamedType","loc":{"start":8,"end":14},"name":{"kind":"Name","loc":{"start":8,"end":14},"value":"String"}}},"defaultValue":null,"directives":null},{"kind":"InputValueDefinition","loc":{"start":3,"end":19},"name":{"kind":"Name","loc":{"start":3,"end":9},"value":"answer"},"type":{"kind":"NamedType","loc":{"start":11,"end":14},"name":{"kind":"Name","loc":{"start":11,"end":14},"value":"Int"}},"defaultValue":{"kind":"IntValue","loc":{"start":17,"end":19},"value":"42"},"directives":null}]},{"kind":"InputObjectTypeDefinition","loc":{"start":1,"end":2},"name":{"kind":"Name","loc":{"start":7,"end":21},"value":"AnnotatedInput"},"directives":[{"kind":"Directive","loc":{"start":22,"end":40},"name":{"kind":"Name","loc":{"start":23,"end":40},"value":"onInputObjectType"},"arguments":null}],"fields":[{"kind":"InputValueDefinition","loc":{"start":3,"end":32},"name":{"kind":"Name","loc":{"start":3,"end":17},"value":"annotatedField"},"type":{"kind":"NamedType","loc":{"start":19,"end":23},"name":{"kind":"Name","loc":{"start":19,"end":23},"value":"Type"}},"defaultValue":null,"directives":[{"kind":"Directive","loc":{"start":24,"end":32},"name":{"kind":"Name","loc":{"start":25,"end":32},"value":"onField"},"arguments":null}]}]},{"kind":"TypeExtensionDefinition","loc":{"start":1,"end":2},"definition":{"kind":"ObjectTypeDefinition","loc":{"start":8,"end":2},"name":{"kind":"Name","loc":{"start":13,"end":16},"value":"Foo"},"interfaces":null,"directives":null,"fields":[{"kind":"FieldDefinition","loc":{"start":3,"end":34},"name":{"kind":"Name","loc":{"start":3,"end":8},"value":"seven"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":9,"end":27},"name":{"kind":"Name","loc":{"start":9,"end":17},"value":"argument"},"type":{"kind":"ListType","loc":{"start":19,"end":27},"type":{"kind":"NamedType","loc":{"start":20,"end":26},"name":{"kind":"Name","loc":{"start":20,"end":26},"value":"String"}}},"defaultValue":null,"directives":null}],"type":{"kind":"NamedType","loc":{"start":30,"end":34},"name":{"kind":"Name","loc":{"start":30,"end":34},"value":"Type"}},"directives":null}]}},{"kind":"DirectiveDefinition","loc":{"start":1,"end":75},"name":{"kind":"Name","loc":{"start":12,"end":16},"value":"skip"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":17,"end":29},"name":{"kind":"Name","loc":{"start":17,"end":19},"value":"if"},"type":{"kind":"NonNullType","loc":{"start":21,"end":29},"type":{"kind":"NamedType","loc":{"start":21,"end":28},"name":{"kind":"Name","loc":{"start":21,"end":28},"value":"Boolean"}}},"defaultValue":null,"directives":null}],"locations":[{"kind":"Name","loc":{"start":34,"end":39},"value":"FIELD"},{"kind":"Name","loc":{"start":42,"end":57},"value":"FRAGMENT_SPREAD"},{"kind":"Name","loc":{"start":60,"end":75},"value":"INLINE_FRAGMENT"}]},{"kind":"DirectiveDefinition","loc":{"start":1,"end":21},"name":{"kind":"Name","loc":{"start":12,"end":19},"value":"include"},"arguments":[{"kind":"InputValueDefinition","loc":{"start":20,"end":32},"name":{"kind":"Name","loc":{"start":20,"end":22},"value":"if"},"type":{"kind":"NonNullType","loc":{"start":24,"end":32},"type":{"kind":"NamedType","loc":{"start":24,"end":31},"name":{"kind":"Name","loc":{"start":24,"end":31},"value":"Boolean"}}},"defaultValue":null,"directives":null}],"locations":[{"kind":"Name","loc":{"start":6,"end":11},"value":"FIELD"},{"kind":"Name","loc":{"start":6,"end":21},"value":"FRAGMENT_SPREAD"},{"kind":"Name","loc":{"start":6,"end":21},"value":"INLINE_FRAGMENT"}]}]} \ No newline at end of file