Class CSSCharStream

  • All Implemented Interfaces:
    CharStream

    public final class CSSCharStream
    extends Object
    implements CharStream
    This class is only used internally as the source for the generated parsers.
    An implementation of interface CharStream, where the stream is assumed to contain only ASCII characters (with java-like unicode escape processing).
    Author:
    Philip Helger
    • Constructor Detail

    • Method Detail

      • setTabSize

        public void setTabSize​(int i)
        Description copied from interface: CharStream
        Set the tab size to use.
        Specified by:
        setTabSize in interface CharStream
        Parameters:
        i - spaces per tab
      • getTabSize

        public int getTabSize()
        Specified by:
        getTabSize in interface CharStream
        Returns:
        Current tab size.
      • getBeginColumn

        public int getBeginColumn()
        Specified by:
        getBeginColumn in interface CharStream
        Returns:
        column of token start
      • getBeginLine

        public int getBeginLine()
        Specified by:
        getBeginLine in interface CharStream
        Returns:
        line number of token start
      • getEndColumn

        public int getEndColumn()
        Specified by:
        getEndColumn in interface CharStream
        Returns:
        end column.
      • getEndLine

        public int getEndLine()
        Specified by:
        getEndLine in interface CharStream
        Returns:
        end line.
      • backup

        public void backup​(int nAmount)
        Retreat.
        Specified by:
        backup in interface CharStream
        Parameters:
        nAmount - Number of chars to back up.
      • getSuffix

        public char[] getSuffix​(int len)
        Specified by:
        getSuffix in interface CharStream
        Returns:
        suffix
      • done

        public void done()
        Set buffers back to null when finished.
        Specified by:
        done in interface CharStream
      • adjustBeginLineColumn

        public void adjustBeginLineColumn​(int nNewLine,
                                          int newCol)
        Method to adjust line and column numbers for the start of a token.
        Parameters:
        nNewLine - line index
        newCol - column index
      • isTrackLineColumn

        public boolean isTrackLineColumn()
        Specified by:
        isTrackLineColumn in interface CharStream
        Returns:
        true if line number and column numbers should be tracked.
      • setTrackLineColumn

        public void setTrackLineColumn​(boolean tlc)
        Description copied from interface: CharStream
        Enable or disable line number and column number tracking.
        Specified by:
        setTrackLineColumn in interface CharStream
        Parameters:
        tlc - true to track it, false to not do it.