Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.steadystate.css.parser
Class SACParser  view SACParser download SACParser.java

java.lang.Object
  extended bycom.steadystate.css.parser.SACParser
All Implemented Interfaces:
org.w3c.css.sac.Parser, SACParserConstants

public class SACParser
extends java.lang.Object
implements org.w3c.css.sac.Parser, SACParserConstants

Version:
$Release$

Nested Class Summary
(package private) static class SACParser.JJCalls
           
 
Field Summary
private  org.w3c.css.sac.ConditionFactory _conditionFactory
           
private  org.w3c.css.sac.DocumentHandler _docHandler
           
private  org.w3c.css.sac.ErrorHandler _errHandler
           
private  java.util.Locale _locale
           
private  boolean _quiet
           
private  org.w3c.css.sac.SelectorFactory _selectorFactory
           
private  org.w3c.css.sac.InputSource _source
           
private  SACParser.JJCalls[] jj_2_rtns
           
private  int jj_endpos
           
private  java.util.Vector jj_expentries
           
private  int[] jj_expentry
           
private  int jj_gc
           
private  int jj_gen
           
private  int jj_kind
           
private  int jj_la
           
private  int[] jj_la1
           
private  int[] jj_la1_0
           
private  int[] jj_la1_1
           
private  int[] jj_la1_2
           
private  Token jj_lastpos
           
private  int[] jj_lasttokens
           
 Token jj_nt
           
private  int jj_ntk
           
private  boolean jj_rescan
           
private  Token jj_scanpos
           
private  boolean jj_semLA
           
 boolean lookingAhead
           
 Token token
           
 SACParserTokenManager token_source
           
 
Fields inherited from interface com.steadystate.css.parser.SACParserConstants
ANGLE_DEG, ANGLE_GRAD, ANGLE_RAD, ASTERISK, ATKEYWORD, CDC, CDO, CHARSET_SYM, COLON, COMMA, COMMENT, DASHMATCH, DEFAULT, DIMEN, DOT, EMS, EOF, EQUALS, ESCAPE, EXS, FONT_FACE_SYM, FREQ_HZ, FREQ_KHZ, FUNCTION, GT, H, HASH, HNUM, IDENT, IMPORT_SYM, IMPORTANT_SYM, INCLUDES, INHERIT, LBRACE, LENGTH_CM, LENGTH_IN, LENGTH_MM, LENGTH_PC, LENGTH_PT, LENGTH_PX, LSQUARE, MEDIA_SYM, MINUS, NAME, NL, NMCHAR, NMSTART, NONASCII, NUM, NUMBER, PAGE_SYM, PERCENTAGE, PLUS, Q11, Q12, Q13, Q14, Q15, Q16, RANGE, RBRACE, RGB, RROUND, RSQUARE, S, SEMICOLON, SLASH, STRING, STRING1, STRING2, TIME_MS, TIME_S, tokenImage, UNICODE, UNICODERANGE, UNKNOWN, URI, URL
 
Constructor Summary
SACParser()
           
SACParser(CharStream stream)
           
SACParser(SACParserTokenManager tm)
           
 
Method Summary
 org.w3c.css.sac.Condition _class(org.w3c.css.sac.Condition pred)
           
 org.w3c.css.sac.Condition attrib(org.w3c.css.sac.Condition pred)
           
 void charsetRule()
           
 char combinator()
           
 void declaration()
           
 void disable_tracing()
           
 org.w3c.css.sac.SimpleSelector elementName()
           
 void enable_tracing()
           
(package private)  void error_skipblock()
           
(package private)  void error_skipdecl()
           
 org.w3c.css.sac.LexicalUnit expr()
           
 void fontFaceRule()
           
 org.w3c.css.sac.LexicalUnit function(org.w3c.css.sac.LexicalUnit prev)
           
 ParseException generateParseException()
           
private  CharStream getCharStream(org.w3c.css.sac.InputSource source)
           
(package private)  int getLastNumPos(java.lang.String s)
           
