TokenizerContext
in package
Tags
Table of Contents
Properties
- $currentBlockToken : BlockToken|null
- Current block token being processed
- $currentContent : string
- Current content of parse. Ex: the selector name, the property name or the property content
- $currentPosition : Position|null
- Current position of the tokenizer
- $currentToken : Token|null
- Current token being processed
- $previousToken : Token|null
- Previous token being processed
Methods
- appendCurrentContent() : self
- Append new value to context content
- assertCurrentToken() : bool
- Assert that current token is the same type as given token
- currentContentEndsWith() : bool
- getCurrentBlockToken() : BlockToken|null
- getCurrentContent() : string
- Return context content
- getCurrentPosition() : Position
- getCurrentToken() : Token|null
- Get the current token being processed
- getLastChar() : string|null
- Get the last char of the current content
- getNthLastChars() : string|null
- Get the nth last char of the current content
- getPreviousToken() : Token|null
- incrementColumn() : self
- incrementLine() : self
- resetCurrentContent() : self
- Reset current content property
- resetCurrentToken() : self
- Reset current token property
- setCurrentBlockToken() : self
- setCurrentToken() : self
- Set new current token
Properties
$currentBlockToken
Current block token being processed
private
BlockToken|null
$currentBlockToken
= null
$currentContent
Current content of parse. Ex: the selector name, the property name or the property content
private
string
$currentContent
= ''
$currentPosition
Current position of the tokenizer
private
Position|null
$currentPosition
= null
$currentToken
Current token being processed
private
Token|null
$currentToken
= null
$previousToken
Previous token being processed
private
Token|null
$previousToken
= null
Methods
appendCurrentContent()
Append new value to context content
public
appendCurrentContent(string $currentContent) : self
Parameters
- $currentContent : string
Return values
selfassertCurrentToken()
Assert that current token is the same type as given token
public
assertCurrentToken(Token>|null $token) : bool
Parameters
- $token : Token>|null
Tags
Return values
boolcurrentContentEndsWith()
public
currentContentEndsWith(string $string) : bool
Parameters
- $string : string
Return values
boolgetCurrentBlockToken()
public
getCurrentBlockToken() : BlockToken|null
Return values
BlockToken|nullgetCurrentContent()
Return context content
public
getCurrentContent() : string
Return values
stringgetCurrentPosition()
public
getCurrentPosition() : Position
Return values
PositiongetCurrentToken()
Get the current token being processed
public
getCurrentToken() : Token|null
Return values
Token|nullgetLastChar()
Get the last char of the current content
public
getLastChar() : string|null
Return values
string|nullgetNthLastChars()
Get the nth last char of the current content
public
getNthLastChars(int<1, max> $length[, int<0, max> $offset = 0 ]) : string|null
Parameters
- $length : int<1, max>
- $offset : int<0, max> = 0
Return values
string|nullgetPreviousToken()
public
getPreviousToken() : Token|null
Return values
Token|nullincrementColumn()
public
incrementColumn() : self
Return values
selfincrementLine()
public
incrementLine() : self
Return values
selfresetCurrentContent()
Reset current content property
public
resetCurrentContent() : self
Return values
selfresetCurrentToken()
Reset current token property
public
resetCurrentToken() : self
Return values
selfsetCurrentBlockToken()
public
setCurrentBlockToken(BlockToken|null $currentBlockToken) : self
Parameters
- $currentBlockToken : BlockToken|null
Return values
selfsetCurrentToken()
Set new current token
public
setCurrentToken(Token|null $currentToken) : self
Parameters
- $currentToken : Token|null