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.
파일 보기 프로젝트 열기: richthegeek/phpsass 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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