Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFLessParser

Fonctions membres publiques

 __construct ($lessc, $sourceName=null)
 
 parse ($buffer)
 
 propertyValue (&$value, $keyName=null)
 
 throwError ($msg="parse error", $count=null)
 

Fonctions membres protégées

 parseChunk ()
 
 isDirective ($dirname, $directives)
 
 fixTags ($tags)
 
 expressionList (&$exps)
 
 expression (&$out)
 
 expHelper ($lhs, $minP)
 
 parenValue (&$out)
 
 value (&$value)
 
 import (&$out)
 
 mediaQueryList (&$out)
 
 mediaQuery (&$out)
 
 mediaExpression (&$out)
 
 openString ($end, &$out, $nestingOpen=null, $rejectStrs=null)
 
 string (&$out)
 
 interpolation (&$out)
 
 unit (&$unit)
 
 color (&$out)
 
 argumentValues (&$args, $delim=',')
 
 argumentDef (&$args, &$isVararg, $delim=',')
 
 tags (&$tags, $simple=false, $delim=',')
 
 mixinTags (&$tags)
 
 tagBracket (&$value)
 
 tagExpression (&$value)
 
 tag (&$tag, $simple=false)
 
 func (&$func)
 
 variable (&$name)
 
 assign ($name=null)
 
 keyword (&$word)
 
 end ()
 
 guards (&$guards)
 
 guardGroup (&$guardGroup)
 
 guard (&$guard)
 
 literal ($what, $eatWhitespace=null)
 
 genericList (&$out, $parseItem, $delim="", $flatten=true)
 
 to ($what, &$out, $until=false, $allowNewline=false)
 
 match ($regex, &$out, $eatWhitespace=null)
 
 whitespace ()
 
 peek ($regex, &$out=null, $from=null)
 
 seek ($where=null)
 
 pushBlock ($selectors=null, $type=null)
 
 pushSpecialBlock ($type)
 
 append ($prop, $pos=null)
 
 pop ()
 
 removeComments ($text)
 

Attributs protégés

 $blockDirectives = array("font-face", "keyframes", "page", "-moz-document")
 
 $lineDirectives = array("charset")
 
 $inParens = false
 

Attributs protégés statiques

static $nextBlockId = 0
 
static $precedence
 
static $whitePattern
 
static $commentMulti
 
static $commentSingle = "//"
 
static $commentMultiLeft = "/*"
 
static $commentMultiRight = "*/"
 
static $operatorString
 
static $supressDivisionProps = array('/border-radius$/i', '/^font$/i')
 
static $literalCache = array()
 

Description détaillée

This class is taken verbatim from:

lessphp v0.3.9 http://leafo.net/lessphp

LESS css compiler, adapted from http://lesscss.org

Copyright 2012, Leaf Corcoran leafo.nosp@m.t@gm.nosp@m.ail.c.nosp@m.om Licensed under MIT or GPLv3, see LICENSE

Responsible for taking a string of LESS code and converting it into a syntax tree

Depuis
2.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $lessc,
  $sourceName = null 
)

Constructor

Paramètres
[type]$lessc [description]
string$sourceName[description]

Références FOFLess\preg_quote().

Documentation des fonctions membres

◆ append()

append (   $prop,
  $pos = null 
)
protected

Append a property to the current block

Paramètres
[type]$prop [description]
[type]$pos [description]
Renvoie
void

Références null.

◆ argumentDef()

argumentDef ( $args,
$isVararg,
  $delim = ',' 
)
protected

Consume an argument definition list surrounded by () each argument is a variable name with optional value or at the end a ... or a variable named followed by ...

Paramètres
[type]&$args [description]
[type]&$isVararg [description]
[type]$delim [description]
Renvoie
boolean

Références $value, et value.

◆ argumentValues()

argumentValues ( $args,
  $delim = ',' 
)
protected

Consume a list of property values delimited by ; and wrapped in ()

Paramètres
[type]&$args [description]
[type]$delim [description]
Renvoie
boolean

Références $value, et null.

◆ assign()

assign (   $name = null)
protected

Consume an assignment operator Can optionally take a name that will be set to the current property name

Paramètres
string$name[description]
Renvoie
boolean

Références $name.

◆ color()

color ( $out)
protected

a # color

Paramètres
[type]&$out [description]
Renvoie
boolean

◆ end()

end ( )
protected

Consume an end of statement delimiter

Renvoie
boolean

Références elseif.

◆ expHelper()

expHelper (   $lhs,
  $minP 
)
protected

Recursively parse infix equation with $lhs at precedence $minP

Paramètres
type$lhs[description]
type$minP[description]
Renvoie
string

Références value.

◆ expression()

expression ( $out)
protected

Attempt to consume an expression.

Paramètres
string&$out[description]

boolean

Références value.

◆ expressionList()

expressionList ( $exps)
protected

a list of expressions

Paramètres
[type]&$exps [description]
Renvoie
boolean

Références FOFLess\compressList().

