|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.w3c.flute.parser.Parser
public class Parser
A CSS2 parser
Field Summary | |
---|---|
protected ConditionFactory |
conditionFactory
|
protected DocumentHandler |
documentHandler
|
protected ErrorHandler |
errorHandler
|
Token |
jj_nt
Next token. |
protected SelectorFactory |
selectorFactory
|
protected InputSource |
source
|
Token |
token
Current token. |
ParserTokenManager |
token_source
Generated Token Manager. |
Fields inherited from interface org.w3c.flute.parser.ParserConstants |
---|
_URL, ANY, ATKEYWORD, CDC, CDO, CHARSET_SYM, CM, COLON, COMMA, D, DASHMATCH, DEFAULT, DEG, DIMEN, DIV, DOT, EMS, EOF, EQ, ESCAPE, EXS, FONT_FACE_SYM, FUNCTION, GRAD, H, HASH, HZ, IDENT, IMPORT_SYM, IMPORTANT_SYM, IN, IN_COMMENT, INCLUDES, KHZ, LBRACE, LBRACKET, LPARAN, MEDIA_SYM, MINUS, MM, MS, NAME, NMCHAR, NMSTART, NONASCII, NUMBER, PAGE_SYM, PC, PERCENTAGE, PLUS, PRECEDES, PT, PX, RAD, RANGE, RANGE0, RANGE1, RANGE2, RANGE3, RANGE4, RANGE5, RANGE6, RBRACE, RBRACKET, RPARAN, S, SECOND, SEMICOLON, STRING, STRINGCHAR, tokenImage, UNI, UNICODE, UNICODERANGE, UNKNOWN, URL |
Constructor Summary | |
---|---|
Parser()
Creates a new Parser |
|
Parser(CharStream stream)
Constructor with user supplied CharStream. |
|
Parser(ParserTokenManager tm)
Constructor with generated Token Manager. |
Method Summary | |
---|---|
Condition |
_class(Condition pred)
|
void |
_parseDeclarationBlock()
|
void |
_parseImportRule()
|
void |
_parseMediaRule()
|
void |
_parseRule()
The following functions are useful for a DOM CSS implementation only and are not part of the general CSS2 parser. |
SelectorList |
_parseSelectors()
|
void |
afterImportDeclaration()
|
void |
atRuleDeclaration()
|
Condition |
attrib(Condition pred)
|
void |
charset()
|
char |
combinator()
|
void |
declaration()
|
void |
disable_tracing()
Disable tracing. |
SimpleSelector |
element_name()
|
void |
enable_tracing()
Enable tracing. |
LexicalUnit |
expr()
|
void |
fontFace()
|
org.w3c.flute.parser.LexicalUnitImpl |
function(char operator,
org.w3c.flute.parser.LexicalUnitImpl prev)
Handle all CSS2 functions. |
ParseException |
generateParseException()
Generate ParseException. |
Token |
getNextToken()
Get the next Token. |
java.lang.String |
getParserVersion()
This methods returns "http://www.w3.org/TR/REC-CSS2". |
Token |
getToken(int index)
Get the specific Token. |
Condition |
hash(Condition pred)
|
org.w3c.flute.parser.LexicalUnitImpl |
hexcolor(org.w3c.flute.parser.LexicalUnitImpl prev)
|
void |
ignoreStatement()
|
void |
importDeclaration()
The import statement |
void |
media()
|
void |
mediaStatement(MediaListImpl ml)
|
java.lang.String |
medium()
|
org.w3c.flute.parser.LexicalUnitImpl |
operator(org.w3c.flute.parser.LexicalUnitImpl prev)
|
void |
page()
|
void |
parseImportRule(InputSource source)
Parse methods used by DOM Level 2 implementation. |
void |
parseMediaRule(InputSource source)
|
boolean |
parsePriority(InputSource source)
|
LexicalUnit |
parsePropertyValue(InputSource source)
|
void |
parseRule(InputSource source)
This method parses only one rule (style rule or at-rule, except @charset). |
void |
parserUnit()
The main entry for the parser. |
SelectorList |
parseSelectors(InputSource source)
|
void |
parseStyleDeclaration(InputSource source)
This method parses a style declaration (including the surrounding curly braces). |
void |
parseStyleSheet(InputSource source)
Main parse methods |
boolean |
prio()
|
java.lang.String |
property()
|
java.lang.String |
pseudo_page()
|
Condition |
pseudo(Condition pred)
|
void |
ReInit(CharStream stream)
Reinitialise. |
void |
ReInit(ParserTokenManager tm)
Reinitialise. |
Selector |
selector()
|
SelectorList |
selectorList()
|
void |
setConditionFactory(ConditionFactory conditionFactory)
|
void |
setDocumentHandler(DocumentHandler handler)
Set the document handler for this parser |
void |
setErrorHandler(ErrorHandler error)
Set the error handler for this parser |
void |
setLocale(java.util.Locale locale)
|
void |
setSelectorFactory(SelectorFactory selectorFactory)
|
Selector |
simple_selector(Selector selector,
char comb)
|
void |
skipUnknownRule()
|
void |
styleRule()
|
org.w3c.flute.parser.LexicalUnitImpl |
term(org.w3c.flute.parser.LexicalUnitImpl prev)
|
char |
unaryOperator()
|
org.w3c.flute.parser.LexicalUnitImpl |
unicode(org.w3c.flute.parser.LexicalUnitImpl prev)
|
org.w3c.flute.parser.LexicalUnitImpl |
url(org.w3c.flute.parser.LexicalUnitImpl prev)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DocumentHandler documentHandler
protected ErrorHandler errorHandler
protected InputSource source
protected ConditionFactory conditionFactory
protected SelectorFactory selectorFactory
public ParserTokenManager token_source
public Token token
public Token jj_nt
Constructor Detail |
---|
public Parser()
public Parser(CharStream stream)
public Parser(ParserTokenManager tm)
Method Detail |
---|
public void setLocale(java.util.Locale locale) throws CSSException
CSSException
- Not yet implementedpublic void setDocumentHandler(DocumentHandler handler)
public void setSelectorFactory(SelectorFactory selectorFactory)
public void setConditionFactory(ConditionFactory conditionFactory)
public void setErrorHandler(ErrorHandler error)
public void parseStyleSheet(InputSource source) throws CSSException, java.io.IOException
source
- the source of the style sheet.
java.io.IOException
- the source can't be parsed.
CSSException
- the source is not CSS valid.public void parseRule(InputSource source) throws CSSException, java.io.IOException
source
- the source of the rule.
java.io.IOException
- the source can't be parsed.
CSSException
- the source is not CSS valid.public void parseStyleDeclaration(InputSource source) throws CSSException, java.io.IOException
source
- the source of the style declaration.
java.io.IOException
- the source can't be parsed.
CSSException
- the source is not CSS valid.public java.lang.String getParserVersion()
public void parseImportRule(InputSource source) throws CSSException, java.io.IOException
CSSException
java.io.IOException
public void parseMediaRule(InputSource source) throws CSSException, java.io.IOException
CSSException
java.io.IOException
public SelectorList parseSelectors(InputSource source) throws CSSException, java.io.IOException
CSSException
java.io.IOException
public LexicalUnit parsePropertyValue(InputSource source) throws CSSException, java.io.IOException
CSSException
java.io.IOException
public boolean parsePriority(InputSource source) throws CSSException, java.io.IOException
CSSException
java.io.IOException
public final void parserUnit() throws ParseException
ParseException
- exception during the parsepublic final void charset() throws ParseException
ParseException
public final void afterImportDeclaration() throws ParseException
ParseException
public final void ignoreStatement() throws ParseException
ParseException
public final void importDeclaration() throws ParseException
ParseException
- exception during the parsepublic final void media() throws ParseException
ParseException
- exception during the parsepublic final void mediaStatement(MediaListImpl ml) throws ParseException
ParseException
public final java.lang.String medium() throws ParseException
ParseException
- exception during the parsepublic final void page() throws ParseException
ParseException
- exception during the parsepublic final java.lang.String pseudo_page() throws ParseException
ParseException
public final void fontFace() throws ParseException
ParseException
public final void atRuleDeclaration() throws ParseException
ParseException
- exception during the parsepublic final void skipUnknownRule() throws ParseException
ParseException
public final char combinator() throws ParseException
ParseException
- exception during the parsepublic final java.lang.String property() throws ParseException
ParseException
- exception during the parsepublic final void styleRule() throws ParseException
ParseException
- exception during the parsepublic final SelectorList selectorList() throws ParseException
ParseException
public final Selector selector() throws ParseException
ParseException
- exception during the parsepublic final Selector simple_selector(Selector selector, char comb) throws ParseException
ParseException
- exception during the parsepublic final Condition _class(Condition pred) throws ParseException
ParseException
- exception during the parsepublic final SimpleSelector element_name() throws ParseException
ParseException
- exception during the parsepublic final Condition attrib(Condition pred) throws ParseException
ParseException
- exception during the parsepublic final Condition pseudo(Condition pred) throws ParseException
ParseException
- exception during the parsepublic final Condition hash(Condition pred) throws ParseException
ParseException
- exception during the parsepublic final void declaration() throws ParseException
ParseException
- exception during the parsepublic final boolean prio() throws ParseException
ParseException
- exception during the parsepublic final org.w3c.flute.parser.LexicalUnitImpl operator(org.w3c.flute.parser.LexicalUnitImpl prev) throws ParseException
ParseException
- exception during the parsepublic final LexicalUnit expr() throws ParseException
ParseException
- exception during the parsepublic final char unaryOperator() throws ParseException
ParseException
- exception during the parsepublic final org.w3c.flute.parser.LexicalUnitImpl term(org.w3c.flute.parser.LexicalUnitImpl prev) throws ParseException
ParseException
- exception during the parsepublic final org.w3c.flute.parser.LexicalUnitImpl function(char operator, org.w3c.flute.parser.LexicalUnitImpl prev) throws ParseException
ParseException
- exception during the parsepublic final org.w3c.flute.parser.LexicalUnitImpl unicode(org.w3c.flute.parser.LexicalUnitImpl prev) throws ParseException
ParseException
public final org.w3c.flute.parser.LexicalUnitImpl url(org.w3c.flute.parser.LexicalUnitImpl prev) throws ParseException
ParseException
public final org.w3c.flute.parser.LexicalUnitImpl hexcolor(org.w3c.flute.parser.LexicalUnitImpl prev) throws ParseException
ParseException
- exception during the parsepublic final void _parseRule() throws ParseException
ParseException
public final void _parseImportRule() throws ParseException
ParseException
public final void _parseMediaRule() throws ParseException
ParseException
public final void _parseDeclarationBlock() throws ParseException
ParseException
public final SelectorList _parseSelectors() throws ParseException
ParseException
public void ReInit(CharStream stream)
public void ReInit(ParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |