Package eu.bandm.tools.util2
Class IncludingCharBuf.CharBuf
java.lang.Object
eu.bandm.tools.util2.IncludingCharBuf.CharBuf
- Enclosing class:
- IncludingCharBuf<D>
Auxiliary class for
IncludingCharBuf
, representing exactly
one source of character data, ie the original file or inserted expansions.-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
protected char[]
The complete data, read in when constructing the object.protected IncludingCharBuf<D>.CharBuf
Chaining to callingCharBuf
object.protected int
The length of the complete data, in characters.Position of the lastconsume()
.protected int
Current read position.Position of the firstconsume()
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
consume()
Advance position counter and line number, if linefeed is detected.void
protected boolean
isNewline
(char c) Decide if the next character is a newline FIXME NOT COMPLETE !!char
LA
(int k) Look ahead to the next k-th character, either in its own data, or in the caller.
-
Field Details
-
location
Position of the lastconsume()
. -
startLocation
Position of the firstconsume()
. -
data
protected char[] dataThe complete data, read in when constructing the object. -
len
protected int lenThe length of the complete data, in characters. -
CHUNKSIZE
protected final int CHUNKSIZE- See Also:
-
pos
protected int posCurrent read position. -
host
Chaining to callingCharBuf
object.
-
-
Constructor Details
-
CharBuf
Create a new buffer, link it viahost
to the calling text, and fill it with all character data from r.- Parameters:
r
- sourcebuf
- calling predecessorloc
- location of the start of the data- Throws:
IOException
-
CharBuf
Create a new buffer, link it viahost
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 predecessorloc
- location of the start of the data
-
-
Method Details
-
fill
- 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 inIncludingCharBuf
FIXME WARUM AUSKOMMENTIERT ???? -
isNewline
protected boolean isNewline(char c) Decide if the next character is a newline FIXME NOT COMPLETE !!
-