◆ fixTags()

fixTags (   $tags)
protected

[fixTags description]

Paramètres
[type]$tags [description]
Renvoie
[type] [description]

◆ func()

func ( $func)
protected

A css function

Paramètres
[type]&$func [description]
Renvoie
boolean

Références $name, $value, et elseif.

◆ genericList()

genericList ( $out,
  $parseItem,
  $delim = "",
  $flatten = true 
)
protected

[genericList description]

Paramètres
[type]&$out [description]
[type]$parseItem [description]
string$delim[description]
boolean$flatten[description]
Renvoie
boolean

Références $items, et $value.

◆ guard()

guard ( $guard)
protected

[guard description]

Paramètres
[type]&$guard [description]
Renvoie
boolean

◆ guardGroup()

guardGroup ( $guardGroup)
protected

A bunch of guards that are and'd together

Paramètres
[type]&$guardGroup [description]
Renvoie
boolean

Références null.

◆ guards()

guards ( $guards)
protected

[guards description]

Paramètres
[type]&$guards [description]
Renvoie
boolean

Références $g, et null.

◆ import()

import ( $out)
protected

an import statement

Paramètres
[type]&$out [description]
Renvoie
boolean

Références $value.

◆ interpolation()

interpolation ( $out)
protected

[interpolation description]

Paramètres
[type]&$out [description]
Renvoie
boolean

Références null.

◆ isDirective()

isDirective (   $dirname,
  $directives 
)
protected

[isDirective description]

Paramètres
string$dirname[description]
[type]$directives [description]
Renvoie
boolean

◆ keyword()

keyword ( $word)
protected

Consume a keyword

Paramètres
[type]&$word [description]
Renvoie
boolean

◆ literal()

literal (   $what,
  $eatWhitespace = null 
)
protected

[literal description]

Paramètres
[type]$what [description]
[type]$eatWhitespace [description]
Renvoie
boolean

Références null, et FOFLess\preg_quote().

◆ match()

match (   $regex,
$out,
  $eatWhitespace = null 
)
protected

Try to match something on head of buffer

Paramètres
[type]$regex [description]
[type]&$out [description]
[type]$eatWhitespace [description]
Renvoie
boolean

Références $r, et null.

◆ mediaExpression()

mediaExpression ( $out)
protected

[mediaExpression description]

Paramètres
[type]&$out [description]
Renvoie
boolean

Références $value, elseif, et null.

◆ mediaQuery()

mediaQuery ( $out)
protected

[mediaQuery description]

Paramètres
[type]&$out [description]
Renvoie
[type] [description]

Références $parts, et null.

◆ mediaQueryList()

mediaQueryList ( $out)
protected

[mediaQueryList description]

Paramètres
[type]&$out [description]
Renvoie
boolean

Références $list.

◆ mixinTags()

mixinTags ( $tags)
protected

List of tags of specifying mixin path Optionally separated by > (lazy, accepts extra >)

Paramètres
[type]&$tags [description]
Renvoie
boolean

◆ openString()

openString (   $end,
$out,
  $nestingOpen = null,
  $rejectStrs = null 
)
protected

An unbounded string stopped by $end

Paramètres
[type]$end [description]
[type]&$out [description]
[type]$nestingOpen [description]
[type]$rejectStrs [description]
Renvoie
boolean

Références $content, $count, et null.

◆ parenValue()

parenValue ( $out)
protected

[parenValue description]

Paramètres
[type]&$out [description]
Renvoie
boolean

◆ parse()

parse (   $buffer)

Parse text

Paramètres
string$buffer[description]
Renvoie
[type] [description]

Références $buffer, $count, et null.

◆ parseChunk()

parseChunk ( )
protected

Parse a single chunk off the head of the buffer and append it to the current parse environment. Returns false when the buffer is empty, or when there is an error.

This function is called repeatedly until the entire document is parsed.

This parser is most similar to a recursive descent parser. Single functions represent discrete grammatical rules for the language, and they are able to capture the text that represents those rules.

Consider the function lessc::keyword(). (all parse functions are structured the same)

The function takes a single reference argument. When calling the function it will attempt to match a keyword on the head of the buffer. If it is successful, it will place the keyword in the referenced argument, advance the position in the buffer, and return true. If it fails then it won't advance the buffer and it will return false.

All of these parse functions are powered by lessc::match(), which behaves the same way, but takes a literal regular expression. Sometimes it is more convenient to use match instead of creating a new function.

Because of the format of the functions, to parse an entire string of grammatical rules, you can chain them together using &&.

But, if some of the rules in the chain succeed before one fails, then the buffer position will be left at an invalid state. In order to avoid this, lessc::seek() is used to remember and set buffer positions.

Before parsing a chain, use $s = $this->seek() to remember the current position into $s. Then if a chain fails, use $this->seek($s) to go back where we started.

Renvoie
boolean

Références $hidden, $key, $suffix, $value, elseif, et null.

◆ peek()

