public interface TokenFactory
Token
s during parsing and refinement.
The TokenFactory
provides tokens and delimiters for primarily high-level units such as rules, selectors and
declarations.
Implementations can dictate a highly-customized structure that allows for various grammar constructs. One example would be switching from normal bracket and colon delimiters to newline and whitespace characters.
Custom token factories will usually extends from BaseTokenFactory
.
Modifier and Type | Method and Description |
---|---|
Token |
atRuleBlockBegin()
Gets the
Token representing the opening of an at-rule block. |
Token |
atRuleBlockEnd()
Gets the
Token representing the closing of an at-rule block. |
Token |
atRuleExpressionEnd()
Gets the
Token representing the end of an at-rule's expression. |
Token |
atRuleTermination()
Gets the
Token designating that the content of an at-rule is terminated (usually a semi-colon). |
Token |
declarationBlockBegin()
Gets the
Token representing the beginning of a declaration block. |
Token |
declarationBlockEnd()
Gets the
Token representing the end of a declaration block. |
Token |
declarationDelimiter()
Gets the
Token representing the delimiter between Declaration s. |
Token |
declarationEnd()
Gets the
Token representing what indicates the end of a Declaration . |
Token |
propertyNameEnd()
Gets the
Token representing what indicates the end of a Declaration 's property name. |
Token |
selectorBegin()
Gets the
Token representing what the first character of a Selector must be. |
Token |
selectorDelimiter()
Gets the
Token representing the delimiter between Selector s. |
Token |
selectorEnd()
Gets the
Token representing what indicates the end of a Selector . |
Optional<Token> |
specialDeclarationBegin()
Gets the
Token representing an optional special character that may appear before a normal property name in a Declaration . |
Token atRuleExpressionEnd()
Token
representing the end of an at-rule's expression.Token
representing the end of an at-rule's expression.Token atRuleTermination()
Token
designating that the content of an at-rule is terminated (usually a semi-colon).Token
designating that the content of an at-rule is terminated.Token atRuleBlockBegin()
Token
representing the opening of an at-rule block.Token
representing the opening of an at-rule block.Token atRuleBlockEnd()
Token
representing the closing of an at-rule block.Token
representing the closing of an at-rule block.Token selectorBegin()
Token
representing what the first character of a Selector
must be.Token
representing the first character of a Selector
.Token selectorDelimiter()
Token
representing the delimiter between Selector
s.Token
representing the Selector
delimiter.Token selectorEnd()
Token
representing what indicates the end of a Selector
.Token
representing the end of the Selector
.Token declarationBlockBegin()
Token
representing the beginning of a declaration block.Token
representing the beginning of a declaration block.Token declarationBlockEnd()
Token
representing the end of a declaration block.Token
representing the end of a declaration block.Token declarationDelimiter()
Token
representing the delimiter between Declaration
s.Token
representing the delimiter between Declaration
s.Token declarationEnd()
Token
representing what indicates the end of a Declaration
.Token
representing the end of a Declaration
.Token propertyNameEnd()
Token
representing what indicates the end of a Declaration
's property name.Token
representing what indicates the end of a property name.Optional<Token> specialDeclarationBegin()
Token
representing an optional special character that may appear before a normal property name in a Declaration
.
For example, to enable the star hack the "*" token could be returned. If overriding this method, consider using a CompoundToken
of the super class implementation.
Token
representing an optional special Declaration
start character.Copyright (c) 2019, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE file in the repository.