Class CSSCharStream

java.lang.Object
com.helger.css.parser.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 Details

  • Method Details

    • getTabSize

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

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

      public char beginToken() throws IOException
      Specified by:
      beginToken in interface CharStream
      Returns:
      starting character for token.
      Throws:
      IOException - from readChar
    • readChar

      public char readChar() throws IOException
      Read a character.
      Specified by:
      readChar in interface CharStream
      Returns:
      The read character
      Throws:
      IOException - if an I/O error occurs
    • 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.
    • getImage

      public String getImage()
      Specified by:
      getImage in interface CharStream
      Returns:
      token image as String
    • 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 nNewCol)
      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 bTrackLineColumn)
      Description copied from interface: CharStream
      Enable or disable line number and column number tracking.
      Specified by:
      setTrackLineColumn in interface CharStream
      Parameters:
      bTrackLineColumn - true to track it, false to not do it.