PHP Class GraphQL\Language\Lexer

Show file Open project: webonyx/graphql-php Class Usage Examples

Public Properties

Property Type Description
$lastToken Token The previously focused non-ignored token.
$line integer The (1-indexed) line containing the current token.
$lineStart integer The character offset at which the current line begins.
$options array
$source Source
$token Token The currently focused non-ignored token.

Public Methods

Method Description
__construct ( Source $source, array $options = [] )
advance ( ) : Token
nextToken ( ) : Token

Private Methods

Method Description
assertValidStringCharacterCode ( $code, $position )
positionAfterWhitespace ( $startPosition ) : integer Reads from body starting at startPosition until it finds a non-whitespace or commented character, then returns the position of that character for lexing.
readComment ( $start, $line, $col, Token $prev ) : Token Reads a comment token from the source file.
readDigits ( $start, $firstCode ) Returns the new position in the source after reading digits.
readName ( integer $position, integer $line, integer $col, Token $prev ) : Token Reads an alphanumeric + underscore name from the source.
readNumber ( integer $start, string $firstCode, integer $line, integer $col, Token $prev ) : Token Reads a number token from the source file, either a float or an int depending on whether a decimal point appears.
readString ( integer $start, integer $line, integer $col, Token $prev ) : Token
readToken ( Token $prev ) : Token

Method Details

__construct() public method

public __construct ( Source $source, array $options = [] )
$source Source
$options array

advance() public method

public advance ( ) : Token
return Token

nextToken() public method

public nextToken ( ) : Token
return Token

Property Details

$lastToken public property

The previously focused non-ignored token.
public Token,GraphQL\Language $lastToken
return Token

$line public property

The (1-indexed) line containing the current token.
public int $line
return integer

$lineStart public property

The character offset at which the current line begins.
public int $lineStart
return integer

$options public property

public array $options
return array

$source public property

public Source,GraphQL\Language $source
return Source

$token public property

The currently focused non-ignored token.
public Token,GraphQL\Language $token
return Token