PHP Class SassScriptLexer

Lexes SassSCript into tokens for the parser. Implements a {@link http://en.wikipedia.org/wiki/Shunting-yard_algorithm Shunting-yard algorithm} to provide {@link http://en.wikipedia.org/wiki/Reverse_Polish_notation Reverse Polish notation} output.
Show file Open project: richthegeek/phpsass Class Usage Examples

Public Properties

Property Type Description
$instance Static holder for last instance of SassScriptLexer
$parser the parser object

Public Methods

Method Description
__construct ( $parser ) : SassScriptLexer SassScriptLexer constructor.
isWhitespace ( string $subject ) : mixed Returns a value indicating if a token of this type can be matched at the start of the subject string.
lex ( string $string, SassContext $context ) : array Lex an expression into SassScript tokens.

Method Details

__construct() public method

SassScriptLexer constructor.
public __construct ( $parser ) : SassScriptLexer
return SassScriptLexer

isWhitespace() public method

Returns a value indicating if a token of this type can be matched at the start of the subject string.
public isWhitespace ( string $subject ) : mixed
$subject string the subject string
return mixed match at the start of the string or false if no match

lex() public method

Lex an expression into SassScript tokens.
public lex ( string $string, SassContext $context ) : array
$string string expression to lex
$context SassContext the context in which the expression is lexed
return array tokens

Property Details

$instance public static property

Static holder for last instance of SassScriptLexer
public static $instance

$parser public property

the parser object
public $parser