PHP Class Flitch\File\Token

Datei anzeigen Open project: dasprid/flitch

Protected Properties

Property Type Description
$column integer Token column
$level integer Code block level.
$lexeme string Token lexeme.
$line integer Token line.
$namespace string Namespace the token is in.
$type mixed Token type.

Public Methods

Method Description
__construct ( mixed $type, string $lexeme, integer $line, integer $column ) : void Create a new token.
getColumn ( ) : integer Get token column.
getLength ( ) : integer Get length of the entire lexeme.
getLevel ( ) : integer Get block level.
getLexeme ( ) : string Get token lexeme.
getLine ( ) : integer Get token line.
getNamespace ( ) : string | null Get namespace.
getNewlineCount ( ) : integer Get number of newlines.
getTrailingLineLength ( ) : integer Get length of the last line.
getType ( ) : mixed Get token type.
hasNewline ( ) : boolean Check if the token contains newline characters.
setLevel ( integer $level ) : Token Set block level.
setNamespace ( string $namespace ) : Token Set namespace.

Method Details

__construct() public method

Create a new token.
public __construct ( mixed $type, string $lexeme, integer $line, integer $column ) : void
$type mixed
$lexeme string
$line integer
$column integer
return void

getColumn() public method

Get token column.
public getColumn ( ) : integer
return integer

getLength() public method

Get length of the entire lexeme.
public getLength ( ) : integer
return integer

getLevel() public method

Get block level.
public getLevel ( ) : integer
return integer

getLexeme() public method

Get token lexeme.
public getLexeme ( ) : string
return string

getLine() public method

Get token line.
public getLine ( ) : integer
return integer

getNamespace() public method

Get namespace.
public getNamespace ( ) : string | null
return string | null

getNewlineCount() public method

Get number of newlines.
public getNewlineCount ( ) : integer
return integer

getTrailingLineLength() public method

Get length of the last line.
public getTrailingLineLength ( ) : integer
return integer

getType() public method

Get token type.
public getType ( ) : mixed
return mixed

hasNewline() public method

Check if the token contains newline characters.
public hasNewline ( ) : boolean
return boolean

setLevel() public method

Set block level.
public setLevel ( integer $level ) : Token
$level integer
return Token

setNamespace() public method

Set namespace.
public setNamespace ( string $namespace ) : Token
$namespace string
return Token

Property Details

$column protected_oe property

Token column
protected int $column
return integer

$level protected_oe property

Code block level.
protected int $level
return integer

$lexeme protected_oe property

Token lexeme.
protected string $lexeme
return string

$line protected_oe property

Token line.
protected int $line
return integer

$namespace protected_oe property

Namespace the token is in.
protected string $namespace
return string

$type protected_oe property

Token type.
protected mixed $type
return mixed