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 classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CSS3Parser.JJCalls[]private intprivate List<int[]> private int[]private intprivate intprivate intprivate intprivate final int[]private static int[]private static int[]private static int[]private static int[]private Tokenprivate int[]private static final CSS3Parser.LookaheadSuccessNext token.private intprivate booleanprivate TokenCurrent token.Generated Token Manager.private booleanFields inherited from interface 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) voidappendUnit(Token t, StringBuilder sb) final Conditionattrib(boolean pseudoElementFound) final LexicalUnitcalc(LexicalUnit prev) final LexicalUnitcalcNumberProduct(LexicalUnit prev) final LexicalUnitcalcNumberSum(LexicalUnit prev) final LexicalUnitcalcNumberValue(LexicalUnit prev) final LexicalUnitcalcProduct(LexicalUnit prev) final LexicalUnitcalcSum(LexicalUnit prev) final LexicalUnitcalcValue(LexicalUnit prev) final voidfinal charfinal voidfinal LexicalUnitdimension(LexicalUnit prev, char op) final voidDisable tracing.final ElementSelectorfinal voidEnable tracing.(package private) void(package private) voiderror_skipblock(String msgKey, CSSParseException e) (package private) voidfinal LexicalUnitexpr()Process an expression.final voidfinal LexicalUnitfunction(LexicalUnit prev) Generate ParseException.protected Stringfinal TokenGet the next Token.final TokengetToken(int index) Get the specific Token.(package private) Booleanfinal Conditionhash(boolean pseudoElementFound) final LexicalUnithexcolor(LexicalUnit prev) final LexicalUnithslColor(LexicalUnit prev) final voidimportRule(boolean nonImportRuleFoundBefore) (package private) voidprivate booleanjj_2_1(int xla) private booleanjj_3_1()private booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate voidjj_add_error_token(int kind, int pos) private Tokenjj_consume_token(int kind) private static voidprivate static voidprivate static voidprivate static voidprivate intjj_ntk_f()private voidprivate voidjj_save(int index, int xla) private booleanjj_scan_token(int kind) final Propertyfinal voidProcess a media list.final MediaQueryfinal voidfinal voidfinal Stringmedium()final LexicalUnitnumber(LexicalUnit prev, char op) final LexicalUnitoperator(LexicalUnit prev) final voidpageRule()final Stringfinal Stringfinal SelectorListProcess a selector list.final LexicalUnitpercentage(LexicalUnit prev, char op) final booleanprio()Process a prio.final Stringproperty()final Objectpseudo(boolean pseudoElementFound) final StringvoidReInit(CharStream stream) Reinitialise.voidReinitialise.final LexicalUnitrgbColor(LexicalUnit prev) final Selectorselector()final SelectorListfinal SelectorsimpleSelector(Selector sel, char comb) (package private) Stringskip()(package private) StringskipUnit()final voidProcess a style sheet declaration.final voidfinal voidProcess a style sheet.final voidfinal voidProcess a style sheet rule.final LexicalUnitterm(LexicalUnit prev) final booleanTrace enabled.final charfinal LexicalUnitunicodeRange(LexicalUnit prev) final voidfinal LexicalUnitvar(LexicalUnit prev) Methods inherited from class 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:
getParserVersionin 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:AbstractCSSParserProcess a style sheet.- Specified by:
styleSheetin classAbstractCSSParser- Throws:
ParseException- in case of error
-
styleSheetRuleList
- Throws:
ParseException
-
invalidRule
- Throws:
ParseException
-
styleSheetRuleSingle
Description copied from class:AbstractCSSParserProcess a style sheet rule.- Specified by:
styleSheetRuleSinglein classAbstractCSSParser- Throws:
ParseException- in case of error
-
charsetRule
- Throws:
ParseException
-
unknownAtRule
- Throws:
ParseException
-
importRule
- Throws:
ParseException
-
mediaRule
- Throws:
ParseException
-
mediaList
Description copied from class:AbstractCSSParserProcess a media list.- Specified by:
mediaListin 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:AbstractCSSParserProcess a selector list.- Specified by:
parseSelectorsInternalin 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:AbstractCSSParserProcess a style sheet declaration.- Specified by:
styleDeclarationin classAbstractCSSParser- Throws:
ParseException- in case of error
-
declaration
- Throws:
ParseException
-
prio
Description copied from class:AbstractCSSParserProcess a prio.- Specified by:
prioin classAbstractCSSParser- Returns:
- true or false
- Throws:
ParseException- in case of error
-
expr
Description copied from class:AbstractCSSParserProcess an expression.- Specified by:
exprin 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:
ReInitin 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)
-