public class CSS3Parser extends java.lang.Object implements CSS3ParserConstants
Modifier and Type | Field and Description |
---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
CSS3ParserTokenManager |
token_source
Generated Token Manager.
|
static java.util.HashSet<java.lang.String> |
unsupportedPropertyNames |
_IDENT, _INVALID, _S, _STRING, _URL, _W, AND, ANGLE, ANY, ATBOTTOM, ATCOUNTER, ATKEYFRAMES, ATKEYWORD, ATLEFT, ATRIGHT, ATTOP, CDC, CDO, CHARSET_SYM, CLASS, COLON, COLOR_PROFILE, COMMA, COMMENT, DASHMATCH, DATE, DEFAULT, DIMEN, DIV, DOT, EMS, EOF, EQ, ESCAPE, EXS, FONT_FACE_SYM, FREQ, FUNCTION, FUNCTIONLANG, FUNCTIONNOT, GREATER, H, HASH, HASHIDENT, HTMLENDTAG, HTMLSTARTTAG, IDENT, IMPORT_SYM, IMPORTANT_SYM, INCLUDES, INVALID, INVALID1, INVALID2, LBRACE, LBRACKET, LENGTH, LPARAN, MEDIA_SYM, MEDIARESTRICTOR, MINUS, NAME, NAMESPACE_SYM, NL, NMCHAR, NMSTART, NONASCII, NOT, NUM, NUMBER, ONLY, PAGE_SYM, PERCENTAGE, PHONETIC_ALPHABET_SYM, PLUS, PREF_SYM, PREFIXMATCH, PSEUDOELEMENT_SYM, RANGE, RANGE0, RANGE1, RANGE2, RANGE3, RANGE4, RANGE5, RANGE6, RBRACE, RBRACKET, RESOLUTION, RPARAN, S, SEMICOLON, STRING, STRING1, STRING2, SUBSTRINGMATCH, SUFFIXMATCH, TILDE, TIME, tokenImage, UNI, UNICODE, UNICODERANGE, URL
Constructor and Description |
---|
CSS3Parser(CSS3ParserTokenManager tm)
Constructor with generated Token Manager.
|
CSS3Parser(java.io.InputStream stream)
Constructor with InputStream.
|
CSS3Parser(java.io.InputStream stream,
java.lang.String encoding)
Constructor with InputStream and supplied encoding
|
CSS3Parser(java.io.Reader stream)
Constructor.
|
CSS3Parser(java.io.Reader in,
int lineOffset,
int columnOffset)
The line offset is used when the css to be parsed is only part of a file,
for example when the css is the contents of a style block contained within
an html document.
|
Modifier and Type | Method and Description |
---|---|
CSSNode |
_class() |
java.util.List<CSSNode> |
afterImportDeclaration() |
CSSNode |
atRuleDeclaration() |
CSSNode |
attrib() |
CSSNode |
charset() |
CSSNode |
colorprofile() |
char |
combinator() |
CSSNode |
createNode(Token t)
Creates a CSSNode from a token using the token image as the node name
and the token start and end for node start and end locations.
|
CSSNode |
declaration() |
java.util.List<CSSNode> |
declarations() |
CSSNode |
definition() |
CSSNode |
deprecated_class() |
void |
disable_tracing()
Disable tracing.
|
CSSNode |
element_name() |
void |
enable_tracing()
Enable tracing.
|
void |
error_skipto(int kind) |
CSSNode |
expr() |
CSSNode |
expression() |
CSSNode |
externalSelector()
I made this rule to parse a selector from a document.
|
CSSNode |
fontFace() |
CSSNode |
function() |
ParseException |
generateParseException()
Generate ParseException.
|
sidekick.util.Location |
getEndLocation(Token t) |
Token |
getNextToken()
Get the next Token.
|
java.util.List<sidekick.util.ParseError> |
getParseErrors() |
java.util.List<sidekick.util.ParseError> |
getParseWarnings() |
sidekick.util.Location |
getStartLocation(Token t) |
int |
getTabSize() |
Token |
getToken(int index)
Get the specific Token.
|
CSSNode |
hash() |
CSSNode |
hexcolor() |
void |
ignoreStatement() |
CSSNode |
importDeclaration()
The import statement
|
boolean |
isUnsupported(java.lang.String propertyName) |
CSSNode |
keyframeRuleSet() |
CSSNode |
keyframes() |
static void |
main(java.lang.String[] args) |
CSSNode |
media_expression() |
Token |
media_feature() |
java.util.List<CSSNode> |
media_query_list() |
CSSNode |
media_query() |
Token |
media_type() |
CSSNode |
media() |
CSSNode |
mediadeclaration() |
CSSNode |
namespaceDeclaration() |
CSSNode |
negation() |
boolean |
notNull(java.lang.Object... args)
Simple check to verify that all arguments are not null.
|
char |
operator() |
CSSNode |
page() |
java.util.List<CSSNode> |
pageContent() |
CSSNode |
phoneticAlphabet() |
CSSNode |
prefAtRule() |
CSSNode |
preference() |
CSSNode |
prio() |
CSSNode |
property() |
CSSNode |
pseudo_page() |
CSSNode |
pseudo() |
void |
ReInit(CSS3ParserTokenManager tm)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream,
java.lang.String encoding)
Reinitialise.
|
void |
ReInit(java.io.Reader stream)
Reinitialise.
|
CSSNode |
ruleSet() |
CSSNode |
selector() |
void |
setProprietaryAsError(boolean b)
If set to true, then a warning will be generated when proprietary
CSS markup is used.
|
void |
setTabSize(int size)
Set the tab size on the input stream.
|
CSSNode |
simple_selector() |
CSSNode |
styleSheet()
The main entry for the parser.
|
CSSNode |
term() |
char |
unaryOperator() |
CSSNode |
unused_production_generic_syntax() |
public static final java.util.HashSet<java.lang.String> unsupportedPropertyNames
public CSS3ParserTokenManager token_source
public Token token
public Token jj_nt
public CSS3Parser(java.io.Reader in, int lineOffset, int columnOffset)
lineOffset
- The line number of the first line of the css.columnOffset
- The column number of the first character of the css.public CSS3Parser(java.io.InputStream stream)
public CSS3Parser(java.io.InputStream stream, java.lang.String encoding)
public CSS3Parser(java.io.Reader stream)
public CSS3Parser(CSS3ParserTokenManager tm)
public void setTabSize(int size)
public int getTabSize()
public void setProprietaryAsError(boolean b)
b
- If set to true, then a warning will be generated when proprietary
CSS markup is used.public java.util.List<sidekick.util.ParseError> getParseErrors()
public java.util.List<sidekick.util.ParseError> getParseWarnings()
public void error_skipto(int kind)
public sidekick.util.Location getStartLocation(Token t)
t
- A token to create a location from.public sidekick.util.Location getEndLocation(Token t)
t
- A token to create a location from.public CSSNode createNode(Token t)
public boolean notNull(java.lang.Object... args)
public boolean isUnsupported(java.lang.String propertyName)
public static void main(java.lang.String[] args)
public final CSSNode styleSheet() throws ParseException
ParseException
- exception during the parsepublic final CSSNode charset() throws ParseException
ParseException
public final java.util.List<CSSNode> afterImportDeclaration() throws ParseException
ParseException
public final void ignoreStatement() throws ParseException
ParseException
public final CSSNode namespaceDeclaration() throws ParseException
ParseException
public final CSSNode importDeclaration() throws ParseException
ParseException
- exception during the parsepublic final CSSNode media() throws ParseException
ParseException
public final java.util.List<CSSNode> media_query_list() throws ParseException
ParseException
public final CSSNode media_query() throws ParseException
ParseException
public final Token media_type() throws ParseException
ParseException
public final CSSNode media_expression() throws ParseException
ParseException
public final Token media_feature() throws ParseException
ParseException
public final CSSNode unused_production_generic_syntax() throws ParseException
ParseException
public final CSSNode definition() throws ParseException
ParseException
public final CSSNode page() throws ParseException
ParseException
public final java.util.List<CSSNode> pageContent() throws ParseException
ParseException
public final CSSNode prefAtRule() throws ParseException
ParseException
public final CSSNode pseudo_page() throws ParseException
ParseException
public final CSSNode fontFace() throws ParseException
ParseException
public final CSSNode colorprofile() throws ParseException
ParseException
public final CSSNode preference() throws ParseException
ParseException
public final CSSNode phoneticAlphabet() throws ParseException
ParseException
public final CSSNode keyframeRuleSet() throws ParseException
ParseException
public final CSSNode keyframes() throws ParseException
ParseException
public final CSSNode atRuleDeclaration() throws ParseException
ParseException
public final char operator() throws ParseException
ParseException
public final char combinator() throws ParseException
ParseException
public final char unaryOperator() throws ParseException
ParseException
public final CSSNode property() throws ParseException
ParseException
public final CSSNode ruleSet() throws ParseException
ParseException
public final java.util.List<CSSNode> declarations() throws ParseException
ParseException
public final CSSNode selector() throws ParseException
ParseException
public final CSSNode externalSelector() throws ParseException
ParseException
- exception during the parsepublic final CSSNode simple_selector() throws ParseException
ParseException
public final CSSNode _class() throws ParseException
ParseException
public final CSSNode deprecated_class() throws ParseException
ParseException
public final CSSNode element_name() throws ParseException
ParseException
public final CSSNode attrib() throws ParseException
ParseException
public final CSSNode negation() throws ParseException
ParseException
public final CSSNode pseudo() throws ParseException
ParseException
public final CSSNode hash() throws ParseException
ParseException
public final CSSNode mediadeclaration() throws ParseException
ParseException
public final CSSNode declaration() throws ParseException
ParseException
public final CSSNode prio() throws ParseException
ParseException
public final CSSNode expression() throws ParseException
ParseException
public final CSSNode expr() throws ParseException
ParseException
public final CSSNode term() throws ParseException
ParseException
public final CSSNode function() throws ParseException
ParseException
public final CSSNode hexcolor() throws ParseException
ParseException
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
public void ReInit(java.io.Reader stream)
public void ReInit(CSS3ParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()