Class CSS3Parser
- java.lang.Object
-
- org.htmlunit.cssparser.parser.AbstractCSSParser
-
- org.htmlunit.cssparser.parser.javacc.CSS3Parser
-
- All Implemented Interfaces:
CSS3ParserConstants
public class CSS3Parser extends AbstractCSSParser implements CSS3ParserConstants
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
CSS3Parser.JJCalls
private static class
CSS3Parser.LookaheadSuccess
-
Field Summary
Fields Modifier and Type Field Description private CSS3Parser.JJCalls[]
jj_2_rtns
private int
jj_endpos
private java.util.List<int[]>
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 static int[]
jj_la1_0
private static int[]
jj_la1_1
private static int[]
jj_la1_2
private static int[]
jj_la1_3
private Token
jj_lastpos
private int[]
jj_lasttokens
private static CSS3Parser.LookaheadSuccess
jj_ls
Token
jj_nt
Next token.private int
jj_ntk
private boolean
jj_rescan
private Token
jj_scanpos
Token
token
Current token.CSS3ParserTokenManager
token_source
Generated Token Manager.private boolean
trace_enabled
-
Fields inherited from interface org.htmlunit.cssparser.parser.javacc.CSS3ParserConstants
A_LETTER, AND, ANGLE_DEG, ANGLE_GRAD, ANGLE_RAD, ANGLE_TURN, ASTERISK, ATKEYWORD, C_LETTER, CDC, CDO, CH, CHARSET_SYM, COLON, COMMA, COMMENT, COMMENT_, CUSTOM_PROPERTY_NAME, D_LETTER, DASHMATCH, DEFAULT, DIMENSION, DOT, E_LETTER, EMS, EOF, EQUALS, ESCAPE, EXS, F_LETTER, FONT_FACE_SYM, FREQ_HZ, FREQ_KHZ, FUNCTION, FUNCTION_CALC, FUNCTION_HSL, FUNCTION_LANG, FUNCTION_NOT, FUNCTION_RGB, FUNCTION_VAR, G_LETTER, GREATER, H, H_LETTER, H_PLACEHOLDER, HASH, HNUM, I_LETTER, IDENT, IMPORT_SYM, IMPORTANT_SYM, INCLUDES, INHERIT, K_LETTER, L_LETTER, LBRACE, LENGTH_CM, LENGTH_IN, LENGTH_MM, LENGTH_PC, LENGTH_PT, LENGTH_PX, LENGTH_Q, LROUND, LSQUARE, M_LETTER, MEDIA_SYM, MINUS, N_LETTER, NAME, NL, NMCHAR, NMSTART, NONASCII, NOT, NUM, NUMBER, O_LETTER, ONLY, P_LETTER, PAGE_SYM, PERCENTAGE, PLUS, PREFIXMATCH, R_LETTER, RBRACE, REM, RESOLUTION_DPCM, RESOLUTION_DPI, RROUND, RSQUARE, S, S_LETTER, SEMICOLON, SLASH, STRING, STRING1, STRING2, SUBSTRINGMATCH, SUFFIXMATCH, T_LETTER, TILDE, TIME_MS, TIME_S, tokenImage, U_LETTER, UNICODE, UNICODE_RANGE, UNKNOWN, URI, URL, VH, VMAX, VMIN, VW, W, X_LETTER, Z_LETTER
-
-
Constructor Summary
Constructors Constructor Description CSS3Parser()
CSS3Parser(CharStream stream)
Constructor with user supplied CharStream.CSS3Parser(CSS3ParserTokenManager tm)
Constructor with generated Token Manager.
-
Method Summary
-
Methods inherited from class org.htmlunit.cssparser.parser.AbstractCSSParser
addEscapes, createLocator, createSkipWarning, doubleValue, functionInternal, getDocumentHandler, getErrorHandler, getInputSource, getLastNumPos, getParserMessage, handleCharset, handleEndDocument, handleEndFontFace, handleEndMedia, handleEndPage, handleEndSelector, handleIgnorableAtRule, handleImportStyle, handleProperty, handleStartDocument, handleStartFontFace, handleStartMedia, handleStartPage, handleStartSelector, hexColorInternal, hslColorInternal, intValue, normalizeAndValidatePagePseudoClass, parseMedia, parsePriority, parsePropertyValue, parseRule, parseSelectors, parseStyleDeclaration, parseStyleSheet, rgbColorInternal, setDocumentHandler, setErrorHandler, toCSSParseException, toCSSParseException, toCSSParseException, toCSSParseException, unescape
-
-
-
-
Field Detail
-
token_source
public CSS3ParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
jj_ntk
private int jj_ntk
-
jj_scanpos
private Token jj_scanpos
-
jj_lastpos
private Token jj_lastpos
-
jj_la
private int jj_la
-
jj_gen
private int jj_gen
-
jj_la1
private final int[] jj_la1
-
jj_la1_0
private static int[] jj_la1_0
-
jj_la1_1
private static int[] jj_la1_1
-
jj_la1_2
private static int[] jj_la1_2
-
jj_la1_3
private static int[] jj_la1_3
-
jj_2_rtns
private final CSS3Parser.JJCalls[] jj_2_rtns
-
jj_rescan
private boolean jj_rescan
-
jj_gc
private int jj_gc
-
jj_ls
private static final CSS3Parser.LookaheadSuccess jj_ls
-
jj_expentries
private java.util.List<int[]> 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
-
trace_enabled
private boolean trace_enabled
-
-
Constructor Detail
-
CSS3Parser
public CSS3Parser()
-
CSS3Parser
public CSS3Parser(CharStream stream)
Constructor with user supplied CharStream.
-
CSS3Parser
public CSS3Parser(CSS3ParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
getParserVersion
public java.lang.String getParserVersion()
- Specified by:
getParserVersion
in classAbstractCSSParser
- 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.
-
getGrammarUri
protected java.lang.String getGrammarUri()
-
styleSheet
public final void styleSheet() throws ParseException
Description copied from class:AbstractCSSParser
Process a style sheet.- Specified by:
styleSheet
in classAbstractCSSParser
- Throws:
ParseException
- in case of error
-
styleSheetRuleList
public final void styleSheetRuleList() throws ParseException
- Throws:
ParseException
-
invalidRule
void invalidRule() throws ParseException
- Throws:
ParseException
-
styleSheetRuleSingle
public final void styleSheetRuleSingle() throws ParseException
Description copied from class:AbstractCSSParser
Process a style sheet rule.- Specified by:
styleSheetRuleSingle
in classAbstractCSSParser
- Throws:
ParseException
- in case of error
-
charsetRule
public final void charsetRule() throws ParseException
- Throws:
ParseException
-
unknownAtRule
public final void unknownAtRule() throws ParseException
- Throws:
ParseException
-
importRule
public final void importRule(boolean nonImportRuleFoundBefore) throws ParseException
- Throws:
ParseException
-
mediaRule
public final void mediaRule() throws ParseException
- Throws:
ParseException
-
mediaList
public final void mediaList(MediaQueryList ml) throws ParseException
Description copied from class:AbstractCSSParser
Process a media list.- Specified by:
mediaList
in classAbstractCSSParser
- Parameters:
ml
- the media list- Throws:
ParseException
- in case of error
-
mediaQuery
public final MediaQuery mediaQuery() throws ParseException
- Throws:
ParseException
-
mediaExpression
public final Property mediaExpression() throws ParseException
- Throws:
ParseException
-
mediaRuleList
public final void mediaRuleList() throws ParseException
- Throws:
ParseException
-
medium
public final java.lang.String medium() throws ParseException
- Throws:
ParseException
-
pageRule
public final void pageRule() throws ParseException
- Throws:
ParseException
-
pageSelectorList
public final java.lang.String pageSelectorList() throws ParseException
- Throws:
ParseException
-
pageSelector
public final java.lang.String pageSelector() 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 LexicalUnit operator(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
-
parseSelectorsInternal
public final SelectorList parseSelectorsInternal() throws ParseException
Description copied from class:AbstractCSSParser
Process a selector list.- Specified by:
parseSelectorsInternal
in classAbstractCSSParser
- Returns:
- the selector list
- Throws:
ParseException
- in case of error
-
selectorList
public final SelectorList selectorList() throws ParseException
- Throws:
ParseException
-
selector
public final Selector selector() throws ParseException
- Throws:
ParseException
-
simpleSelector
public final Selector simpleSelector(Selector sel, char comb) throws ParseException
- Throws:
ParseException
-
_class
public final Condition _class(boolean pseudoElementFound) throws ParseException
- Throws:
ParseException
-
elementName
public final ElementSelector elementName() throws ParseException
- Throws:
ParseException
-
attrib
public final Condition attrib(boolean pseudoElementFound) throws ParseException
- Throws:
ParseException
-
pseudo
public final java.lang.Object pseudo(boolean pseudoElementFound) throws ParseException
- Throws:
ParseException
-
hash
public final Condition hash(boolean pseudoElementFound) throws ParseException
- Throws:
ParseException
-
styleDeclaration
public final void styleDeclaration() throws ParseException
Description copied from class:AbstractCSSParser
Process a style sheet declaration.- Specified by:
styleDeclaration
in classAbstractCSSParser
- Throws:
ParseException
- in case of error
-
declaration
public final void declaration() throws ParseException
- Throws:
ParseException
-
prio
public final boolean prio() throws ParseException
Description copied from class:AbstractCSSParser
Process a prio.- Specified by:
prio
in classAbstractCSSParser
- Returns:
- true or false
- Throws:
ParseException
- in case of error
-
expr
public final LexicalUnit expr() throws ParseException
Description copied from class:AbstractCSSParser
Process an expression.- Specified by:
expr
in classAbstractCSSParser
- Returns:
- the lexical unit
- Throws:
ParseException
- in case of error
-
term
public final LexicalUnit term(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
function
public final LexicalUnit function(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calc
public final LexicalUnit calc(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calcSum
public final LexicalUnit calcSum(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calcProduct
public final LexicalUnit calcProduct(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calcValue
public final LexicalUnit calcValue(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calcNumberSum
public final LexicalUnit calcNumberSum(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calcNumberProduct
public final LexicalUnit calcNumberProduct(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
calcNumberValue
public final LexicalUnit calcNumberValue(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
var
public final LexicalUnit var(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
rgbColor
public final LexicalUnit rgbColor(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
hslColor
public final LexicalUnit hslColor(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
number
public final LexicalUnit number(LexicalUnit prev, char op) throws ParseException
- Throws:
ParseException
-
percentage
public final LexicalUnit percentage(LexicalUnit prev, char op) throws ParseException
- Throws:
ParseException
-
dimension
public final LexicalUnit dimension(LexicalUnit prev, char op) throws ParseException
- Throws:
ParseException
-
unicodeRange
public final LexicalUnit unicodeRange(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
hexcolor
public final LexicalUnit hexcolor(LexicalUnit prev) throws ParseException
- Throws:
ParseException
-
skip
java.lang.String skip() throws ParseException
- Throws:
ParseException
-
skipUnit
java.lang.String skipUnit() throws ParseException
- Throws:
ParseException
-
appendUnit
void appendUnit(Token t, java.lang.StringBuilder sb) throws ParseException
- Throws:
ParseException
-
error_skipblock
void error_skipblock(java.lang.String msgKey, CSSParseException e) throws ParseException
- Throws:
ParseException
-
error_skipdecl
void error_skipdecl() throws ParseException
- Throws:
ParseException
-
error_skipAtRule
void error_skipAtRule() throws ParseException
- Throws:
ParseException
-
handleCaseInSensitive
java.lang.Boolean handleCaseInSensitive(Token t) throws ParseException
- Throws:
ParseException
-
jj_2_1
private boolean jj_2_1(int xla)
-
jj_3R_simpleSelector_1155_19_117
private boolean jj_3R_simpleSelector_1155_19_117()
-
jj_3R_simpleSelector_1155_19_111
private boolean jj_3R_simpleSelector_1155_19_111()
-
jj_3R_hash_1448_5_121
private boolean jj_3R_hash_1448_5_121()
-
jj_3R_elementName_1253_11_116
private boolean jj_3R_elementName_1253_11_116()
-
jj_3R_combinator_993_35_113
private boolean jj_3R_combinator_993_35_113()
-
jj_3_1
private boolean jj_3_1()
-
jj_3R_simpleSelector_1154_13_108
private boolean jj_3R_simpleSelector_1154_13_108()
-
jj_3R_elementName_1249_9_115
private boolean jj_3R_elementName_1249_9_115()
-
jj_3R_elementName_1247_5_110
private boolean jj_3R_elementName_1247_5_110()
-
jj_3R_simpleSelector_1138_13_107
private boolean jj_3R_simpleSelector_1138_13_107()
-
jj_3R_combinator_993_15_112
private boolean jj_3R_combinator_993_15_112()
-
jj_3R_combinator_993_13_109
private boolean jj_3R_combinator_993_13_109()
-
jj_3R_pseudo_1375_5_124
private boolean jj_3R_pseudo_1375_5_124()
-
jj_3R_combinator_993_58_114
private boolean jj_3R_combinator_993_58_114()
-
jj_3R_attrib_1280_5_123
private boolean jj_3R_attrib_1280_5_123()
-
jj_3R_combinator_993_7_106
private boolean jj_3R_combinator_993_7_106()
-
jj_3R_combinator_992_7_105
private boolean jj_3R_combinator_992_7_105()
-
jj_3R_simpleSelector_1135_5_102
private boolean jj_3R_simpleSelector_1135_5_102()
-
jj_3R_combinator_991_7_104
private boolean jj_3R_combinator_991_7_104()
-
jj_3R_combinator_990_5_103
private boolean jj_3R_combinator_990_5_103()
-
jj_3R_combinator_989_3_101
private boolean jj_3R_combinator_989_3_101()
-
jj_3R_simpleSelector_1158_19_120
private boolean jj_3R_simpleSelector_1158_19_120()
-
jj_3R_simpleSelector_1157_19_119
private boolean jj_3R_simpleSelector_1157_19_119()
-
jj_3R__class_1217_5_122
private boolean jj_3R__class_1217_5_122()
-
jj_3R_simpleSelector_1156_19_118
private boolean jj_3R_simpleSelector_1156_19_118()
-
jj_la1_init_0
private static void jj_la1_init_0()
-
jj_la1_init_1
private static void jj_la1_init_1()
-
jj_la1_init_2
private static void jj_la1_init_2()
-
jj_la1_init_3
private static void jj_la1_init_3()
-
ReInit
public void ReInit(CharStream stream)
Reinitialise.- Specified by:
ReInit
in classAbstractCSSParser
- Parameters:
stream
- the stream
-
ReInit
public void ReInit(CSS3ParserTokenManager tm)
Reinitialise.
-
jj_consume_token
private Token jj_consume_token(int kind) throws ParseException
- Throws:
ParseException
-
jj_scan_token
private boolean jj_scan_token(int kind)
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
jj_ntk_f
private int jj_ntk_f()
-
jj_add_error_token
private void jj_add_error_token(int kind, int pos)
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
trace_enabled
public final boolean trace_enabled()
Trace enabled.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
jj_rescan_token
private void jj_rescan_token()
-
jj_save
private void jj_save(int index, int xla)
-
-