Class CSS3Parser
java.lang.Object
org.htmlunit.cssparser.parser.AbstractCSSParser
org.htmlunit.cssparser.parser.javacc.CSS3Parser
- All Implemented Interfaces:
CSS3ParserConstants
- Author:
- David Schweinsberg, waldbaer, Ahmed Ashour, Ronald Brill
-
Field Summary
FieldsModifier and TypeFieldDescriptionNext token.Current token.Generated Token Manager.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, FROM, FUNCTION, FUNCTION_CALC, FUNCTION_HAS, FUNCTION_HSL, FUNCTION_HWB, FUNCTION_IS, FUNCTION_LAB, FUNCTION_LANG, FUNCTION_LCH, FUNCTION_NOT, FUNCTION_RGB, FUNCTION_VAR, FUNCTION_WHERE, 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, NONE, 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, 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) final LexicalUnitangle(LexicalUnit prev, char op) 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 Combinatorfinal voidfinal LexicalUnitdimension(LexicalUnit prev, char op) final voidDisable tracing.final ElementSelectorfinal voidEnable tracing.final LexicalUnitexpr()Process an expression.final voidfinal LexicalUnitfunction(LexicalUnit prev) Generate ParseException.protected Stringfinal Tokenfinal TokengetToken(int index) final Conditionhash(boolean pseudoElementFound) final LexicalUnithexcolor(LexicalUnit prev) final LexicalUnithslColor(LexicalUnit prev) final LexicalUnithwbColor(LexicalUnit prev) final Tokenident()final Tokenfinal Tokenfinal voidimportRule(boolean nonImportRuleFoundBefore) final LexicalUnitlabColor(LexicalUnit prev) final LexicalUnitlchColor(LexicalUnit prev) 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 Objectpseudo(boolean pseudoElementFound) final StringvoidReInit(CharStream stream) Reinitialise.voidReinitialisefinal Combinatorfinal SelectorListfinal LexicalUnitrgbColor(LexicalUnit prev) final Selectorselector()final SelectorListfinal SelectorsimpleSelector(Selector sel, Combinator comb) final voidProcess a style sheet declaration.final voidfinal voidProcess a style sheet.final voidfinal voidProcess a style sheet rule.final LexicalUnitterm(LexicalUnit prev) final booleanfinal charfinal LexicalUnitunicodeRange(LexicalUnit prev) final voidfinal LexicalUnitvar(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, hwbColorInternal, intValue, labColorInternal, lchColorInternal, 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.
-
-
Constructor Details
-
CSS3Parser
public CSS3Parser() -
CSS3Parser
Constructor with user supplied CharStream.- Parameters:
stream- stream to init with
-
CSS3Parser
Constructor with generated Token Manager.- Parameters:
tm- Token manager to use
-
-
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
-
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
-
relativeCombinator
- Throws:
ParseException
-
unaryOperator
- 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
-
relativeSelectorList
- 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
-
hwbColor
- Throws:
ParseException
-
labColor
- Throws:
ParseException
-
lchColor
- Throws:
ParseException
-
ident
- Throws:
ParseException
-
identExcludingInherit
- Throws:
ParseException
-
identExcludingOnly
- Throws:
ParseException
-
number
- Throws:
ParseException
-
percentage
- Throws:
ParseException
-
dimension
- Throws:
ParseException
-
angle
- Throws:
ParseException
-
unicodeRange
- Throws:
ParseException
-
hexcolor
- Throws:
ParseException
-
ReInit
Reinitialise.- Specified by:
ReInitin classAbstractCSSParser- Parameters:
stream- stream to init with
-
ReInit
Reinitialise- Parameters:
tm- Token manager to use
-
getNextToken
- Returns:
- the next Token.
-
getToken
- Parameters:
index- index to be retrieved- Returns:
- the specific Token.
-
generateParseException
Generate ParseException.- Returns:
- new Exception object. Never
null
-
trace_enabled
public final boolean trace_enabled()- Returns:
- Always
false.
-
enable_tracing
public final void enable_tracing()Enable tracing. -
disable_tracing
public final void disable_tracing()Disable tracing.
-