PHP Класс SassScriptParser

Parses SassScript. SassScript is lexed into {@link http://en.wikipedia.org/wiki/Reverse_Polish_notation Reverse Polish notation} by the SassScriptLexer and the calculated result returned.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$context Used for error reporting
$instance Hold a copy of a parser available to the general public.
$lexer the lexer object

Открытые методы

Метод Описание
__construct ( ) : SassScriptParser SassScriptParser constructor.
evaluate ( string $expression, SassContext $context, integer $environment = self::DEFAULT_ENV ) : SassLiteral Evaluate a SassScript.
interpolate ( string $string, SassContext $context ) : string Replace interpolated SassScript contained in '#{}' with the parsed value.
makeSingular ( $operands ) Reduces a set down to a singular form
parse ( string $expression, SassContext $context, integer $environment = self::DEFAULT_ENV ) : array Parse SassScript to a set of tokens in RPN using the Shunting Yard Algorithm.

Описание методов

__construct() публичный Метод

SassScriptParser constructor.
public __construct ( ) : SassScriptParser
Результат SassScriptParser

evaluate() публичный Метод

Evaluate a SassScript.
public evaluate ( string $expression, SassContext $context, integer $environment = self::DEFAULT_ENV ) : SassLiteral
$expression string expression to parse
$context SassContext the context in which the expression is evaluated
$environment integer the environment in which the expression is evaluated
Результат SassLiteral parsed value

interpolate() публичный Метод

Replace interpolated SassScript contained in '#{}' with the parsed value.
public interpolate ( string $string, SassContext $context ) : string
$string string the text to interpolate
$context SassContext the context in which the string is interpolated
Результат string the interpolated text

makeSingular() публичный статический Метод

Reduces a set down to a singular form
public static makeSingular ( $operands )

parse() публичный Метод

Parse SassScript to a set of tokens in RPN using the Shunting Yard Algorithm.
public parse ( string $expression, SassContext $context, integer $environment = self::DEFAULT_ENV ) : array
$expression string expression to parse
$context SassContext the context in which the expression is parsed
$environment integer the environment in which the expression is parsed
Результат array tokens in RPN

Описание свойств

$context публичное статическое свойство

Used for error reporting
public static $context

$instance публичное статическое свойство

Hold a copy of a parser available to the general public.
public static $instance

$lexer публичное свойство

the lexer object
public $lexer