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 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) 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.final 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.final Conditionhash(boolean pseudoElementFound) final LexicalUnithexcolor(LexicalUnit prev) final LexicalUnithslColor(LexicalUnit prev) final voidimportRule(boolean nonImportRuleFoundBefore) 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) 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.
-
-
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
-
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
-
ReInit
Reinitialise.- Specified by:
ReInitin classAbstractCSSParser- Parameters:
stream- the stream
-
ReInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
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.
-