Class CSS3Parser
java.lang.Object
org.htmlunit.cssparser.parser.AbstractCSSParser
org.htmlunit.cssparser.parser.javacc.CSS3Parser
- All Implemented Interfaces:
CSS3ParserConstants
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CSS3Parser.JJCalls[]
private int
private List
<int[]> private int[]
private int
private int
private int
private int
private final int[]
private static int[]
private static int[]
private static int[]
private static int[]
private Token
private int[]
private static final CSS3Parser.LookaheadSuccess
Next token.private int
private boolean
private Token
Current token.Generated Token Manager.private boolean
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
ConstructorsConstructorDescriptionCSS3Parser
(CharStream stream) Constructor with user supplied CharStream.Constructor with generated Token Manager. -
Method Summary
Modifier and TypeMethodDescriptionfinal Condition
_class
(boolean pseudoElementFound) (package private) void
appendUnit
(Token t, StringBuilder sb) final Condition
attrib
(boolean pseudoElementFound) final LexicalUnit
calc
(LexicalUnit prev) final LexicalUnit
calcNumberProduct
(LexicalUnit prev) final LexicalUnit
calcNumberSum
(LexicalUnit prev) final LexicalUnit
calcNumberValue
(LexicalUnit prev) final LexicalUnit
calcProduct
(LexicalUnit prev) final LexicalUnit
calcSum
(LexicalUnit prev) final LexicalUnit
calcValue
(LexicalUnit prev) final void
final char
final void
final LexicalUnit
dimension
(LexicalUnit prev, char op) final void
Disable tracing.final ElementSelector
final void
Enable tracing.(package private) void
(package private) void
error_skipblock
(String msgKey, CSSParseException e) (package private) void
final LexicalUnit
expr()
Process an expression.final void
final LexicalUnit
function
(LexicalUnit prev) Generate ParseException.protected String
final Token
Get the next Token.final Token
getToken
(int index) Get the specific Token.(package private) Boolean
final Condition
hash
(boolean pseudoElementFound) final LexicalUnit
hexcolor
(LexicalUnit prev) final LexicalUnit
hslColor
(LexicalUnit prev) final void
importRule
(boolean nonImportRuleFoundBefore) (package private) void
private boolean
jj_2_1
(int xla) private boolean
jj_3_1()
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private void
jj_add_error_token
(int kind, int pos) private Token
jj_consume_token
(int kind) private static void
private static void
private static void
private static void
private int
jj_ntk_f()
private void
private void
jj_save
(int index, int xla) private boolean
jj_scan_token
(int kind) final Property
final void
Process a media list.final MediaQuery
final void
final void
final String
medium()
final LexicalUnit
number
(LexicalUnit prev, char op) final LexicalUnit
operator
(LexicalUnit prev) final void
pageRule()
final String
final String
final SelectorList
Process a selector list.final LexicalUnit
percentage
(LexicalUnit prev, char op) final boolean
prio()
Process a prio.final String
property()
final Object
pseudo
(boolean pseudoElementFound) final String
void
ReInit
(CharStream stream) Reinitialise.void
Reinitialise.final LexicalUnit
rgbColor
(LexicalUnit prev) final Selector
selector()
final SelectorList
final Selector
simpleSelector
(Selector sel, char comb) (package private) String
skip()
(package private) String
skipUnit()
final void
Process a style sheet declaration.final void
final void
Process a style sheet.final void
final void
Process a style sheet rule.final LexicalUnit
term
(LexicalUnit prev) final boolean
Trace enabled.final char
final LexicalUnit
unicodeRange
(LexicalUnit prev) final void
final LexicalUnit
var
(LexicalUnit prev) 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 Details
-
token_source
Generated Token Manager. -
token
Current token. -
jj_nt
Next token. -
jj_ntk
private int jj_ntk -
jj_scanpos
-
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
-
jj_rescan
private boolean jj_rescan -
jj_gc
private int jj_gc -
jj_ls
-
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 Details
-
CSS3Parser
public CSS3Parser() -
CSS3Parser
Constructor with user supplied CharStream. -
CSS3Parser
Constructor with generated Token Manager.
-
-
Method Details
-
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
-
styleSheet
Description copied from class:AbstractCSSParser
Process a style sheet.- Specified by:
styleSheet
in classAbstractCSSParser
- Throws:
ParseException
- in case of error
-
styleSheetRuleList
- Throws:
ParseException
-
invalidRule
- Throws:
ParseException
-
styleSheetRuleSingle
Description copied from class:AbstractCSSParser
Process a style sheet rule.- Specified by:
styleSheetRuleSingle
in classAbstractCSSParser
- Throws:
ParseException
- in case of error
-
charsetRule
- Throws:
ParseException
-
unknownAtRule
- Throws:
ParseException
-
importRule
- Throws:
ParseException
-
mediaRule
- Throws:
ParseException
-
mediaList
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
- Throws:
ParseException
-
mediaExpression
- Throws:
ParseException
-
mediaRuleList
- Throws:
ParseException
-
medium
- Throws:
ParseException
-
pageRule
- Throws:
ParseException
-
pageSelectorList
- Throws:
ParseException
-
pageSelector
- Throws:
ParseException
-
pseudoPage
- Throws:
ParseException
-
fontFaceRule
- Throws:
ParseException
-
operator
- Throws:
ParseException
-
combinator
- Throws:
ParseException
-
unaryOperator
- Throws:
ParseException
-
property
- Throws:
ParseException
-
styleRule
- Throws:
ParseException
-
parseSelectorsInternal
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
- Throws:
ParseException
-
selector
- Throws:
ParseException
-
simpleSelector
- Throws:
ParseException
-
_class
- Throws:
ParseException
-
elementName
- Throws:
ParseException
-
attrib
- Throws:
ParseException
-
pseudo
- Throws:
ParseException
-
hash
- Throws:
ParseException
-
styleDeclaration
Description copied from class:AbstractCSSParser
Process a style sheet declaration.- Specified by:
styleDeclaration
in classAbstractCSSParser
- Throws:
ParseException
- in case of error
-
declaration
- Throws:
ParseException
-
prio
Description copied from class:AbstractCSSParser
Process a prio.- Specified by:
prio
in classAbstractCSSParser
- Returns:
- true or false
- Throws:
ParseException
- in case of error
-
expr
Description copied from class:AbstractCSSParser
Process an expression.- Specified by:
expr
in classAbstractCSSParser
- Returns:
- the lexical unit
- Throws:
ParseException
- in case of error
-
term
- Throws:
ParseException
-
function
- Throws:
ParseException
-
calc
- Throws:
ParseException
-
calcSum
- Throws:
ParseException
-
calcProduct
- Throws:
ParseException
-
calcValue
- Throws:
ParseException
-
calcNumberSum
- Throws:
ParseException
-
calcNumberProduct
- Throws:
ParseException
-
calcNumberValue
- Throws:
ParseException
-
var
- Throws:
ParseException
-
rgbColor
- Throws:
ParseException
-
hslColor
- Throws:
ParseException
-
number
- Throws:
ParseException
-
percentage
- Throws:
ParseException
-
dimension
- Throws:
ParseException
-
unicodeRange
- Throws:
ParseException
-
hexcolor
- Throws:
ParseException
-
skip
- Throws:
ParseException
-
skipUnit
- Throws:
ParseException
-
appendUnit
- Throws:
ParseException
-
error_skipblock
- Throws:
ParseException
-
error_skipdecl
- Throws:
ParseException
-
error_skipAtRule
- Throws:
ParseException
-
handleCaseInSensitive
- 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
Reinitialise.- Specified by:
ReInit
in classAbstractCSSParser
- Parameters:
stream
- the stream
-
ReInit
Reinitialise. -
jj_consume_token
- Throws:
ParseException
-
jj_scan_token
private boolean jj_scan_token(int kind) -
getNextToken
Get the next Token. -
getToken
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
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)
-