Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
CssExpressionParserPlugin Class Reference
Inheritance diagram for CssExpressionParserPlugin:
aCssParserPlugin

Public Member Functions

 getTriggerChars ()
 getTriggerStates ()
 parse ($index, $char, $previousChar, $state)
- Public Member Functions inherited from aCssParserPlugin
 __construct (CssParser $parser, array $configuration=null)

Additional Inherited Members

- Protected Attributes inherited from aCssParserPlugin
 $configuration = array()
 $parser = null
 $buffer = ""

Detailed Description

Definition at line 2533 of file cssmin.php.

Member Function Documentation

CssExpressionParserPlugin::getTriggerChars ( )

Implements aCssParserPlugin::getTriggerChars().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 2552 of file cssmin.php.

{
return array("(", ")", ";", "}");
}
CssExpressionParserPlugin::getTriggerStates ( )

Implements aCssParserPlugin::getTriggerStates().

Returns
array

Reimplemented from aCssParserPlugin.

Definition at line 2561 of file cssmin.php.

{
return false;
}
CssExpressionParserPlugin::parse (   $index,
  $char,
  $previousChar,
  $state 
)

Implements aCssParserPlugin::parse().

Parameters
integer$indexCurrent index
string$charCurrent char
string$previousCharPrevious char
Returns
mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing

Reimplemented from aCssParserPlugin.

Definition at line 2573 of file cssmin.php.

{
// Start of expression
if ($char === "(" && strtolower(substr($this->parser->getSource(), $index - 10, 11)) === "expression(" && $state !== "T_EXPRESSION")
{
$this->parser->pushState("T_EXPRESSION");
$this->leftBraces++;
}
// Count left braces
elseif ($char === "(" && $state === "T_EXPRESSION")
{
$this->leftBraces++;
}
// Count right braces
elseif ($char === ")" && $state === "T_EXPRESSION")
{
$this->rightBraces++;
}
// Possible end of expression; if left and right braces are equal the expressen ends
elseif (($char === ";" || $char === "}") && $state === "T_EXPRESSION" && $this->leftBraces === $this->rightBraces)
{
$this->leftBraces = $this->rightBraces = 0;
$this->parser->popState();
return $index - 1;
}
else
{
return false;
}
return true;
}

The documentation for this class was generated from the following file: