Class IncludingCharBuf.CharBuf

java.lang.Object
eu.bandm.tools.util2.IncludingCharBuf.CharBuf
Enclosing class:
IncludingCharBuf<D>

protected class IncludingCharBuf.CharBuf extends Object
Auxiliary class for IncludingCharBuf, representing exactly one source of character data, ie the original file or inserted expansions.
  • Field Details

    • location

      Location<D> location
      Position of the last consume().
    • startLocation

      Location<D> startLocation
      Position of the first consume().
    • data

      protected char[] data
      The complete data, read in when constructing the object.
    • len

      protected int len
      The length of the complete data, in characters.
    • CHUNKSIZE

      protected final int CHUNKSIZE
      See Also:
    • pos

      protected int pos
      Current read position.
    • host

      protected IncludingCharBuf<D>.CharBuf host
      Chaining to calling CharBuf object.
  • Constructor Details

    • CharBuf

      public CharBuf(Reader r, IncludingCharBuf<D>.CharBuf buf, Location<D> loc) throws IOException
      Create a new buffer, link it via host to the calling text, and fill it with all character data from r.
      Parameters:
      r - source
      buf - calling predecessor
      loc - location of the start of the data
      Throws:
      IOException
    • CharBuf

      public CharBuf(char[] s, IncludingCharBuf<D>.CharBuf buf, Location<D> loc)
      Create a new buffer, link it via host to the calling text, and take the array s as its character data.
      Parameters:
      s - a character store, directly used by the new buffer.
      buf - calling predecessor
      loc - location of the start of the data
  • Method Details

    • fill

      public void fill(Reader fr) throws IOException
      Throws:
      IOException
    • LA

      public char LA(int k)
      Look ahead to the next k-th character, either in its own data, or in the caller. The next-to-consume character is looked at with k=0(zero).
    • consume

      public void consume()
      Advance position counter and line number, if linefeed is detected. Return to the including buffer, if this has reached its end, is made by the calling level in IncludingCharBuf FIXME WARUM AUSKOMMENTIERT ????
    • isNewline

      protected boolean isNewline(char c)
      Decide if the next character is a newline FIXME NOT COMPLETE !!