PHP 클래스 titanscss_parser

저자: Leaf Corcoran ([email protected])
파일 보기 프로젝트 열기: gambitph/titan-framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$commentMulti
$commentMultiLeft
$commentMultiRight
$commentSingle
$operatorStr
$operators
$precedence
$whitePattern

공개 메소드들

메소드 설명
__construct ( $sourceName = null, $rootParser = true )
getLineNo ( $pos )
parse ( $buffer )
preg_quote ( $what )
throwParseError ( $msg = "parse error", $count = null )

보호된 메소드들

메소드 설명
append ( $statement, $pos = null )
argValue ( &$out )
argValues ( &$out )
argumentDef ( &$out )
argumentList ( &$out )
color ( &$out )
end ( ) consume an end of statement delimiter
expHelper ( $lhs, $minP )
expression ( &$out )
flattenList ( $value ) turn list of length 1 into value type
func ( &$func )
genericList ( &$out, $parseItem, $delim = "", $flatten = true )
interpolation ( &$out, $lookWhite = true ) $lookWhite: save information about whitespace before and after
keyword ( &$word, $eatWhitespace = null )
last ( ) last child that was appended
literal ( $what, $eatWhitespace = null )
makeOperatorStr ( $operators )
match ( $regex, &$out, $eatWhitespace = null ) try to match something on head of buffer
matchString ( array &$m, string $delim ) : boolean Match string looking for either ending delim, escape, or string interpolation
mediaExpression ( &$out )
mediaQuery ( &$out )
mediaQueryList ( &$out ) high level parsers (they return parts of ast)
mixedKeyword ( &$out )
openString ( $end, &$out, $nestingOpen = null ) an unbounded string stopped by $end
parenValue ( &$out ) value wrappen in parentheses
parseChunk ( ) : boolean Parse a single chunk off the head of the buffer and append it to the current parse environment.
peek ( $regex, &$out, $from = null )
placeholder ( &$placeholder )
popBlock ( )
progid ( &$out )
propertyName ( &$out ) returns an array of parts or a string
pushBlock ( $selectors ) tree builders
pushSpecialBlock ( $type )
seek ( $where = null )
selector ( &$out ) whitespace separated list of selectorSingle
selectorSingle ( &$out ) div[yes=no]#something.hello.world:nth-child(-2n+1)%placeholder
selectors ( &$out ) comma separated list of selectors
show ( )
spaceList ( &$out )
string ( &$out )
stripDefault ( &$value )
to ( $what, &$out, $until = false, $allowNewline = false ) $allowNewline, if string, will be used as valid char set
unit ( &$unit )
value ( &$out )
valueList ( &$out )
variable ( &$out )
whitespace ( ) match some whitespace

메소드 상세

__construct() 공개 메소드

public __construct ( $sourceName = null, $rootParser = true )

append() 보호된 메소드

protected append ( $statement, $pos = null )

argValue() 보호된 메소드

protected argValue ( &$out )

argValues() 보호된 메소드

protected argValues ( &$out )

argumentDef() 보호된 메소드

protected argumentDef ( &$out )

argumentList() 보호된 메소드

protected argumentList ( &$out )

color() 보호된 메소드

protected color ( &$out )

end() 보호된 메소드

consume an end of statement delimiter
protected end ( )

expHelper() 보호된 메소드

protected expHelper ( $lhs, $minP )

expression() 보호된 메소드

protected expression ( &$out )

flattenList() 보호된 메소드

turn list of length 1 into value type
protected flattenList ( $value )

func() 보호된 메소드

protected func ( &$func )

genericList() 보호된 메소드

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

getLineNo() 공개 메소드

public getLineNo ( $pos )

interpolation() 보호된 메소드

$lookWhite: save information about whitespace before and after
protected interpolation ( &$out, $lookWhite = true )

keyword() 보호된 메소드

protected keyword ( &$word, $eatWhitespace = null )

last() 보호된 메소드

last child that was appended
protected last ( )

literal() 보호된 메소드

protected literal ( $what, $eatWhitespace = null )

makeOperatorStr() 보호된 정적인 메소드

protected static makeOperatorStr ( $operators )

match() 보호된 메소드

try to match something on head of buffer
protected match ( $regex, &$out, $eatWhitespace = null )

matchString() 보호된 메소드

{@internal This is a workaround for preg_match's 250K string match limit.}}
protected matchString ( array &$m, string $delim ) : boolean
$m array Matches (passed by reference)
$delim string Delimeter
리턴 boolean True if match; false otherwise

mediaExpression() 보호된 메소드

protected mediaExpression ( &$out )

mediaQuery() 보호된 메소드

protected mediaQuery ( &$out )

mediaQueryList() 보호된 메소드

high level parsers (they return parts of ast)
protected mediaQueryList ( &$out )

mixedKeyword() 보호된 메소드

protected mixedKeyword ( &$out )

openString() 보호된 메소드

an unbounded string stopped by $end
protected openString ( $end, &$out, $nestingOpen = null )

parenValue() 보호된 메소드

value wrappen in parentheses
protected parenValue ( &$out )

parse() 공개 메소드

public parse ( $buffer )

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 scssc::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 scssc::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, scssc::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() 보호된 메소드

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

placeholder() 보호된 메소드

protected placeholder ( &$placeholder )

popBlock() 보호된 메소드

protected popBlock ( )

preg_quote() 정적인 공개 메소드

static public preg_quote ( $what )

progid() 보호된 메소드

protected progid ( &$out )

propertyName() 보호된 메소드

returns an array of parts or a string
protected propertyName ( &$out )

pushBlock() 보호된 메소드

tree builders
protected pushBlock ( $selectors )

pushSpecialBlock() 보호된 메소드

protected pushSpecialBlock ( $type )

seek() 보호된 메소드

protected seek ( $where = null )

selector() 보호된 메소드

whitespace separated list of selectorSingle
protected selector ( &$out )

selectorSingle() 보호된 메소드

div[yes=no]#something.hello.world:nth-child(-2n+1)%placeholder
protected selectorSingle ( &$out )

selectors() 보호된 메소드

comma separated list of selectors
protected selectors ( &$out )

show() 보호된 메소드

protected show ( )

spaceList() 보호된 메소드

protected spaceList ( &$out )

string() 보호된 메소드

protected string ( &$out )

stripDefault() 보호된 메소드

protected stripDefault ( &$value )

throwParseError() 공개 메소드

public throwParseError ( $msg = "parse error", $count = null )

to() 보호된 메소드

$allowNewline, if string, will be used as valid char set
protected to ( $what, &$out, $until = false, $allowNewline = false )

unit() 보호된 메소드

protected unit ( &$unit )

value() 보호된 메소드

protected value ( &$out )

valueList() 보호된 메소드

protected valueList ( &$out )

variable() 보호된 메소드

protected variable ( &$out )

whitespace() 보호된 메소드

match some whitespace
protected whitespace ( )

프로퍼티 상세

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

protected static $commentMulti

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

protected static $commentMultiLeft

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

protected static $commentMultiRight

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

protected static $commentSingle

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

protected static $operatorStr

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

protected static $operators

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

protected static $precedence

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

protected static $whitePattern