C# Class JsonFx.BuildTools.CssCompactor.CssParser

Datei anzeigen Open project: pocket-playlab/jsonfx-v1 Class Usage Examples

Private Properties

Property Type Description
Copy string
ParseAtRule CssAtRule
ParseDeclaration CssDeclaration
ParseRuleSet CssRuleSet
ParseSelector CssSelector
ParseStatement CssStatement
ParseStyleSheet CssStyleSheet
ParseValue CssValueList
PutBack void
Read bool

Public Methods

Method Description
CssParser ( string filePath ) : System

Ctor.

CssParser ( string filePath, string source ) : System

Ctor.

Write ( TextWriter writer, CssCompactor options ) : void

Private Methods

Method Description
Copy ( int start ) : string

Copies chars from start until the position before the current position

ParseAtRule ( ) : CssAtRule

(BNF) at-rule : ATKEYWORD S* any* [ block | ';' S* ];

NOTE: each at-rule might parse differently according to CSS3 The @media block for example contains a block of statements while other at-rules with a block contain a block of declarations

ParseDeclaration ( ) : CssDeclaration

(BNF) declaration : property ':' S* value; (BNF) property : IDENT S*;

ParseRuleSet ( ) : CssRuleSet

(BNF) ruleset : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;

ParseSelector ( ) : CssSelector

(BNF) selector: any+;

ParseStatement ( ) : CssStatement

(BNF) statement : ruleset | at-rule;

ParseStyleSheet ( ) : CssStyleSheet

(BNF) stylesheet : [ CDO | CDC | S | statement ]*;

ParseValue ( ) : CssValueList

(BNF) value : [ any | block | ATKEYWORD S* ]+; (BNF) any : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES | FUNCTION S* any* ')' | DASHMATCH | '(' S* any* ')' | '[' S* any* ']' ] S*;

PutBack ( ) : void

Put one character back

Read ( char &ch ) : bool

Method Details

CssParser() public method

Ctor.
public CssParser ( string filePath ) : System
filePath string path to source
return System

CssParser() public method

Ctor.
public CssParser ( string filePath, string source ) : System
filePath string path to source
source string actual source
return System

Write() public method

public Write ( TextWriter writer, CssCompactor options ) : void
writer System.IO.TextWriter
options CssCompactor
return void