peek (   $regex,
$out = null,
  $from = null 
)
protected

Match something without consuming it

Paramètres
[type]$regex [description]
[type]&$out [description]
[type]$from [description]
Renvoie
boolean

Références $count, $r, et null.

◆ pop()

pop ( )
protected

Pop something off the stack

Renvoie
[type] [description]

◆ propertyValue()

propertyValue ( $value,
  $keyName = null 
)

Consume a list of values for a property

Paramètres
[type]&$value [description]
[type]$keyName [description]
Renvoie
boolean

Références $value, FOFLess\compressList(), et null.

◆ pushBlock()

pushBlock (   $selectors = null,
  $type = null 
)
protected

[pushBlock description]

Paramètres
[type]$selectors [description]
[type]$type [description]
Renvoie
stdClass

Références $b, et $type.

◆ pushSpecialBlock()

pushSpecialBlock (   $type)
protected

Push a block that doesn't multiply tags

Paramètres
[type]$type [description]
Renvoie
stdClass

Références $type, et null.

◆ removeComments()

removeComments (   $text)
protected

Remove comments from $text

Paramètres
[type]$text [description]
Renvoie
[type] [description]

Références $count, $text, et null.

◆ seek()

seek (   $where = null)
protected

Seek to a spot in the buffer or return where we are on no argument

Paramètres
[type]$where [description]
Renvoie
boolean

Références $count, et null.

◆ string()

string ( $out)
protected

[string description]

Paramètres
[type]&$out [description]
Renvoie
boolean

Références $content, elseif, et FOFLess\preg_quote().

◆ tag()

tag ( $tag,
  $simple = false 
)
protected

A single tag

Paramètres
[type]&$tag [description]
boolean$simple[description]
Renvoie
boolean

Références $parts.

◆ tagBracket()

tagBracket ( $value)
protected

A bracketed value (contained within in a tag definition)

Paramètres
[type]&$value [description]
Renvoie
boolean

Références $value.

◆ tagExpression()

tagExpression ( $value)
protected

[tagExpression description]

Paramètres
[type]&$value [description]
Renvoie
boolean

Références $value.

◆ tags()

tags ( $tags,
  $simple = false,
  $delim = ',' 
)
protected

Consume a list of tags This accepts a hanging delimiter

Paramètres
[type]&$tags [description]
[type]$simple [description]
[type]$delim [description]
Renvoie
boolean

◆ throwError()

throwError (   $msg = "parse error",
  $count = null 
)

[throwError description]

Paramètres
string$msg[description]
[type]$count [description]
Renvoie
void

Références $count.

◆ to()

to (   $what,
$out,
  $until = false,
  $allowNewline = false 
)
protected

Advance counter to next occurrence of $what $until - don't include $what in advance $allowNewline, if string, will be used as valid char set

Paramètres
[type]$what [description]
[type]&$out [description]
boolean$until[description]
boolean$allowNewline[description]
Renvoie
boolean

Références FOFLess\preg_quote().

◆ unit()

unit ( $unit)
protected

[unit description]

Paramètres
[type]&$unit [description]
Renvoie
boolean

Références $count.

◆ value()

value ( $value)
protected

a single value

Paramètres
[type]&$value [description]
Renvoie
boolean

Références $value, et color.

◆ variable()

variable ( $name)
protected

Consume a less variable

Paramètres
[type]&$name [description]
Renvoie
boolean

Références $name, et null.

◆ whitespace()

whitespace ( )
protected

Watch some whitespace

Renvoie
boolean

Références $count, et null.

Documentation des champs

◆ $blockDirectives

$blockDirectives = array("font-face", "keyframes", "page", "-moz-document")
protected

◆ $commentMulti

$commentMulti
staticprotected

◆ $commentMultiLeft

$commentMultiLeft = "/*"
staticprotected

◆ $commentMultiRight

$commentMultiRight = "*/"
staticprotected

◆ $commentSingle

$commentSingle = "//"
staticprotected

◆ $inParens

$inParens = false
protected

if we are in parens we can be more liberal with whitespace around operators because it must evaluate to a single value and thus is less ambiguous.

Consider: property1: 10 -5; // is two numbers, 10 and -5 property2: (10 -5); // should evaluate to 5

◆ $lineDirectives

$lineDirectives = array("charset")
protected

◆ $literalCache

$literalCache = array()
staticprotected

◆ $nextBlockId

$nextBlockId = 0
staticprotected

◆ $operatorString

$operatorString
staticprotected

◆ $precedence

$precedence
staticprotected
Valeur initiale :
= array(
'=<' => 0,
'>=' => 0,
'=' => 0,
'<' => 0,
'>' => 0,
'+' => 1,
'-' => 1,
'*' => 2,
'/' => 2,
'%' => 2,
)

◆ $supressDivisionProps

$supressDivisionProps = array('/border-radius$/i', '/^font$/i')
staticprotected

◆ $whitePattern

$whitePattern
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :