Package com.steadystate.css.parser
Class SACParserCSS2
- java.lang.Object
-
- com.steadystate.css.parser.SACParserCSS2
-
- All Implemented Interfaces:
SACParserCSS2Constants
,org.w3c.css.sac.Parser
public class SACParserCSS2 extends java.lang.Object implements org.w3c.css.sac.Parser, SACParserCSS2Constants
- Version:
- $Id: SACParserCSS2.jj,v 1.2 2008/03/25 16:43:09 sdanig Exp $
- Author:
- David Schweinsberg
-
-
Field Summary
Fields Modifier and Type Field Description Token
jj_nt
Next token.Token
token
Current token.SACParserCSS2TokenManager
token_source
Generated Token Manager.-
Fields inherited from interface com.steadystate.css.parser.SACParserCSS2Constants
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
Constructors Constructor Description SACParserCSS2()
SACParserCSS2(CharStream stream)
Constructor with user supplied CharStream.SACParserCSS2(SACParserCSS2TokenManager tm)
Constructor with generated Token Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3c.css.sac.Condition
_class(org.w3c.css.sac.Condition pred)
protected java.lang.String
add_escapes(java.lang.String str)
org.w3c.css.sac.Condition
attrib(org.w3c.css.sac.Condition pred)
void
charsetRule()
char
combinator()
protected org.w3c.css.sac.CSSParseException
createSkipWarning(java.lang.String key, org.w3c.css.sac.CSSParseException e)
void
declaration()
void
disable_tracing()
Disable tracing.org.w3c.css.sac.SimpleSelector
elementName()
void
enable_tracing()
Enable tracing.org.w3c.css.sac.LexicalUnit
expr()
void
fontFaceRule()
org.w3c.css.sac.LexicalUnit
function(org.w3c.css.sac.LexicalUnit prev)
protected org.w3c.css.sac.LexicalUnit
functionInternal(org.w3c.css.sac.LexicalUnit prev, Token t, org.w3c.css.sac.LexicalUnit params)
ParseException
generateParseException()
Generate ParseException.protected org.w3c.css.sac.ConditionFactory
getConditionFactory()
protected DocumentHandlerExt
getDocumentHandler()
protected org.w3c.css.sac.ErrorHandler
getErrorHandler()
protected java.lang.String
getGrammarUri()
protected org.w3c.css.sac.InputSource
getInputSource()
protected java.util.Locale
getLocale()
org.w3c.css.sac.Locator
getLocator()
Token
getNextToken()
Get the next Token.java.lang.String
getParserVersion()
protected java.util.ResourceBundle
getSACParserMessages()
protected org.w3c.css.sac.SelectorFactory
getSelectorFactory()
protected Token
getToken()
Token
getToken(int index)
Get the specific Token.protected void
handleCharset(java.lang.String characterEncoding)
protected void
handleEndDocument()
protected void
handleEndFontFace()
protected void
handleEndMedia(org.w3c.css.sac.SACMediaList media)
protected void
handleEndPage(java.lang.String name, java.lang.String pseudo_page)
protected void
handleEndSelector(org.w3c.css.sac.SelectorList selectors)
protected void
handleIgnorableAtRule(java.lang.String s)
protected void
handleImportStyle(java.lang.String uri, org.w3c.css.sac.SACMediaList media, java.lang.String defaultNamespaceURI)
protected void
handleMedium(java.lang.String medium)
protected void
handleProperty(java.lang.String name, org.w3c.css.sac.LexicalUnit value, boolean important)
protected void
handleSelector(org.w3c.css.sac.Selector selector)
protected void
handleStartDocument()
protected void
handleStartFontFace()
protected void
handleStartMedia(org.w3c.css.sac.SACMediaList media)
protected void
handleStartPage(java.lang.String name, java.lang.String pseudo_page)
protected void
handleStartSelector(org.w3c.css.sac.SelectorList selectors)
org.w3c.css.sac.Condition
hash(org.w3c.css.sac.Condition pred)
org.w3c.css.sac.LexicalUnit
hexcolor(org.w3c.css.sac.LexicalUnit prev)
protected org.w3c.css.sac.LexicalUnit
hexcolorInternal(org.w3c.css.sac.LexicalUnit prev, Token t)
void
importRule()
void
importRuleIgnored()
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()
org.w3c.css.sac.SACMediaList
parseMedia(org.w3c.css.sac.InputSource source)
boolean
parsePriority(org.w3c.css.sac.InputSource source)
org.w3c.css.sac.LexicalUnit
parsePropertyValue(org.w3c.css.sac.InputSource source)
void
parseRule(org.w3c.css.sac.InputSource source)
org.w3c.css.sac.SelectorList
parseSelectors(org.w3c.css.sac.InputSource source)
void
parseStyleDeclaration(org.w3c.css.sac.InputSource source)
void
parseStyleSheet(java.lang.String uri)
void
parseStyleSheet(org.w3c.css.sac.InputSource source)
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)
Reinitialise.void
ReInit(SACParserCSS2TokenManager tm)
Reinitialise.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)
void
setErrorHandler(org.w3c.css.sac.ErrorHandler eh)
void
setLocale(java.util.Locale locale)
void
setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
org.w3c.css.sac.Selector
simpleSelector(org.w3c.css.sac.Selector sel, char comb)
void
styleDeclaration()
void
styleRule()
void
styleSheet()
void
styleSheetRuleList()
void
styleSheetRuleSingle()
org.w3c.css.sac.LexicalUnit
term(org.w3c.css.sac.LexicalUnit prev)
protected org.w3c.css.sac.CSSParseException
toCSSParseException(TokenMgrError e)
protected org.w3c.css.sac.CSSParseException
toCSSParseException(java.lang.String key, ParseException e)
char
unaryOperator()
void
unknownRule()
-
-
-
Field Detail
-
token_source
public SACParserCSS2TokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
SACParserCSS2
public SACParserCSS2()
-
SACParserCSS2
public SACParserCSS2(CharStream stream)
Constructor with user supplied CharStream.
-
SACParserCSS2
public SACParserCSS2(SACParserCSS2TokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
getParserVersion
public java.lang.String getParserVersion()
- Specified by:
getParserVersion
in interfaceorg.w3c.css.sac.Parser
-
getGrammarUri
protected java.lang.String getGrammarUri()
-
getToken
protected Token getToken()
-
styleSheet
public final void styleSheet() throws ParseException
- Throws:
ParseException
-
styleSheetRuleList
public final void styleSheetRuleList() throws ParseException
- Throws:
ParseException
-
styleSheetRuleSingle
public final void styleSheetRuleSingle() throws ParseException
- Throws:
ParseException
-
charsetRule
public final void charsetRule() throws ParseException
- Throws:
ParseException
-
unknownRule
public final void unknownRule() throws ParseException
- Throws:
ParseException
-
importRule
public final void importRule() throws ParseException
- Throws:
ParseException
-
importRuleIgnored
public final void importRuleIgnored() throws ParseException
- Throws:
ParseException
-
mediaRule
public final void mediaRule() throws ParseException
- Throws:
ParseException
-
mediaList
public final void mediaList(SACMediaListImpl ml) throws ParseException
- Throws:
ParseException
-
mediaRuleList
public final void mediaRuleList() throws ParseException
- Throws:
ParseException
-
mediaRuleSingle
public final void mediaRuleSingle() throws ParseException
- Throws:
ParseException
-
medium
public final java.lang.String medium() throws ParseException
- Throws:
ParseException
-
pageRule
public final void pageRule() throws ParseException
- Throws:
ParseException
-
pseudoPage
public final java.lang.String pseudoPage() throws ParseException
- Throws:
ParseException
-
fontFaceRule
public final void fontFaceRule() throws ParseException
- Throws:
ParseException
-
operator
public final org.w3c.css.sac.LexicalUnit operator(org.w3c.css.sac.LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
combinator
public final char combinator() throws ParseException
- Throws:
ParseException
-
unaryOperator
public final char unaryOperator() throws ParseException
- Throws:
ParseException
-
property
public final java.lang.String property() throws ParseException
- Throws:
ParseException
-
styleRule
public final void styleRule() throws ParseException
- Throws:
ParseException
-
selectorList
public final org.w3c.css.sac.SelectorList selectorList() throws ParseException
- Throws:
ParseException
-
selector
public final org.w3c.css.sac.Selector selector() throws ParseException
- Throws:
ParseException
-
simpleSelector
public final org.w3c.css.sac.Selector simpleSelector(org.w3c.css.sac.Selector sel, char comb) throws ParseException
- Throws:
ParseException
-
_class
public final org.w3c.css.sac.Condition _class(org.w3c.css.sac.Condition pred) throws ParseException
- Throws:
ParseException
-
elementName
public final org.w3c.css.sac.SimpleSelector elementName() throws ParseException
- Throws:
ParseException
-
attrib
public final org.w3c.css.sac.Condition attrib(org.w3c.css.sac.Condition pred) throws ParseException
- Throws:
ParseException
-
pseudo
public final org.w3c.css.sac.Condition pseudo(org.w3c.css.sac.Condition pred) throws ParseException
- Throws:
ParseException
-
hash
public final org.w3c.css.sac.Condition hash(org.w3c.css.sac.Condition pred) throws ParseException
- Throws:
ParseException
-
styleDeclaration
public final void styleDeclaration() throws ParseException
- Throws:
ParseException
-
declaration
public final void declaration() throws ParseException
- Throws:
ParseException
-
prio
public final boolean prio() throws ParseException
- Throws:
ParseException
-
expr
public final org.w3c.css.sac.LexicalUnit expr() throws ParseException
- Throws:
ParseException
-
term
public final org.w3c.css.sac.LexicalUnit term(org.w3c.css.sac.LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
function
public final org.w3c.css.sac.LexicalUnit function(org.w3c.css.sac.LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
rgb
public final org.w3c.css.sac.LexicalUnit rgb(org.w3c.css.sac.LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
hexcolor
public final org.w3c.css.sac.LexicalUnit hexcolor(org.w3c.css.sac.LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
ReInit
public void ReInit(CharStream stream)
Reinitialise.
-
ReInit
public void ReInit(SACParserCSS2TokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
getDocumentHandler
protected DocumentHandlerExt getDocumentHandler()
-
setDocumentHandler
public void setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
- Specified by:
setDocumentHandler
in interfaceorg.w3c.css.sac.Parser
-
getErrorHandler
protected org.w3c.css.sac.ErrorHandler getErrorHandler()
-
setErrorHandler
public void setErrorHandler(org.w3c.css.sac.ErrorHandler eh)
- Specified by:
setErrorHandler
in interfaceorg.w3c.css.sac.Parser
-
getInputSource
protected org.w3c.css.sac.InputSource getInputSource()
-
setLocale
public void setLocale(java.util.Locale locale)
- Specified by:
setLocale
in interfaceorg.w3c.css.sac.Parser
-
getLocale
protected java.util.Locale getLocale()
-
getSelectorFactory
protected org.w3c.css.sac.SelectorFactory getSelectorFactory()
-
setSelectorFactory
public void setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
- Specified by:
setSelectorFactory
in interfaceorg.w3c.css.sac.Parser
-
getConditionFactory
protected org.w3c.css.sac.ConditionFactory getConditionFactory()
-
setConditionFactory
public void setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
- Specified by:
setConditionFactory
in interfaceorg.w3c.css.sac.Parser
-
getSACParserMessages
protected java.util.ResourceBundle getSACParserMessages()
-
getLocator
public org.w3c.css.sac.Locator getLocator()
-
add_escapes
protected java.lang.String add_escapes(java.lang.String str)
-
toCSSParseException
protected org.w3c.css.sac.CSSParseException toCSSParseException(java.lang.String key, ParseException e)
-
toCSSParseException
protected org.w3c.css.sac.CSSParseException toCSSParseException(TokenMgrError e)
-
createSkipWarning
protected org.w3c.css.sac.CSSParseException createSkipWarning(java.lang.String key, org.w3c.css.sac.CSSParseException e)
-
parseStyleSheet
public void parseStyleSheet(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Specified by:
parseStyleSheet
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parseStyleSheet
public void parseStyleSheet(java.lang.String uri) throws java.io.IOException
- Specified by:
parseStyleSheet
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parseStyleDeclaration
public void parseStyleDeclaration(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Specified by:
parseStyleDeclaration
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parseRule
public void parseRule(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Specified by:
parseRule
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parseSelectors
public org.w3c.css.sac.SelectorList parseSelectors(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Specified by:
parseSelectors
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parsePropertyValue
public org.w3c.css.sac.LexicalUnit parsePropertyValue(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Specified by:
parsePropertyValue
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parsePriority
public boolean parsePriority(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Specified by:
parsePriority
in interfaceorg.w3c.css.sac.Parser
- Throws:
java.io.IOException
-
parseMedia
public org.w3c.css.sac.SACMediaList parseMedia(org.w3c.css.sac.InputSource source) throws java.io.IOException
- Throws:
java.io.IOException
-
handleStartDocument
protected void handleStartDocument()
-
handleEndDocument
protected void handleEndDocument()
-
handleIgnorableAtRule
protected void handleIgnorableAtRule(java.lang.String s)
-
handleCharset
protected void handleCharset(java.lang.String characterEncoding)
-
handleImportStyle
protected void handleImportStyle(java.lang.String uri, org.w3c.css.sac.SACMediaList media, java.lang.String defaultNamespaceURI)
-
handleStartMedia
protected void handleStartMedia(org.w3c.css.sac.SACMediaList media)
-
handleMedium
protected void handleMedium(java.lang.String medium)
-
handleEndMedia
protected void handleEndMedia(org.w3c.css.sac.SACMediaList media)
-
handleStartPage
protected void handleStartPage(java.lang.String name, java.lang.String pseudo_page)
-
handleEndPage
protected void handleEndPage(java.lang.String name, java.lang.String pseudo_page)
-
handleStartFontFace
protected void handleStartFontFace()
-
handleEndFontFace
protected void handleEndFontFace()
-
handleSelector
protected void handleSelector(org.w3c.css.sac.Selector selector)
-
handleStartSelector
protected void handleStartSelector(org.w3c.css.sac.SelectorList selectors)
-
handleEndSelector
protected void handleEndSelector(org.w3c.css.sac.SelectorList selectors)
-
handleProperty
protected void handleProperty(java.lang.String name, org.w3c.css.sac.LexicalUnit value, boolean important)
-
functionInternal
protected org.w3c.css.sac.LexicalUnit functionInternal(org.w3c.css.sac.LexicalUnit prev, Token t, org.w3c.css.sac.LexicalUnit params)
-
hexcolorInternal
protected org.w3c.css.sac.LexicalUnit hexcolorInternal(org.w3c.css.sac.LexicalUnit prev, Token t)
-
-