public class ByteArrayLexerSource extends LexerSource
lastPosition, line, lineOffset, offset
Constructor and Description |
---|
ByteArrayLexerSource(String sourceName,
byte[] in,
List<String> list,
int line) |
Modifier and Type | Method and Description |
---|---|
String |
getCurrentLine() |
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) |
int |
skipUntil(int marker) |
void |
unread(int c) |
void |
unreadMany(CharSequence line) |
boolean |
wasBeginOfLine() |
captureFeature, getFilename, getLine, getOffset, getPosition, getPosition, getSource, getSource, getVirtualLine, makePointer, readCodepoint, startOfToken, uncaptureFeature
public boolean matchMarker(org.jruby.util.ByteList marker, boolean indent, boolean withNewline) throws IOException
LexerSource
matchMarker
in class LexerSource
marker
- to match againstindent
- eat any leading whitespacewithNewline
- includes a check that marker is followed by newline or EOFIOException
- if an error occurred reading from underlying IO sourcepublic int read()
read
in class LexerSource
public org.jruby.util.ByteList readUntil(char marker) throws IOException
readUntil
in class LexerSource
IOException
public org.jruby.util.ByteList readLineBytes() throws IOException
readLineBytes
in class LexerSource
IOException
public int skipUntil(int marker) throws IOException
skipUntil
in class LexerSource
IOException
public void unread(int c)
unread
in class LexerSource
public void unreadMany(CharSequence line)
unreadMany
in class LexerSource
public boolean peek(int c) throws IOException
peek
in class LexerSource
IOException
public boolean lastWasBeginOfLine()
lastWasBeginOfLine
in class LexerSource
public boolean wasBeginOfLine()
wasBeginOfLine
in class LexerSource
public String getCurrentLine()
getCurrentLine
in class LexerSource
public InputStream getRemainingAsStream()
getRemainingAsStream
in class LexerSource
Copyright © 2001-2015 JRuby. All Rights Reserved.