PHP 클래스 FOF30\Less\Parser\Parser

lessphp v0.3.9 http://leafo.net/lessphp LESS css compiler, adapted from http://lesscss.org Copyright 2012, Leaf Corcoran Licensed under MIT or GPLv3, see LICENSE Responsible for taking a string of LESS code and converting it into a syntax tree
부터: 2.0
파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$blockDirectives
$commentMulti
$commentMultiLeft
$commentMultiRight
$commentSingle
$inParens Consider: property1: 10 -5; // is two numbers, 10 and -5 property2: (10 -5); // should evaluate to 5
$lineDirectives
$literalCache Caches preg escaped literals
$nextBlockId Used to uniquely identify blocks
$operatorString Regex string to match any of the operators
$precedence
$supressDivisionProps These properties will supress division unless it's inside parenthases
$whitePattern

공개 메소드들

메소드 설명
__construct ( [type] $lessc, string $sourceName = null ) Constructor
parse ( string $buffer ) : [type] Parse text
propertyValue ( &$value, [type] $keyName = null ) : boolean Consume a list of values for a property
throwError ( string $msg = "parse error", [type] $count = null ) : void [throwError description]

보호된 메소드들

메소드 설명
append ( [type] $prop, [type] $pos = null ) : void Append a property to the current block
argumentDef ( &$args, &$isVararg, [type] $delim = ',' ) : boolean Consume an argument definition list surrounded by () each argument is a variable name with optional value or at the end a .
argumentValues ( &$args, [type] $delim = ',' ) : boolean Consume a list of property values delimited by ; and wrapped in ()
assign ( string $name = null ) : boolean Consume an assignment operator Can optionally take a name that will be set to the current property name
color ( &$out ) : boolean a # color
end ( ) : boolean Consume an end of statement delimiter
expHelper ( type $lhs, type $minP ) : string Recursively parse infix equation with $lhs at precedence $minP
expression ( &$out ) : boolean Attempt to consume an expression.
expressionList ( &$exps ) : boolean a list of expressions
fixTags ( [type] $tags ) : [type] [fixTags description]
func ( &$func ) : boolean A css function
genericList ( &$out, [type] $parseItem, string $delim = "", boolean $flatten = true ) : boolean [genericList description]
guard ( &$guard ) : boolean [guard description]
guardGroup ( &$guardGroup ) : boolean A bunch of guards that are and'd together
guards ( &$guards ) : boolean [guards description]
import ( &$out ) : boolean an import statement
interpolation ( &$out ) : boolean [interpolation description]
isDirective ( string $dirname, [type] $directives ) : boolean [isDirective description]
keyword ( &$word ) : boolean Consume a keyword
literal ( [type] $what, [type] $eatWhitespace = null ) : boolean [literal description]
match ( [type] $regex, &$out, [type] $eatWhitespace = null ) : boolean Try to match something on head of buffer
mediaExpression ( &$out ) : boolean [mediaExpression description]
mediaQuery ( &$out ) : [type] [mediaQuery description]
mediaQueryList ( &$out ) : boolean [mediaQueryList description]
mixinTags ( &$tags ) : boolean List of tags of specifying mixin path Optionally separated by > (lazy, accepts extra >)
openString ( [type] $end, &$out, [type] $nestingOpen = null, [type] $rejectStrs = null ) : boolean An unbounded string stopped by $end
parenValue ( &$out ) : boolean [parenValue description]
parseChunk ( ) : boolean Parse a single chunk off the head of the buffer and append it to the current parse environment.
peek ( [type] $regex, &$out = null, [type] $from = null ) : boolean Match something without consuming it
pop ( ) : [type] Pop something off the stack
pushBlock ( [type] $selectors = null, [type] $type = null ) : stdClass [pushBlock description]
pushSpecialBlock ( [type] $type ) : stdClass Push a block that doesn't multiply tags
removeComments ( [type] $text ) : [type] Remove comments from $text
seek ( [type] $where = null ) : boolean Seek to a spot in the buffer or return where we are on no argument
string ( &$out ) : boolean [string description]
tag ( &$tag, boolean $simple = false ) : boolean A single tag
tagBracket ( &$value ) : boolean A bracketed value (contained within in a tag definition)
tagExpression ( &$value ) : boolean [tagExpression description]
tags ( &$tags, [type] $simple = false, [type] $delim = ',' ) : boolean Consume a list of tags This accepts a hanging delimiter
to ( [type] $what, &$out, boolean $until = false, boolean $allowNewline = false ) : boolean Advance counter to next occurrence of $what $until - don't include $what in advance $allowNewline, if string, will be used as valid char set
unit ( &$unit ) : boolean [unit description]
value ( &$value ) : boolean a single value
variable ( &$name ) : boolean Consume a less variable
whitespace ( ) : boolean Watch some whitespace

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( [type] $lessc, string $sourceName = null )
$lessc [type]
$sourceName string [description]

