public class ByteArrayLexerSource extends LexerSource
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
ByteArrayLexerSource.ByteArrayCursor |
(package private) static interface |
ByteArrayLexerSource.Cursor |
(package private) class |
ByteArrayLexerSource.PushbackCursor |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
captureSource |
private ByteArrayLexerSource.Cursor |
mainCursor |
private ByteArrayLexerSource.Cursor |
pushbackCursor |
private ByteArrayLexerSource.Cursor |
readCursor |
line, lineOffset, offset| Constructor and Description |
|---|
ByteArrayLexerSource(java.lang.String sourceName,
byte[] in,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation) |
| Modifier and Type | Method and Description |
|---|---|
private void |
backward(int c) |
private int |
forward(int c) |
java.lang.String |
getCurrentLine() |
java.io.InputStream |
getRemainingAsStream() |
boolean |
lastWasBeginOfLine() |
boolean |
matchMarker(org.jruby.util.ByteList marker,
boolean indent,
boolean withNewline)
Match marker against input consumering lexer source as it goes...Unless it does not match
then it reverts lexer source back to point when this method was invoked.
|
boolean |
peek(int c) |
int |
read() |
org.jruby.util.ByteList |
readLineBytes() |
org.jruby.util.ByteList |
readUntil(char marker) |
private org.jruby.util.ByteList |
readUntil(char marker,
boolean nullIfEnd) |
int |
skipUntil(int marker) |
void |
unread(int c) |
void |
unreadMany(java.lang.CharSequence line) |
boolean |
wasBeginOfLine() |
captureFeature, getFilename, getLine, getOffset, getPosition, getPosition, getSource, getSource, getVirtualLine, makePointer, readCodepoint, uncaptureFeatureprivate ByteArrayLexerSource.Cursor readCursor
private ByteArrayLexerSource.Cursor mainCursor
private ByteArrayLexerSource.Cursor pushbackCursor
private final boolean captureSource
public ByteArrayLexerSource(java.lang.String sourceName,
byte[] in,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
public boolean matchMarker(org.jruby.util.ByteList marker,
boolean indent,
boolean withNewline)
throws java.io.IOException
LexerSourcematchMarker in class LexerSourcemarker - to match againstindent - eat any leading whitespacewithNewline - includes a check that marker is followed by newline or EOFjava.io.IOException - if an error occurred reading from underlying IO sourcepublic int read()
read in class LexerSourcepublic org.jruby.util.ByteList readUntil(char marker)
throws java.io.IOException
readUntil in class LexerSourcejava.io.IOExceptionprivate org.jruby.util.ByteList readUntil(char marker,
boolean nullIfEnd)
throws java.io.IOException
java.io.IOExceptionpublic org.jruby.util.ByteList readLineBytes()
throws java.io.IOException
readLineBytes in class LexerSourcejava.io.IOExceptionpublic int skipUntil(int marker)
throws java.io.IOException
skipUntil in class LexerSourcejava.io.IOExceptionpublic void unread(int c)
unread in class LexerSourcepublic void unreadMany(java.lang.CharSequence line)
unreadMany in class LexerSourcepublic boolean peek(int c)
throws java.io.IOException
peek in class LexerSourcejava.io.IOExceptionpublic boolean lastWasBeginOfLine()
lastWasBeginOfLine in class LexerSourcepublic boolean wasBeginOfLine()
wasBeginOfLine in class LexerSourcepublic java.lang.String getCurrentLine()
getCurrentLine in class LexerSourcepublic java.io.InputStream getRemainingAsStream()
getRemainingAsStream in class LexerSourceprivate int forward(int c)
private void backward(int c)