private  org.w3c.css.sac.Locator getLocator()
           
 Token getNextToken()
           
 java.lang.String getParserVersion()
          Returns a string about which CSS language is supported by this parser.
 Token getToken(int index)
           
 org.w3c.css.sac.Condition hash(org.w3c.css.sac.Condition pred)
           
 org.w3c.css.sac.LexicalUnit hexcolor(org.w3c.css.sac.LexicalUnit prev)
           
 void importRule()
           
private  boolean jj_2_1(int xla)
           
private  boolean jj_2_2(int xla)
           
private  boolean jj_3_1()
           
private  boolean jj_3_2()
           
private  boolean jj_3R_58()
           
private  boolean jj_3R_59()
           
private  boolean jj_3R_60()
           
private  boolean jj_3R_61()
           
private  boolean jj_3R_62()
           
private  boolean jj_3R_63()
           
private  boolean jj_3R_64()
           
private  boolean jj_3R_65()
           
private  boolean jj_3R_66()
           
private  boolean jj_3R_67()
           
private  boolean jj_3R_68()
           
private  boolean jj_3R_69()
           
private  boolean jj_3R_70()
           
private  boolean jj_3R_71()
           
private  boolean jj_3R_72()
           
private  boolean jj_3R_73()
           
private  boolean jj_3R_74()
           
private  boolean jj_3R_75()
           
private  boolean jj_3R_76()
           
private  boolean jj_3R_77()
           
private  boolean jj_3R_78()
           
private  boolean jj_3R_79()
           
private  boolean jj_3R_80()
           
private  boolean jj_3R_81()
           
private  boolean jj_3R_82()
           
private  void jj_add_error_token(int kind, int pos)
           
private  Token jj_consume_token(int kind)
           
private  int jj_ntk()
           
private  void jj_rescan_token()
           
private  void jj_save(int index, int xla)
           
