JHotDraw 7.4.1

org.jhotdraw.xml.css
Class CSSParser

java.lang.Object
  extended by org.jhotdraw.xml.css.CSSParser

public class CSSParser
extends java.lang.Object

Parsers a Cascading Style Sheet (CSS).

 IDENT  {ident}
 ATKEYWORD  @{ident}
 STRING  {string}
 INVALID  {invalid}
 HASH  #{name}
 NUMBER  {num}
 PERCENTAGE  {num}%
 DIMENSION  {num}{ident}
 URI  url\({w}{string}{w}\)
 |url\({w}([!#$%&*-~]|{nonascii}|{escape})*{w}\)
 UNICODE-RANGE  U\+[0-9A-F?]{1,6}(-[0-9A-F]{1,6})?
 CDO  
 ;  ;
 {  \{
 }  \}
 (  \(
 )  \)
 [  \[
 ]  \]
 S  [ \t\r\n\f]+
 COMMENT  \/\*[^*]*\*+([^/*][^*]*\*+)*\/
 FUNCTION  {ident}\(
 INCLUDES  ~=
 DASHMATCH  |=
 DELIM  any other character not matched by the above rules, and neither a single nor a double quote


 stylesheet  : [ CDO | CDC | S | statement ]*;
 statement   : ruleset | at-rule;
 at-rule     : ATKEYWORD S* any* [ block | ';' S* ];
 block       : '{' S* [ any | block | ATKEYWORD S* | ';' S* ]* '}' S*;
 ruleset     : selector? '{' S* declaration? [ ';' S* declaration? ]* '}' S*;
 selector    : any+;
 declaration : DELIM? property S* ':' S* value;
 property    : IDENT;
 value       : [ any | block | ATKEYWORD S* ]+;
 any         : [ IDENT | NUMBER | PERCENTAGE | DIMENSION | STRING
 | DELIM | URI | HASH | UNICODE-RANGE | INCLUDES
 | DASHMATCH | FUNCTION S* any* ')'
 | '(' S* any* ')' | '[' S* any* ']' ] S*;
 

Version:
$Id: CSSParser.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer

Constructor Summary
CSSParser()
           
 
Method Summary
 void parse(java.io.Reader css, StyleManager rm)
           
 void parse(java.lang.String css, StyleManager rm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSParser

public CSSParser()
Method Detail

parse

public void parse(java.lang.String css,
                  StyleManager rm)
           throws java.io.IOException
Throws:
java.io.IOException

parse

public void parse(java.io.Reader css,
                  StyleManager rm)
           throws java.io.IOException
Throws:
java.io.IOException

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.