append() 보호된 메소드

Append a property to the current block
protected append ( [type] $prop, [type] $pos = null ) : void
$prop [type]
$pos [type]
리턴 void

argumentDef() 보호된 메소드

.. or a variable named followed by ...
protected argumentDef ( &$args, &$isVararg, [type] $delim = ',' ) : boolean
$delim [type]
리턴 boolean

argumentValues() 보호된 메소드

Consume a list of property values delimited by ; and wrapped in ()
protected argumentValues ( &$args, [type] $delim = ',' ) : boolean
$delim [type]
리턴 boolean

assign() 보호된 메소드

Consume an assignment operator Can optionally take a name that will be set to the current property name
protected assign ( string $name = null ) : boolean
$name string [description]
리턴 boolean

color() 보호된 메소드

a # color
protected color ( &$out ) : boolean
리턴 boolean

end() 보호된 메소드

Consume an end of statement delimiter
protected end ( ) : boolean
리턴 boolean

expHelper() 보호된 메소드

Recursively parse infix equation with $lhs at precedence $minP
protected expHelper ( type $lhs, type $minP ) : string
$lhs type [description]
$minP type [description]
리턴 string

expression() 보호된 메소드

Attempt to consume an expression.
protected expression ( &$out ) : boolean
리턴 boolean

expressionList() 보호된 메소드

a list of expressions
protected expressionList ( &$exps ) : boolean
리턴 boolean

fixTags() 보호된 메소드

[fixTags description]
protected fixTags ( [type] $tags ) : [type]
$tags [type]
리턴 [type]

func() 보호된 메소드

A css function
protected func ( &$func ) : boolean
리턴 boolean

genericList() 보호된 메소드

[genericList description]
protected genericList ( &$out, [type] $parseItem, string $delim = "", boolean $flatten = true ) : boolean
$parseItem [type]
$delim string [description]
$flatten boolean [description]
리턴 boolean

guard() 보호된 메소드

[guard description]
protected guard ( &$guard ) : boolean
리턴 boolean

guardGroup() 보호된 메소드

A bunch of guards that are and'd together
protected guardGroup ( &$guardGroup ) : boolean
리턴 boolean

guards() 보호된 메소드

[guards description]
protected guards ( &$guards ) : boolean
리턴 boolean

import() 보호된 메소드

an import statement
protected import ( &$out ) : boolean
리턴 boolean

interpolation() 보호된 메소드

[interpolation description]
protected interpolation ( &$out ) : boolean
리턴 boolean

isDirective() 보호된 메소드

[isDirective description]
protected isDirective ( string $dirname, [type] $directives ) : boolean
$dirname string [description]
$directives [type]
리턴 boolean

keyword() 보호된 메소드

Consume a keyword
protected keyword ( &$word ) : boolean
리턴 boolean

literal() 보호된 메소드

[literal description]
protected literal ( [type] $what, [type] $eatWhitespace = null ) : boolean
$what [type]
$eatWhitespace [type]
리턴 boolean

match() 보호된 메소드

Try to match something on head of buffer
protected match ( [type] $regex, &$out, [type] $eatWhitespace = null ) : boolean
$regex [type]
$eatWhitespace [type]
리턴 boolean

mediaExpression() 보호된 메소드

[mediaExpression description]
protected mediaExpression ( &$out ) : boolean
리턴 boolean

mediaQuery() 보호된 메소드

[mediaQuery description]
protected mediaQuery ( &$out ) : [type]
리턴 [type]

mediaQueryList() 보호된 메소드

[mediaQueryList description]
protected mediaQueryList ( &$out ) : boolean
리턴 boolean

mixinTags() 보호된 메소드

List of tags of specifying mixin path Optionally separated by > (lazy, accepts extra >)
protected mixinTags ( &$tags ) : boolean
리턴 boolean

openString() 보호된 메소드

An unbounded string stopped by $end
protected openString ( [type] $end, &$out, [type] $nestingOpen = null, [type] $rejectStrs = null ) : boolean
$end [type]
$nestingOpen [type]
$rejectStrs [type]
리턴 boolean

parenValue() 보호된 메소드

