All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.css.parser.analyzer.CssParser
java.lang.Object
|
+----org.w3c.css.parser.analyzer.CssParser
- public abstract class CssParser
- extends Object
- implements CssParserConstants
A CSS2 parser
-
atRule
-
-
currentContext
- The current context recognized by the parser (for errors).
-
currentProperty
- The current property recognized by the parser (for errors).
-
frame
- I store errors and warnings here.
-
jj_nt
-
-
lookingAhead
-
-
markRule
-
true if the parser had recognize a rule,
false otherwise.
-
mode
-
true if the parser should recognized Aural properties,
false otherwise.
-
token
-
-
token_source
-
-
url
- The URL of the document
-
CssParser(CssParserTokenManager)
-
-
CssParser(InputStream)
-
-
_class(CssSelectors)
-
-
afterImportDeclaration()
-
-
atRuleDeclaration()
-
-
attrib(CssSelectors)
-
-
charset()
-
-
combinator()
-
-
declaration()
-
-
declarations()
-
-
deprecated_class()
-
-
disable_tracing()
-
-
element_name(CssSelectors)
-
-
enable_tracing()
-
-
expr()
-
-
fontFace()
-
-
function()
-
-
generateParseException()
-
-
getAtRule()
- Returns the attribute atRule
-
getLine()
- Returns the current line in the style sheet
-
getNextToken()
-
-
getSourceFile()
- Returns the source file of the style sheet
-
getToken(int)
-
-
getURL()
-
-
handleAtRule(String, String)
- Call by the at-rule statement.
-
handleDeclaration(String, CssExpression, boolean)
- Assign an expression to a property.
-
handleImport(URL, String, AtRuleMedia)
- Call by the import statement.
-
handleRule(CssSelectors, Vector)
- Adds a vector of properties to a selector.
-
hash(CssSelectors)
-
-
hexcolor(CssExpression)
-
-
ignoreStatement()
-
-
importDeclaration()
- The import statement
-
media()
-
-
medium(AtRuleMedia)
-
-
operator(CssExpression)
-
-
page()
-
-
parserUnit()
- The main entry for the parser.
-
prio()
-
-
property()
-
-
pseudo(CssSelectors)
-
-
pseudo_page(AtRulePage)
-
-
ReInit(CssParserTokenManager)
-
-
ReInit(InputStream)
-
-
ReInit(InputStream, Frame)
- Reinitialized the parser.
-
ruleSet()
-
-
selector()
-
-
setAtRule(AtRule)
- Set the attribute atRule
-
setFrame(Frame)
- The frame for handling errors and warnings.
-
setURL(URL)
- Set the URL of the style sheet.
-
simple_selector(CssSelectors)
-
-
term(CssExpression)
-
-
unaryOperator()
-
atRule
protected AtRule atRule
url
protected URL url
- The URL of the document
frame
protected Frame frame
- I store errors and warnings here.
currentContext
protected Vector currentContext
- The current context recognized by the parser (for errors).
currentProperty
protected String currentProperty
- The current property recognized by the parser (for errors).
mode
protected static boolean mode
-
true if the parser should recognized Aural properties,
false otherwise.
markRule
protected boolean markRule
-
true if the parser had recognize a rule,
false otherwise.
token_source
public CssParserTokenManager token_source
token
public Token token
jj_nt
public Token jj_nt
lookingAhead
public boolean lookingAhead
CssParser
public CssParser(InputStream stream)
CssParser
public CssParser(CssParserTokenManager tm)
setFrame
public final void setFrame(Frame frame)
- The frame for handling errors and warnings.
- Parameters:
- frame - the new frame for the parser.
setAtRule
public void setAtRule(AtRule atRule)
- Set the attribute atRule
- Parameters:
- atRule - the new value for the attribute
getAtRule
public AtRule getAtRule()
- Returns the attribute atRule
- Returns:
- the value of the attribute
ReInit
public void ReInit(InputStream stream,
Frame frame)
- Reinitialized the parser.
- Parameters:
- stream - the stream data to parse.
- frame - the new frame to use for parsing.
handleImport
public abstract void handleImport(URL url,
String file,
AtRuleMedia media)
- Call by the import statement.
- Parameters:
- url - The style sheet where this import statement appears.
- file - the file name in the import
handleAtRule
public abstract void handleAtRule(String ident,
String string)
- Call by the at-rule statement.
- Parameters:
- ident - The ident for this at-rule (for example: 'font-face')
- string - The string associate to this at-rule
- See Also:
- Couple
handleDeclaration
public abstract CssProperty handleDeclaration(String property,
CssExpression values,
boolean important) throws InvalidParamException
- Assign an expression to a property. This function create a new property
with
property and assign to it the expression with the
importance. Don't forget to set informations too.
A subclass must provide an implementation of this method.
- Parameters:
- property - the name of the property
- values - the expression representation of values
- important -
true if values are important
- Returns:
-
nullor a property
- See Also:
- CssProperty
handleRule
public abstract void handleRule(CssSelectors selector,
Vector declarations)
- Adds a vector of properties to a selector.
A subclass must provide an implementation of this method.
- Parameters:
- selector - the selector
- declarations - Properties to associate with contexts
getSourceFile
public final String getSourceFile()
- Returns the source file of the style sheet
getLine
public final int getLine()
- Returns the current line in the style sheet
setURL
public final void setURL(URL url)
- Set the URL of the style sheet.
- Parameters:
- URL - The URL for the style sheet
getURL
public final URL getURL()
parserUnit
public final void parserUnit() throws ParseException
- The main entry for the parser.
- Throws: ParseException
- exception during the parse
charset
public final void charset() throws ParseException
afterImportDeclaration
public final void afterImportDeclaration() throws ParseException
ignoreStatement
public final void ignoreStatement() throws ParseException
importDeclaration
public final void importDeclaration() throws ParseException
- The import statement
- Throws: ParseException
- exception during the parse
media
public final void media() throws ParseException
- Throws: ParseException
- exception during the parse
medium
public final void medium(AtRuleMedia media) throws ParseException
- Throws: ParseException
- exception during the parse
page
public final void page() throws ParseException
- Throws: ParseException
- exception during the parse
pseudo_page
public final void pseudo_page(AtRulePage page) throws ParseException
fontFace
public final void fontFace() throws ParseException
atRuleDeclaration
public final void atRuleDeclaration() throws ParseException
- Throws: ParseException
- exception during the parse
operator
public final void operator(CssExpression expr) throws ParseException
- Throws: ParseException
- exception during the parse
combinator
public final char combinator() throws ParseException
- Throws: ParseException
- exception during the parse
unaryOperator
public final char unaryOperator() throws ParseException
- Throws: ParseException
- exception during the parse
property
public final String property() throws ParseException
- Throws: ParseException
- exception during the parse
ruleSet
public final void ruleSet() throws ParseException
- Throws: ParseException
- exception during the parse
declarations
public final Vector declarations() throws ParseException
selector
public final CssSelectors selector() throws ParseException
- Throws: ParseException
- exception during the parse
simple_selector
public final CssSelectors simple_selector(CssSelectors next) throws ParseException
- Throws: ParseException
- exception during the parse
_class
public final void _class(CssSelectors s) throws ParseException
- Throws: ParseException
- exception during the parse
deprecated_class
public final Token deprecated_class() throws ParseException
element_name
public final void element_name(CssSelectors s) throws ParseException
- Throws: ParseException
- exception during the parse
attrib
public final void attrib(CssSelectors s) throws ParseException
- Throws: ParseException
- exception during the parse
pseudo
public final void pseudo(CssSelectors s) throws ParseException
- Throws: ParseException
- exception during the parse
hash
public final void hash(CssSelectors s) throws ParseException
- Throws: ParseException
- exception during the parse
declaration
public final CssProperty declaration() throws ParseException
- Throws: ParseException
- exception during the parse
prio
public final boolean prio() throws ParseException
- Throws: ParseException
- exception during the parse
expr
public final CssExpression expr() throws ParseException
- Throws: ParseException
- exception during the parse
term
public final void term(CssExpression exp) throws ParseException
- Throws: ParseException
- exception during the parse
function
public final CssValue function() throws ParseException
- Throws: ParseException
- exception during the parse
hexcolor
public final void hexcolor(CssExpression exp) throws ParseException
- Throws: ParseException
- exception during the parse
ReInit
public void ReInit(InputStream stream)
ReInit
public void ReInit(CssParserTokenManager tm)
getNextToken
public final Token getNextToken()
getToken
public final Token getToken(int index)
generateParseException
public final ParseException generateParseException()
enable_tracing
public final void enable_tracing()
disable_tracing
public final void disable_tracing()
All Packages Class Hierarchy This Package Previous Next Index