Lexer
in package
FinalYes
Table of Contents
Constants
- PATTERNS = ['[\r\n]{1,1000}', '[^\S\r\n]{1,1000}', '\\\\', '\'', '"', '\#', '\$', '([^(\s\\\\\'"\#\$)]|\(|\)){1,1000}']
- The regex for each type of token.
Methods
- lex() : Generator<string|int, string>
- Convert content into a token stream.
- __construct() : void
- This class is a singleton.
Constants
PATTERNS
The regex for each type of token.
private
mixed
PATTERNS
= ['[\r\n]{1,1000}', '[^\S\r\n]{1,1000}', '\\\\', '\'', '"', '\#', '\$', '([^(\s\\\\\'"\#\$)]|\(|\)){1,1000}']
Methods
lex()
Convert content into a token stream.
public
static lex(string $content) : Generator<string|int, string>
Multibyte string processing is not needed here, and nether is error handling, for performance reasons.
Parameters
- $content : string
Return values
Generator<string|int, string>__construct()
This class is a singleton.
private
__construct() : void