[parenValue description]
protected parenValue ( &$out ) : boolean
리턴 boolean

parse() 공개 메소드

Parse text
public parse ( string $buffer ) : [type]
$buffer string [description]
리턴 [type]

parseChunk() 보호된 메소드

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.
protected parseChunk ( ) : boolean
리턴 boolean

peek() 보호된 메소드

Match something without consuming it
protected peek ( [type] $regex, &$out = null, [type] $from = null ) : boolean
$regex [type]
$from [type]
리턴 boolean

pop() 보호된 메소드

Pop something off the stack
protected pop ( ) : [type]
리턴 [type]

propertyValue() 공개 메소드

Consume a list of values for a property
public propertyValue ( &$value, [type] $keyName = null ) : boolean
$keyName [type]
리턴 boolean

pushBlock() 보호된 메소드

[pushBlock description]
protected pushBlock ( [type] $selectors = null, [type] $type = null ) : stdClass
$selectors [type]
$type [type]
리턴 stdClass

pushSpecialBlock() 보호된 메소드

Push a block that doesn't multiply tags
protected pushSpecialBlock ( [type] $type ) : stdClass
$type [type]
리턴 stdClass

removeComments() 보호된 메소드

Remove comments from $text
protected removeComments ( [type] $text ) : [type]
$text [type]
리턴 [type]

seek() 보호된 메소드

Seek to a spot in the buffer or return where we are on no argument
protected seek ( [type] $where = null ) : boolean
$where [type]
리턴 boolean

string() 보호된 메소드

[string description]
protected string ( &$out ) : boolean
리턴 boolean

tag() 보호된 메소드

A single tag
protected tag ( &$tag, boolean $simple = false ) : boolean
$simple boolean [description]
리턴 boolean

tagBracket() 보호된 메소드

A bracketed value (contained within in a tag definition)
protected tagBracket ( &$value ) : boolean
리턴 boolean

tagExpression() 보호된 메소드

[tagExpression description]
protected tagExpression ( &$value ) : boolean
리턴 boolean

tags() 보호된 메소드

Consume a list of tags This accepts a hanging delimiter
protected tags ( &$tags, [type] $simple = false, [type] $delim = ',' ) : boolean
$simple [type]
$delim [type]
리턴 boolean

throwError() 공개 메소드

[throwError description]
public throwError ( string $msg = "parse error", [type] $count = null ) : void
$msg string [description]
$count [type]
리턴 void

to() 보호된 메소드

Advance counter to next occurrence of $what $until - don't include $what in advance $allowNewline, if string, will be used as valid char set
protected to ( [type] $what, &$out, boolean $until = false, boolean $allowNewline = false ) : boolean
$what [type]
$until boolean [description]
$allowNewline boolean [description]
리턴 boolean

unit() 보호된 메소드

[unit description]
protected unit ( &$unit ) : boolean
리턴 boolean

value() 보호된 메소드

a single value
protected value ( &$value ) : boolean
리턴 boolean

variable() 보호된 메소드

Consume a less variable
protected variable ( &$name ) : boolean
리턴 boolean

whitespace() 보호된 메소드

Watch some whitespace
protected whitespace ( ) : boolean
리턴 boolean

프로퍼티 상세

$blockDirectives 보호되어 있는 프로퍼티

protected $blockDirectives

$commentMulti 보호되어 있는 정적으로 프로퍼티

protected static $commentMulti

$commentMultiLeft 보호되어 있는 정적으로 프로퍼티

protected static $commentMultiLeft

$commentMultiRight 보호되어 있는 정적으로 프로퍼티

protected static $commentMultiRight

$commentSingle 보호되어 있는 정적으로 프로퍼티

protected static $commentSingle

$inParens 보호되어 있는 프로퍼티

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

$lineDirectives 보호되어 있는 프로퍼티

protected $lineDirectives

$literalCache 보호되어 있는 정적으로 프로퍼티

Caches preg escaped literals
protected static $literalCache

$nextBlockId 보호되어 있는 정적으로 프로퍼티

Used to uniquely identify blocks
protected static $nextBlockId

$operatorString 보호되어 있는 정적으로 프로퍼티

Regex string to match any of the operators
protected static $operatorString

$precedence 보호되어 있는 정적으로 프로퍼티

protected static $precedence

$supressDivisionProps 보호되어 있는 정적으로 프로퍼티

These properties will supress division unless it's inside parenthases
protected static $supressDivisionProps

$whitePattern 보호되어 있는 정적으로 프로퍼티

protected static $whitePattern