Class GssParserCC
java.lang.Object
com.google.common.css.compiler.ast.GssParserCCConstants
com.google.common.css.compiler.ast.GssParserCC
A parser that recognizes GSS files and builds the new AST.
-
Field Summary
FieldsFields inherited from class com.google.common.css.compiler.ast.GssParserCCConstants
ALPHA, AMPERSAND, AND, ASTERISK, ASTERISK_EQUALS, AT, ATKEYWORD, ATLIST, ATRULESWITHDECLBLOCK, BAD_TOKEN, CALC, CARET, CARET_EQUALS, CDC, CDO, COLON, COMMA, CUSTOM_PROPERTY_NAME, DEFAULT, DIGIT, DOLLAR, DOLLAR_EQUALS, DOT, DOUBLE_QUOTE, DOUBLE_QUOTED_STRING, EOF, EQUALS, ESCAPE, EXCL_MARK, FOR_VARIABLE, FUNCTION, GREATER, HASH, HASH_NAME, HEX, HEXNUM, IDENTIFIER, IMPORTANT_SYM, LANGFUNCTION, LEFTBRACE, LEFTROUND, LEFTSQUARE, MINUS, NAME, NAMECHAR, NAMESTART, NL, NL1, NONASCII, NOTFUNCTION, NUMBER, OR, PERCENT, PIPE, PIPE_EQUALS, PLUS, RIGHTBRACE, RIGHTROUND, RIGHTSQUARE, S, SEMICOLON, SINGLE_QUOTE, SINGLE_QUOTED_STRING, SLASH, TILDE, TILDE_EQUALS, tokenImage, UNDERSCORE, UNICODE, UNICODE_RANGE, UNICODE_RANGE_TEXT, URI, URL, VARFUNCTION, W, WDEEP, WEBKITKEYFRAMES, WGREATER, WMINUSW, WPLUS, WTILDE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CssValueNodefinal CssFunctionNodefinal CssAtRuleNodeatRule()final CssAtRuleNodefinal CssAtRuleNodefinal CssAttributeSelectorNodefinal CssBooleanExpressionNodefinal CssBlockNodeblock(boolean isEnclosedWithBraces) final CssBooleanExpressionNodefinal CssBooleanExpressionNodefinal CssFunctionNodecalc()final CssClassSelectorNodefinal CssCombinatorNodefinal CssValueNodefinal CssLiteralNodeA last-resort, minimally-restrictive brace-delimited production.final CssLiteralNodeInside blocks, brackets, parens, and braces must be balanced.final CssLiteralNodeInside blocks, brackets, parens, and braces must be balanced.final CssDeclarationNodefinal CssPropertyValueNodefinal CssNodefinal Tokenfinal CssPropertyValueNodeexpr()final CssBooleanExpressionNodefinal CssFunctionNodefunction()Note: We allow the function name to have : and .Generate ParseException.final TokenGet the next Token.final TokengetToken(int index) Get the specific Token.final Tokenhexcolor()final CssRefinerNodeid()final CssPriorityNodefinal CssAtRuleNodefinal CssKeyNodekey()final CssKeyListNodekeyList()final Stringnth()final CssBooleanExpressionNodevoidparse()voidparse(CssBlockNode globalBlock, SourceCode sourceCode, boolean errorHandling, com.google.common.collect.ImmutableList.Builder<GssParserException> parsingErrors) Wrapper aroundparse()that (re-)initializes the parser and clears its state afterwards.final CssValueNodeproduct(boolean hasParenthesis) final CssRefinerNodepseudo()voidreInit(CharStream stream) Reinitialise.final CssRulesetNoderuleSet()final CssSelectorNodeselector()final CssSelectorListNodefinal CssSelectorNodefinal CssValueNodefinal CssDeclarationNodefinal voidstart()final CssStringNodestring()final CssDeclarationBlockNodefinal CssValueNodesum(boolean hasParenthesis) final CssValueNodeterm()final Tokenfinal CssValueNodeunit()final CssFunctionNodeuri()final CssFunctionNodevarNode()final CssKeyframeRulesetNodefinal CssBlockNodefinal CssAtRuleNode
-
Field Details
-
CRAZY_CONTENT
- See Also:
-
-
Constructor Details
-
GssParserCC
Constructor with user supplied CharStream.
-
-
Method Details
-
parse
- Throws:
GssParserException
-
parse
public void parse(CssBlockNode globalBlock, SourceCode sourceCode, boolean errorHandling, com.google.common.collect.ImmutableList.Builder<GssParserException> parsingErrors) throws GssParserException Wrapper aroundparse()that (re-)initializes the parser and clears its state afterwards.- Parameters:
globalBlock- the place to store parsing resultsourceCode- the source code to parseerrorHandling- whether error handling is enabledparsingErrors- the place to store errors occured during parsing- Throws:
GssParserException
-
string
- Throws:
ParseException
-
ruleSet
- Throws:
ParseException
-
selectorList
- Throws:
ParseException
-
selector
- Throws:
ParseException
-
className
- Throws:
ParseException
-
id
- Throws:
ParseException
-
pseudo
- Throws:
ParseException
-
nth
- Throws:
ParseException
-
attribute
- Throws:
ParseException
-
simpleSelector
- Throws:
ParseException
-
elementName
- Throws:
ParseException
-
combinator
- Throws:
ParseException
-
styleDeclaration
- Throws:
ParseException
-
declaration
- Throws:
ParseException
-
customDeclaration
- Throws:
ParseException
-
customDeclarationValue
- Throws:
ParseException
-
standardDeclaration
- Throws:
ParseException
-
expr
- Throws:
ParseException
-
compositeTerm
- Throws:
ParseException
-
assignTerm
- Throws:
ParseException
-
slashTerm
- Throws:
ParseException
-
term
- Throws:
ParseException
-
extendedTerm
- Throws:
ParseException
-
booleanAndTerm
- Throws:
ParseException
-
booleanNegatedTerm
- Throws:
ParseException
-
basicTerm
- Throws:
ParseException
-
parenthesizedTerm
- Throws:
ParseException
-
unaryOperator
- Throws:
ParseException
-
hexcolor
- Throws:
ParseException
-
varNode
- Throws:
ParseException
-
uri
- Throws:
ParseException
-
function
Note: We allow the function name to have : and . to support non-standard IE functions- Returns:
- function node
- Throws:
ParseException
-
calc
- Throws:
ParseException
-
sum
- Throws:
ParseException
-
product
- Throws:
ParseException
-
unit
- Throws:
ParseException
-
atFunction
- Throws:
ParseException
-
important
- Throws:
ParseException
-
atRule
- Throws:
ParseException
-
atRuleWithDeclBlock
- Throws:
ParseException
-
innerAtRule
- Throws:
ParseException
-
webkitKeyframesRule
- Throws:
ParseException
-
webkitKeyframesBlock
- Throws:
ParseException
-
webkitKeyframeRuleSet
- Throws:
ParseException
-
keyList
- Throws:
ParseException
-
key
- Throws:
ParseException
-
block
- Throws:
ParseException
-
start
- Throws:
ParseException
-
atRuleWithCrazySyntax
- Throws:
ParseException
-
crazyBlockBrace
A last-resort, minimally-restrictive brace-delimited production.- Returns:
- literal node
- Throws:
ParseException
-
crazyBlockBracket
Inside blocks, brackets, parens, and braces must be balanced.- Returns:
- literal node
- Throws:
ParseException
-
crazyBlockParen
Inside blocks, brackets, parens, and braces must be balanced.- Returns:
- literal node
- Throws:
ParseException
-
reInit
Reinitialise. -
getNextToken
Get the next Token. -
getToken
Get the specific Token. -
generateParseException
Generate ParseException.
-