private  boolean jj_scan_token(int kind)
           
 void mediaList(SACMediaListImpl ml)
           
 void mediaRule()
           
 void mediaRuleList()
           
 void mediaRuleSingle()
           
 java.lang.String medium()
           
 org.w3c.css.sac.LexicalUnit operator(org.w3c.css.sac.LexicalUnit prev)
           
 void pageRule()
           
 boolean parsePriority(org.w3c.css.sac.InputSource source)
          Parse a CSS priority value (e.g.
 org.w3c.css.sac.LexicalUnit parsePropertyValue(org.w3c.css.sac.InputSource source)
          Parse a CSS property value.
 void parseRule(org.w3c.css.sac.InputSource source)
          Parse a CSS rule.
 org.w3c.css.sac.SelectorList parseSelectors(org.w3c.css.sac.InputSource source)
          Parse a comma separated list of selectors.
 void parseStyleDeclaration(org.w3c.css.sac.InputSource source)
          Parse a CSS style declaration (without '{' and '}').
 void parseStyleSheet(org.w3c.css.sac.InputSource source)
          Parse a CSS document.
 void parseStyleSheet(java.lang.String uri)
          Parse a CSS document from a URI.
 boolean prio()
           
 java.lang.String property()
           
 org.w3c.css.sac.Condition pseudo(org.w3c.css.sac.Condition pred)
           
 java.lang.String pseudoPage()
           
 void ReInit(CharStream stream)
           
 void ReInit(SACParserTokenManager tm)
           
 org.w3c.css.sac.LexicalUnit rgb(org.w3c.css.sac.LexicalUnit prev)
           
 org.w3c.css.sac.Selector selector()
           
 org.w3c.css.sac.SelectorList selectorList()
           
 void setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
           
 void setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
          Allow an application to register a document event handler.
 void setErrorHandler(org.w3c.css.sac.ErrorHandler handler)
          Allow an application to register an error event handler.
 void setLocale(java.util.Locale locale)
          Allow an application to request a locale for errors and warnings.
 void setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
           
 org.w3c.css.sac.Selector simpleSelector(org.w3c.css.sac.Selector sel, char comb)
           
(package private)  java.lang.String skip()
           
(package private)  void skipSelector()
           
 void styleDeclaration()
           
 void styleRule()
           
 void styleSheet()
           
 void styleSheetRuleList()
           
 void styleSheetRuleSingle()
           
 org.w3c.css.sac.LexicalUnit term(org.w3c.css.sac.LexicalUnit prev)
           
 char unaryOperator()
           
(package private)  java.lang.String unescape(java.lang.String s)
           
 void unknownRule()
           
(package private)  float value(char op, java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_source

private org.w3c.css.sac.InputSource _source

_locale

private java.util.Locale _locale

_docHandler

private org.w3c.css.sac.DocumentHandler _docHandler

_errHandler

private org.w3c.css.sac.ErrorHandler _errHandler

_selectorFactory

private org.w3c.css.sac.SelectorFactory _selectorFactory

_conditionFactory

private org.w3c.css.sac.ConditionFactory _conditionFactory

_quiet

private boolean _quiet

token_source

public SACParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

jj_ntk

private int jj_ntk

jj_scanpos

private Token jj_scanpos

jj_lastpos

private Token jj_lastpos

jj_la

private int jj_la

lookingAhead

public boolean lookingAhead

jj_semLA

private boolean jj_semLA

jj_gen

private int jj_gen

jj_la1

private final int[] jj_la1

jj_la1_0

private final int[] jj_la1_0

jj_la1_1

private final int[] jj_la1_1

jj_la1_2

private final int[] jj_la1_2

jj_2_rtns

private final SACParser.JJCalls[] jj_2_rtns

jj_rescan

private boolean jj_rescan

jj_gc

private int jj_gc

jj_expentries

private java.util.Vector jj_expentries

jj_expentry

private int[] jj_expentry

jj_kind

private int jj_kind

jj_lasttokens

private int[] jj_lasttokens

jj_endpos

private int jj_endpos
Constructor Detail

SACParser

public SACParser()

SACParser

public SACParser(CharStream stream)

SACParser

public SACParser(SACParserTokenManager tm)
Method Detail

setLocale

public void setLocale(java.util.Locale locale)
               throws org.w3c.css.sac.CSSException
Description copied from interface: org.w3c.css.sac.Parser
Allow an application to request a locale for errors and warnings.

CSS parsers are not required to provide localisation for errors and warnings; if they cannot support the requested locale, however, they must throw a CSS exception. Applications may not request a locale change in the middle of a parse.

Specified by:
setLocale in interface org.w3c.css.sac.Parser

setDocumentHandler

public void setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
Description copied from interface: org.w3c.css.sac.Parser
Allow an application to register a document event handler.

If the application does not register a document handler, all document events reported by the CSS parser will be silently ignored (this is the default behaviour implemented by HandlerBase).

Applications may register a new or different handler in the middle of a parse, and the CSS parser must begin using the new handler immediately.

Specified by:
setDocumentHandler in interface org.w3c.css.sac.Parser

setSelectorFactory

public void setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
Specified by:
setSelectorFactory in interface org.w3c.css.sac.Parser

setConditionFactory

public void setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
Specified by:
setConditionFactory in interface org.w3c.css.sac.Parser

setErrorHandler

public void setErrorHandler(org.w3c.css.sac.ErrorHandler handler)
Description copied from interface: org.w3c.css.sac.Parser
Allow an application to register an error event handler.

If the application does not register an error event handler, all error events reported by the CSS parser will be silently ignored, except for fatalError, which will throw a CSSException (this is the default behaviour implemented by HandlerBase).

Applications may register a new or different handler in the middle of a parse, and the CSS parser must begin using the new handler immediately.

Specified by:
setErrorHandler in interface org.w3c.css.sac.Parser

parseStyleSheet

public void parseStyleSheet(org.w3c.css.sac.InputSource source)
                     throws org.w3c.css.sac.CSSException,
                            java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a CSS document.

The application can use this method to instruct the CSS parser to begin parsing an CSS document from any valid input source (a character stream, a byte stream, or a URI).

Applications may not invoke this method while a parse is in progress (they should create a new Parser instead for each additional CSS document). Once a parse is complete, an application may reuse the same Parser object, possibly with a different input source.

Specified by:
parseStyleSheet in interface org.w3c.css.sac.Parser

parseStyleSheet

public void parseStyleSheet(java.lang.String uri)
                     throws org.w3c.css.sac.CSSException,
                            java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a CSS document from a URI.

This method is a shortcut for the common case of reading a document from a URI. It is the exact equivalent of the following:

 parse(new InputSource(uri));
 

The URI must be fully resolved by the application before it is passed to the parser.

Specified by:
parseStyleSheet in interface org.w3c.css.sac.Parser

parseStyleDeclaration

public void parseStyleDeclaration(org.w3c.css.sac.InputSource source)
                           throws org.w3c.css.sac.CSSException,
                                  java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a CSS style declaration (without '{' and '}').

Specified by:
parseStyleDeclaration in interface org.w3c.css.sac.Parser

parseRule

public void parseRule(org.w3c.css.sac.InputSource source)
               throws org.w3c.css.sac.CSSException,
                      java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a CSS rule.

Specified by:
parseRule in interface org.w3c.css.sac.Parser

getParserVersion

public java.lang.String getParserVersion()
Description copied from interface: org.w3c.css.sac.Parser
Returns a string about which CSS language is supported by this parser. For CSS Level 1, it returns "http://www.w3.org/TR/REC-CSS1", for CSS Level 2, it returns "http://www.w3.org/TR/REC-CSS2". Note that a "CSSx" parser can return lexical unit other than those allowed by CSS Level x but this usage is not recommended.

Specified by:
getParserVersion in interface org.w3c.css.sac.Parser

parseSelectors

public org.w3c.css.sac.SelectorList parseSelectors(org.w3c.css.sac.InputSource source)
                                            throws org.w3c.css.sac.CSSException,
                                                   java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a comma separated list of selectors.

Specified by:
parseSelectors in interface org.w3c.css.sac.Parser

parsePropertyValue

public org.w3c.css.sac.LexicalUnit parsePropertyValue(org.w3c.css.sac.InputSource source)
                                               throws org.w3c.css.sac.CSSException,
                                                      java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a CSS property value.

Specified by:
parsePropertyValue in interface org.w3c.css.sac.Parser

parsePriority

public boolean parsePriority(org.w3c.css.sac.InputSource source)
                      throws org.w3c.css.sac.CSSException,
                             java.io.IOException
Description copied from interface: org.w3c.css.sac.Parser
Parse a CSS priority value (e.g. "!important").

Specified by:
parsePriority in interface org.w3c.css.sac.Parser

getCharStream

private CharStream getCharStream(org.w3c.css.sac.InputSource source)
                          throws org.w3c.css.sac.CSSException,
                                 java.io.IOException

getLocator

private org.w3c.css.sac.Locator getLocator()

styleSheet

public final void styleSheet()
                      throws ParseException

styleSheetRuleList

public final void styleSheetRuleList()
                              throws ParseException

styleSheetRuleSingle

public final void styleSheetRuleSingle()
                                throws ParseException

charsetRule

public final void charsetRule()
                       throws ParseException

unknownRule

public final void unknownRule()
                       throws ParseException

importRule

public final void importRule()
                      throws ParseException

mediaRule

public final void mediaRule()
                     throws ParseException

mediaList

public final void mediaList(SACMediaListImpl ml)
                     throws ParseException

mediaRuleList

public final void mediaRuleList()
                         throws ParseException

mediaRuleSingle

public final void mediaRuleSingle()
                           throws ParseException

medium

public final java.lang.String medium()
                              throws ParseException

pageRule

public final void pageRule()
                    throws ParseException

pseudoPage

public final java.lang.String pseudoPage()
                                  throws ParseException

fontFaceRule

public final void fontFaceRule()
                        throws ParseException

operator

public final org.w3c.css.sac.LexicalUnit operator(org.w3c.css.sac.LexicalUnit prev)
                                           throws ParseException

combinator

public final char combinator()
                      throws ParseException

unaryOperator

public final char unaryOperator()
                         throws ParseException

property

public final java.lang.String property()
                                throws ParseException

styleRule

public final void styleRule()
                     throws ParseException

selectorList

public final org.w3c.css.sac.SelectorList selectorList()
                                                throws ParseException

selector

public final org.w3c.css.sac.Selector selector()
                                        throws ParseException

simpleSelector

public final org.w3c.css.sac.Selector simpleSelector(org.w3c.css.sac.Selector sel,
                                                     char comb)
                                              throws ParseException

_class

public final org.w3c.css.sac.Condition _class(org.w3c.css.sac.Condition pred)
                                       throws ParseException

elementName

public final org.w3c.css.sac.SimpleSelector elementName()
                                                 throws ParseException

attrib

public final org.w3c.css.sac.Condition attrib(org.w3c.css.sac.Condition pred)
                                       throws ParseException

pseudo

public final org.w3c.css.sac.Condition pseudo(org.w3c.css.sac.Condition pred)
                                       throws ParseException

hash

public final org.w3c.css.sac.Condition hash(org.w3c.css.sac.Condition pred)
                                     throws ParseException

styleDeclaration

public final void styleDeclaration()
                            throws ParseException

declaration

public final void declaration()
                       throws ParseException

prio

public final boolean prio()
                   throws ParseException

expr

public final org.w3c.css.sac.LexicalUnit expr()
                                       throws ParseException

term

public final org.w3c.css.sac.LexicalUnit term(org.w3c.css.sac.LexicalUnit prev)
                                       throws ParseException

function

public final org.w3c.css.sac.LexicalUnit function(org.w3c.css.sac.LexicalUnit prev)
                                           throws ParseException

rgb

public final org.w3c.css.sac.LexicalUnit rgb(org.w3c.css.sac.LexicalUnit prev)
                                      throws ParseException

hexcolor

public final org.w3c.css.sac.LexicalUnit hexcolor(org.w3c.css.sac.LexicalUnit prev)
                                           throws ParseException

value

float value(char op,
            java.lang.String s)
      throws ParseException

getLastNumPos

int getLastNumPos(java.lang.String s)
            throws ParseException

unescape

java.lang.String unescape(java.lang.String s)
                    throws ParseException

skipSelector

void skipSelector()
            throws ParseException

skip

java.lang.String skip()
                throws ParseException

error_skipblock

void error_skipblock()
               throws ParseException

error_skipdecl

void error_skipdecl()
              throws ParseException

jj_2_1

private final boolean jj_2_1(int xla)

jj_2_2

private final boolean jj_2_2(int xla)

jj_3_2

private final boolean jj_3_2()

jj_3R_71

private final boolean jj_3R_71()

jj_3R_68

private final boolean jj_3R_68()

jj_3R_74

private final boolean jj_3R_74()

jj_3R_78

private final boolean jj_3R_78()

jj_3R_63

private final boolean jj_3R_63()

jj_3R_77

private final boolean jj_3R_77()

jj_3R_62

private final boolean jj_3R_62()

jj_3R_76

private final boolean jj_3R_76()

jj_3R_73

private final boolean jj_3R_73()

jj_3R_69

private final boolean jj_3R_69()

jj_3R_61

private final boolean jj_3R_61()

jj_3R_75

private final boolean jj_3R_75()

jj_3R_70

private final boolean jj_3R_70()

jj_3R_58

private final boolean jj_3R_58()

jj_3R_59

private final boolean jj_3R_59()

jj_3R_65

private final boolean jj_3R_65()

jj_3R_80

private final boolean jj_3R_80()

jj_3R_64

private final boolean jj_3R_64()

jj_3R_72

private final boolean jj_3R_72()

jj_3R_82

private final boolean jj_3R_82()

jj_3R_60

private final boolean jj_3R_60()

jj_3R_81

private final boolean jj_3R_81()

jj_3R_66

private final boolean jj_3R_66()

jj_3R_67

private final boolean jj_3R_67()

jj_3R_79

private final boolean jj_3R_79()

jj_3_1

private final boolean jj_3_1()

ReInit

public void ReInit(CharStream stream)

ReInit

public void ReInit(SACParserTokenManager tm)

jj_consume_token

private final Token jj_consume_token(int kind)
                              throws ParseException

jj_scan_token

private final boolean jj_scan_token(int kind)

getNextToken

public final Token getNextToken()

getToken

public final Token getToken(int index)

jj_ntk

private final int jj_ntk()

jj_add_error_token

private void jj_add_error_token(int kind,
                                int pos)

generateParseException

public final ParseException generateParseException()

enable_tracing

public final void enable_tracing()

disable_tracing

public final void disable_tracing()

jj_rescan_token

private final void jj_rescan_token()

jj_save

private final void jj_save(int index,
                           int xla)