Lexer
in package
Implementation based on Nette Tokenizer (New BSD License; https://github.com/nette/tokenizer)
Table of Contents
- LINE_OFFSET = 2
- TOKEN_ARROW = 36
- TOKEN_CLOSE_ANGLE_BRACKET = 7
- TOKEN_CLOSE_CURLY_BRACKET = 34
- TOKEN_CLOSE_PARENTHESES = 5
- TOKEN_CLOSE_PHPDOC = 16
- TOKEN_CLOSE_SQUARE_BRACKET = 9
- TOKEN_COLON = 31
- TOKEN_COMMA = 10
- TOKEN_DOCTRINE_ANNOTATION_STRING = 23
- TOKEN_DOCTRINE_TAG = 18
- TOKEN_DOUBLE_ARROW = 13
- TOKEN_DOUBLE_COLON = 12
- TOKEN_DOUBLE_QUOTED_STRING = 22
- TOKEN_END = 30
- TOKEN_EQUAL = 14
- TOKEN_FLOAT = 19
- TOKEN_HORIZONTAL_WS = 27
- TOKEN_IDENTIFIER = 24
- TOKEN_INTEGER = 20
- TOKEN_INTERSECTION = 2
- TOKEN_LABELS = [self::TOKEN_REFERENCE => ''&'', self::TOKEN_UNION => ''|'', self::TOKEN_INTERSECTION => ''&'', self::TOKEN_NULLABLE => ''?'', self::TOKEN_NEGATED => ''!'', self::TOKEN_OPEN_PARENTHESES => ''('', self::TOKEN_CLOSE_PARENTHESES => '')'', self::TOKEN_OPEN_ANGLE_BRACKET => ''<'', self::TOKEN_CLOSE_ANGLE_BRACKET => ''>'', self::TOKEN_OPEN_SQUARE_BRACKET => ''['', self::TOKEN_CLOSE_SQUARE_BRACKET => '']'', self::TOKEN_OPEN_CURLY_BRACKET => ''{'', self::TOKEN_CLOSE_CURLY_BRACKET => ''}'', self::TOKEN_COMMA => '','', self::TOKEN_COLON => '':'', self::TOKEN_VARIADIC => ''...'', self::TOKEN_DOUBLE_COLON => ''::'', self::TOKEN_DOUBLE_ARROW => ''=>'', self::TOKEN_ARROW => ''->'', self::TOKEN_EQUAL => ''='', self::TOKEN_OPEN_PHPDOC => ''/**'', self::TOKEN_CLOSE_PHPDOC => ''*/'', self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', self::TOKEN_DOCTRINE_TAG => 'TOKEN_DOCTRINE_TAG', self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', self::TOKEN_FLOAT => 'TOKEN_FLOAT', self::TOKEN_INTEGER => 'TOKEN_INTEGER', self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', self::TOKEN_DOCTRINE_ANNOTATION_STRING => 'TOKEN_DOCTRINE_ANNOTATION_STRING', self::TOKEN_IDENTIFIER => 'type', self::TOKEN_THIS_VARIABLE => ''$this'', self::TOKEN_VARIABLE => 'variable', self::TOKEN_HORIZONTAL_WS => 'TOKEN_HORIZONTAL_WS', self::TOKEN_OTHER => 'TOKEN_OTHER', self::TOKEN_END => 'TOKEN_END', self::TOKEN_WILDCARD => '*']
- TOKEN_NEGATED = 35
- TOKEN_NULLABLE = 3
- TOKEN_OPEN_ANGLE_BRACKET = 6
- TOKEN_OPEN_CURLY_BRACKET = 33
- TOKEN_OPEN_PARENTHESES = 4
- TOKEN_OPEN_PHPDOC = 15
- TOKEN_OPEN_SQUARE_BRACKET = 8
- TOKEN_OTHER = 29
- TOKEN_PHPDOC_EOL = 28
- TOKEN_PHPDOC_TAG = 17
- TOKEN_REFERENCE = 0
- TOKEN_SINGLE_QUOTED_STRING = 21
- TOKEN_THIS_VARIABLE = 25
- TOKEN_UNION = 1
- TOKEN_VARIABLE = 26
- TOKEN_VARIADIC = 11
- TOKEN_WILDCARD = 32
- TYPE_OFFSET = 1
- VALUE_OFFSET = 0
- $parseDoctrineAnnotations : bool
- $regexp : string|null
- __construct() : mixed
- tokenize() : array<int, array{: string, : int, : int}>
- generateRegexp() : string
Constants
LINE_OFFSET
public
mixed
LINE_OFFSET
= 2
TOKEN_ARROW
public
mixed
TOKEN_ARROW
= 36
TOKEN_CLOSE_ANGLE_BRACKET
public
mixed
TOKEN_CLOSE_ANGLE_BRACKET
= 7
TOKEN_CLOSE_CURLY_BRACKET
public
mixed
TOKEN_CLOSE_CURLY_BRACKET
= 34
TOKEN_CLOSE_PARENTHESES
public
mixed
TOKEN_CLOSE_PARENTHESES
= 5
TOKEN_CLOSE_PHPDOC
public
mixed
TOKEN_CLOSE_PHPDOC
= 16
TOKEN_CLOSE_SQUARE_BRACKET
public
mixed
TOKEN_CLOSE_SQUARE_BRACKET
= 9
TOKEN_COLON
public
mixed
TOKEN_COLON
= 31
TOKEN_COMMA
public
mixed
TOKEN_COMMA
= 10
TOKEN_DOCTRINE_ANNOTATION_STRING
public
mixed
TOKEN_DOCTRINE_ANNOTATION_STRING
= 23
TOKEN_DOCTRINE_TAG
public
mixed
TOKEN_DOCTRINE_TAG
= 18
TOKEN_DOUBLE_ARROW
public
mixed
TOKEN_DOUBLE_ARROW
= 13
TOKEN_DOUBLE_COLON
public
mixed
TOKEN_DOUBLE_COLON
= 12
TOKEN_DOUBLE_QUOTED_STRING
public
mixed
TOKEN_DOUBLE_QUOTED_STRING
= 22
TOKEN_END
public
mixed
TOKEN_END
= 30
TOKEN_EQUAL
public
mixed
TOKEN_EQUAL
= 14
TOKEN_FLOAT
public
mixed
TOKEN_FLOAT
= 19
TOKEN_HORIZONTAL_WS
public
mixed
TOKEN_HORIZONTAL_WS
= 27
TOKEN_IDENTIFIER
public
mixed
TOKEN_IDENTIFIER
= 24
TOKEN_INTEGER
public
mixed
TOKEN_INTEGER
= 20
TOKEN_INTERSECTION
public
mixed
TOKEN_INTERSECTION
= 2
TOKEN_LABELS
public
mixed
TOKEN_LABELS
= [self::TOKEN_REFERENCE => ''&'', self::TOKEN_UNION => ''|'', self::TOKEN_INTERSECTION => ''&'', self::TOKEN_NULLABLE => ''?'', self::TOKEN_NEGATED => ''!'', self::TOKEN_OPEN_PARENTHESES => ''('', self::TOKEN_CLOSE_PARENTHESES => '')'', self::TOKEN_OPEN_ANGLE_BRACKET => ''<'', self::TOKEN_CLOSE_ANGLE_BRACKET => ''>'', self::TOKEN_OPEN_SQUARE_BRACKET => ''['', self::TOKEN_CLOSE_SQUARE_BRACKET => '']'', self::TOKEN_OPEN_CURLY_BRACKET => ''{'', self::TOKEN_CLOSE_CURLY_BRACKET => ''}'', self::TOKEN_COMMA => '','', self::TOKEN_COLON => '':'', self::TOKEN_VARIADIC => ''...'', self::TOKEN_DOUBLE_COLON => ''::'', self::TOKEN_DOUBLE_ARROW => ''=>'', self::TOKEN_ARROW => ''->'', self::TOKEN_EQUAL => ''='', self::TOKEN_OPEN_PHPDOC => ''/**'', self::TOKEN_CLOSE_PHPDOC => ''*/'', self::TOKEN_PHPDOC_TAG => 'TOKEN_PHPDOC_TAG', self::TOKEN_DOCTRINE_TAG => 'TOKEN_DOCTRINE_TAG', self::TOKEN_PHPDOC_EOL => 'TOKEN_PHPDOC_EOL', self::TOKEN_FLOAT => 'TOKEN_FLOAT', self::TOKEN_INTEGER => 'TOKEN_INTEGER', self::TOKEN_SINGLE_QUOTED_STRING => 'TOKEN_SINGLE_QUOTED_STRING', self::TOKEN_DOUBLE_QUOTED_STRING => 'TOKEN_DOUBLE_QUOTED_STRING', self::TOKEN_DOCTRINE_ANNOTATION_STRING => 'TOKEN_DOCTRINE_ANNOTATION_STRING', self::TOKEN_IDENTIFIER => 'type', self::TOKEN_THIS_VARIABLE => ''$this'', self::TOKEN_VARIABLE => 'variable', self::TOKEN_HORIZONTAL_WS => 'TOKEN_HORIZONTAL_WS', self::TOKEN_OTHER => 'TOKEN_OTHER', self::TOKEN_END => 'TOKEN_END', self::TOKEN_WILDCARD => '*']
TOKEN_NEGATED
public
mixed
TOKEN_NEGATED
= 35
TOKEN_NULLABLE
public
mixed
TOKEN_NULLABLE
= 3
TOKEN_OPEN_ANGLE_BRACKET
public
mixed
TOKEN_OPEN_ANGLE_BRACKET
= 6
TOKEN_OPEN_CURLY_BRACKET
public
mixed
TOKEN_OPEN_CURLY_BRACKET
= 33
TOKEN_OPEN_PARENTHESES
public
mixed
TOKEN_OPEN_PARENTHESES
= 4
TOKEN_OPEN_PHPDOC
public
mixed
TOKEN_OPEN_PHPDOC
= 15
TOKEN_OPEN_SQUARE_BRACKET
public
mixed
TOKEN_OPEN_SQUARE_BRACKET
= 8
TOKEN_OTHER
public
mixed
TOKEN_OTHER
= 29
TOKEN_PHPDOC_EOL
public
mixed
TOKEN_PHPDOC_EOL
= 28
TOKEN_PHPDOC_TAG
public
mixed
TOKEN_PHPDOC_TAG
= 17
TOKEN_REFERENCE
public
mixed
TOKEN_REFERENCE
= 0
TOKEN_SINGLE_QUOTED_STRING
public
mixed
TOKEN_SINGLE_QUOTED_STRING
= 21
TOKEN_THIS_VARIABLE
public
mixed
TOKEN_THIS_VARIABLE
= 25
TOKEN_UNION
public
mixed
TOKEN_UNION
= 1
TOKEN_VARIABLE
public
mixed
TOKEN_VARIABLE
= 26
TOKEN_VARIADIC
public
mixed
TOKEN_VARIADIC
= 11
TOKEN_WILDCARD
public
mixed
TOKEN_WILDCARD
= 32
TYPE_OFFSET
public
mixed
TYPE_OFFSET
= 1
VALUE_OFFSET
public
mixed
VALUE_OFFSET
= 0
Properties
$parseDoctrineAnnotations
private
bool
$parseDoctrineAnnotations
$regexp
private
string|null
$regexp
Methods
__construct()
public
__construct([bool $parseDoctrineAnnotations = false ]) : mixed
Parameters
- $parseDoctrineAnnotations : bool = false
Return values
mixed —tokenize()
public
tokenize(string $s) : array<int, array{: string, : int, : int}>
Parameters
- $s : string
Return values
array<int, array{: string, : int, : int}> —generateRegexp()
private
generateRegexp() : string