public class ByteArrayLexerSource extends LexerSource
line, 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 |
---|---|
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) |
int |
skipUntil(int marker) |
void |
unread(int c) |
void |
unreadMany(java.lang.CharSequence line) |
boolean |
wasBeginOfLine() |
captureFeature, getFilename, getLine, getOffset, getPosition, getPosition, getSource, getSource, makePointer, readCodepoint, uncaptureFeature
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
LexerSource
matchMarker
in class LexerSource
marker
- 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 LexerSource
public org.jruby.util.ByteList readUntil(char marker) throws java.io.IOException
readUntil
in class LexerSource
java.io.IOException
public org.jruby.util.ByteList readLineBytes() throws java.io.IOException
readLineBytes
in class LexerSource
java.io.IOException
public int skipUntil(int marker) throws java.io.IOException
skipUntil
in class LexerSource
java.io.IOException
public void unread(int c)
unread
in class LexerSource
public void unreadMany(java.lang.CharSequence line)
unreadMany
in class LexerSource
public boolean peek(int c) throws java.io.IOException
peek
in class LexerSource
java.io.IOException
public boolean lastWasBeginOfLine()
lastWasBeginOfLine
in class LexerSource
public boolean wasBeginOfLine()
wasBeginOfLine
in class LexerSource
public java.lang.String getCurrentLine()
getCurrentLine
in class LexerSource
public java.io.InputStream getRemainingAsStream()
getRemainingAsStream
in class LexerSource
Copyright © 2002-2009 JRuby Team. All Rights Reserved.