Method |
Description |
|
__construct ( Source $source, array $options = [] ) |
Parser constructor. |
|
any ( integer $openKind, callable $parseFn, integer $closeKind ) : array |
Returns a possibly empty list of parse nodes, determined by
the parseFn. This list begins with a lex token of openKind
and ends with a lex token of closeKind. Advances the parser
to the next lex token after the closing token. |
|
expect ( string $kind ) : Token |
If the next token is of the given kind, return that token after advancing
the parser. Otherwise, do not change the parser state and return false. |
|
expectKeyword ( string $value ) : Token |
If the next token is a keyword with the given value, return that token after
advancing the parser. Otherwise, do not change the parser state and return
false. |
|
loc ( Token $startToken ) : Location | null |
Returns a location object, used to identify the place in
the source that created a given parsed object. |
|
many ( $openKind, $parseFn, $closeKind ) : array |
Returns a non-empty list of parse nodes, determined by
the parseFn. This list begins with a lex token of openKind
and ends with a lex token of closeKind. Advances the parser
to the next lex token after the closing token. |
|
parse ( Source | string $source, array $options = [] ) : DocumentNode |
Available options: |
|
parseArgument ( ) : ArgumentNode |
|
|
parseArgumentDefs ( ) : InputValueDefinitionNode[] |
|
|
parseArguments ( ) : ArgumentNode[] |
|
|
parseArray ( boolean $isConst ) : ListValueNode |
|
|
parseConstValue ( ) : BooleanValueNode | EnumValueNode | FloatValueNode | IntValueNode | StringValueNode | VariableNode |
|
|
parseDefinition ( ) : OperationDefinitionNode | FragmentDefinitionNode | GraphQL\Language\AST\TypeSystemDefinitionNode |
|
|
parseDirective ( ) : DirectiveNode |
|
|
parseDirectiveDefinition ( ) : DirectiveDefinitionNode |
DirectiveDefinition :
- directive @ Name ArgumentsDefinition? on DirectiveLocations |
|
parseDirectiveLocations ( ) : NameNode[] |
|
|
parseDirectives ( ) : DirectiveNode[] |
|
|
parseDocument ( ) : DocumentNode |
Implements the parsing rules in the Document section. |
|
parseEnumTypeDefinition ( ) : EnumTypeDefinitionNode |
|
|
parseEnumValueDefinition ( ) : EnumValueDefinitionNode |
|
|
parseField ( ) : FieldNode |
|
|
parseFieldDefinition ( ) : FieldDefinitionNode |
|
|
parseFragment ( ) : FragmentSpreadNode | InlineFragmentNode |
|
|
parseFragmentDefinition ( ) : FragmentDefinitionNode |
|
|
parseFragmentName ( ) : NameNode |
|
|
parseImplementsInterfaces ( ) : NamedTypeNode[] |
|
|
parseInputObjectTypeDefinition ( ) : InputObjectTypeDefinitionNode |
|
|
parseInputValueDef ( ) : InputValueDefinitionNode |
|
|
parseInterfaceTypeDefinition ( ) : InterfaceTypeDefinitionNode |
|
|
parseName ( ) : NameNode |
Converts a name lex token into a name parse node. |
|
parseNamedType ( ) |
|
|
parseObject ( $isConst ) : ObjectValueNode |
|
|
parseObjectField ( $isConst ) : ObjectFieldNode |
|
|
parseObjectTypeDefinition ( ) : ObjectTypeDefinitionNode |
|
|
parseOperationDefinition ( ) : OperationDefinitionNode |
|
|
parseOperationType ( ) : string |
|
|
parseOperationTypeDefinition ( ) : OperationTypeDefinitionNode |
|
|
parseScalarTypeDefinition ( ) : ScalarTypeDefinitionNode |
|
|
parseSchemaDefinition ( ) : SchemaDefinitionNode |
|
|
parseSelection ( ) : mixed |
Selection :
- Field
- FragmentSpread
- InlineFragment |
|
parseSelectionSet ( ) : SelectionSetNode |
|
|
parseType ( Source | string $source, array $options = [] ) : ListTypeNode | NameNode | NonNullTypeNode |
Given a string containing a GraphQL Type (ex. [Int!]), parse the AST for
that type. |
|
parseTypeExtensionDefinition ( ) : TypeExtensionDefinitionNode |
|
|
parseTypeReference ( ) : ListTypeNode | NameNode | NonNullTypeNode |
Handles the Type: TypeName, ListType, and NonNullType parsing rules. |
|
parseTypeSystemDefinition ( ) : GraphQL\Language\AST\TypeSystemDefinitionNode |
TypeSystemDefinition :
- SchemaDefinition
- TypeDefinition
- TypeExtensionDefinition
- DirectiveDefinition |
|
parseUnionMembers ( ) : NamedTypeNode[] |
UnionMembers :
- NamedType
- UnionMembers | NamedType |
|
parseUnionTypeDefinition ( ) : UnionTypeDefinitionNode |
|
|
parseValue ( Source | string $source, array $options = [] ) : BooleanValueNode | EnumValueNode | FloatValueNode | IntValueNode | ListValueNode | ObjectValueNode | StringValueNode | VariableNode |
Given a string containing a GraphQL value (ex. [42]), parse the AST for
that value. |
|
parseValueLiteral ( $isConst ) : BooleanValueNode | EnumValueNode | FloatValueNode | IntValueNode | StringValueNode | VariableNode | ListValueNode | ObjectValueNode | NullValueNode |
Value[Const] :
- [~Const] Variable
- IntValue
- FloatValue
- StringValue
- BooleanValue
- NullValue
- EnumValue
- ListValue[?Const]
- ObjectValue[?Const] |
|
parseVariable ( ) : VariableNode |
|
|
parseVariableDefinition ( ) : VariableDefinitionNode |
|
|
parseVariableDefinitions ( ) : VariableDefinitionNode[] |
|
|
parseVariableValue ( ) : BooleanValueNode | EnumValueNode | FloatValueNode | IntValueNode | ListValueNode | ObjectValueNode | StringValueNode | VariableNode |
|
|
peek ( $kind ) : boolean |
Determines if the next token is of a given kind |
|
skip ( $kind ) : boolean |
If the next token is of the given kind, return true after advancing
the parser. Otherwise, do not change the parser state and return false. |
|
unexpected ( Token $atToken = null ) : SyntaxError |
|
|