PHP Class SassNode

Base class for all Sass nodes.
Afficher le fichier Open project: richthegeek/phpsass Class Usage Examples

Méthodes publiques

Свойство Type Description
$children children of this node
$parent parent of this node
$root root node
$token source token

Méthodes publiques

Méthode Description
__clone ( ) Resets children when cloned
__construct ( object $token ) : SassNode Constructor.
__get ( string $name ) : mixed Getter.
__set ( string $name, mixed $value ) : SassNode Setter.
addChild ( $child ) Adds a child to this node.
addWarning ( string $message ) Adds a warning to the node.
evaluate ( string $expression, SassContext $context, mixed $x = null ) : SassLiteral Evaluates a SassScript expression.
getChildren ( ) : array Returns the node's children
getDebug_info ( ) : boolean Returns the debug_info option setting for this node
getFilename ( ) : string Returns the filename for this node
getLastChild ( ) : SassNode Returns the last child node of this node.
getLevel ( ) : integer Returns the level of this node.
getLine ( ) : string Returns the line number for this node
getLine_numbers ( ) : boolean Returns the line_numbers option setting for this node
getParent ( ) : array Returns the node's parent
getParser ( ) : SassParser Returns the Sass parser.
getPropertySyntax ( ) : string Returns the property syntax being used.
getRenderer ( ) : SassRenderer Returns the renderer.
getScript ( ) : SassScriptParser Returns the SassScript parser.
getSource ( ) : string Returns the source for this node
getStyle ( ) : string Returns the render style of the document tree.
hasChildren ( ) : boolean Returns a value indicating if this node has children
hasParent ( ) : array Return a value indicating if this node has a parent
inDirective ( ) : boolean Returns a value indicating whether this node is in a directive
inSassScriptDirective ( ) : boolean Returns a value indicating whether this node is in a SassScript directive
interpolate ( string $expression, SassContext $context ) : string Replace interpolated SassScript contained in '#{}' with the parsed value.
isChildOf ( SassNode $node ) : boolean Returns a value indicating if this node is a child of the passed node.
isa ( object $token ) : boolean Returns a value indicating if the token represents this type of node.
parseChildren ( SassContext $context ) : array Parse the children of the node.
printDebugTree ( $i )
setRoot ( SassNode $root ) Sets a root recursively.

Method Details

__clone() public méthode

Resets children when cloned
See also: parse
public __clone ( )

__construct() public méthode

Constructor.
public __construct ( object $token ) : SassNode
$token object source token
Résultat SassNode

__get() public méthode

Getter.
public __get ( string $name ) : mixed
$name string name of property to get
Résultat mixed return value of getter function

__set() public méthode

Setter.
public __set ( string $name, mixed $value ) : SassNode
$name string name of property to set
$value mixed value of property
Résultat SassNode this node

addChild() public méthode

Adds a child to this node.
public addChild ( $child )

addWarning() public méthode

Adds a warning to the node.
public addWarning ( string $message )
$message string warning message

evaluate() public méthode

Evaluates a SassScript expression.
public evaluate ( string $expression, SassContext $context, mixed $x = null ) : SassLiteral
$expression string expression to evaluate
$context SassContext the context in which the expression is evaluated
$x mixed
Résultat SassLiteral value of parsed expression

getChildren() public méthode

Returns the node's children
public getChildren ( ) : array
Résultat array the node's children

getDebug_info() public méthode

Returns the debug_info option setting for this node
public getDebug_info ( ) : boolean
Résultat boolean the debug_info option setting for this node

getFilename() public méthode

Returns the filename for this node
public getFilename ( ) : string
Résultat string the filename for this node

getLastChild() public méthode

Returns the last child node of this node.
public getLastChild ( ) : SassNode
Résultat SassNode the last child node of this node

getLevel() public méthode

Returns the level of this node.
public getLevel ( ) : integer
Résultat integer the level of this node

getLine() public méthode

Returns the line number for this node
public getLine ( ) : string
Résultat string the line number for this node

getLine_numbers() public méthode

Returns the line_numbers option setting for this node
public getLine_numbers ( ) : boolean
Résultat boolean the line_numbers option setting for this node

getParent() public méthode

Returns the node's parent
public getParent ( ) : array
Résultat array the node's parent

getParser() public méthode

Returns the Sass parser.
public getParser ( ) : SassParser
Résultat SassParser the Sass parser

getPropertySyntax() public méthode

Returns the property syntax being used.
public getPropertySyntax ( ) : string
Résultat string the property syntax being used

getRenderer() public méthode

Returns the renderer.
public getRenderer ( ) : SassRenderer
Résultat SassRenderer the renderer

getScript() public méthode

Returns the SassScript parser.
public getScript ( ) : SassScriptParser
Résultat SassScriptParser the SassScript parser

getSource() public méthode

Returns the source for this node
public getSource ( ) : string
Résultat string the source for this node

getStyle() public méthode

Returns the render style of the document tree.
public getStyle ( ) : string
Résultat string the render style of the document tree

hasChildren() public méthode

Returns a value indicating if this node has children
public hasChildren ( ) : boolean
Résultat boolean true if the node has children, false if not

hasParent() public méthode

Return a value indicating if this node has a parent
public hasParent ( ) : array
Résultat array the node's parent

inDirective() public méthode

Returns a value indicating whether this node is in a directive
public inDirective ( ) : boolean
Résultat boolean

inSassScriptDirective() public méthode

Returns a value indicating whether this node is in a SassScript directive
public inSassScriptDirective ( ) : boolean
Résultat boolean

interpolate() public méthode

Replace interpolated SassScript contained in '#{}' with the parsed value.
public interpolate ( string $expression, SassContext $context ) : string
$expression string the text to interpolate
$context SassContext the context in which the string is interpolated
Résultat string the interpolated text

isChildOf() public méthode

This just checks the levels of the nodes. If this node is at a greater level than the passed node if is a child of it.
public isChildOf ( SassNode $node ) : boolean
$node SassNode
Résultat boolean true if the node is a child of the passed node, false if not

isa() public static méthode

Returns a value indicating if the token represents this type of node.
public static isa ( object $token ) : boolean
$token object token
Résultat boolean true if the token represents this type of node, false if not

parseChildren() public méthode

Parse the children of the node.
public parseChildren ( SassContext $context ) : array
$context SassContext the context in which the children are parsed
Résultat array the parsed child nodes

printDebugTree() public méthode

public printDebugTree ( $i )

setRoot() public méthode

Sets a root recursively.
public setRoot ( SassNode $root )
$root SassNode the new root node

Property Details

$children public_oe property

children of this node
public $children

$parent public_oe property

parent of this node
public $parent

$root public_oe property

root node
public $root

$token public_oe property

source token
public $token