Class ListableTokenManager

  • All Implemented Interfaces:
    com.steadystate.css.parser.SACParserCSS3Constants

    public class ListableTokenManager
    extends com.steadystate.css.parser.SACParserCSS3TokenManager
    A class to extend the default css parser's manager in order to override the next token method to populate a list of tokens.
    Author:
    nhant01, GeorgeLuo
    • Field Summary

      • Fields inherited from class com.steadystate.css.parser.SACParserCSS3TokenManager

        curChar, debugStream, input_stream, jjnewLexState, jjstrLiteralImages, lexStateNames
      • Fields inherited from interface com.steadystate.css.parser.SACParserCSS3Constants

        A_LETTER, AND, ANGLE_DEG, ANGLE_GRAD, ANGLE_RAD, 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_LANG, FUNCTION_NOT, 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, 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

      Constructors 
      Constructor Description
      ListableTokenManager​(com.steadystate.css.parser.CharStream stream)
      Constructor to initialize the list of tokens.
    • Constructor Detail

      • ListableTokenManager

        public ListableTokenManager​(com.steadystate.css.parser.CharStream stream)
        Constructor to initialize the list of tokens.
        Parameters:
        stream - a stream of css text to parse into tokens
    • Method Detail

      • getNextToken

        public com.steadystate.css.parser.Token getNextToken()
        Store the token in a list of tokens.
        Overrides:
        getNextToken in class com.steadystate.css.parser.SACParserCSS3TokenManager
        Returns:
        the next token in the css text
      • compressEnd

        public void compressEnd()
        Compress the tail tokens with the input token to produce a single token, by stepping backwards WHITESPACE tokens until an IDENT token is detected.
      • getCurLexState

        public int getCurLexState()
        accessor for current lex state, which informs whether the parser is within a comment
        Returns:
        value of 1 for comment and 0 for css cdata
      • getParsedTokens

        public List<com.steadystate.css.parser.Token> getParsedTokens()
        Getter for the list of tokens.
        Returns:
        the underlying tokens