public class InputStreamLexerSource extends LexerSource
lastPosition, line, lineOffset, offset| Constructor and Description |
|---|
InputStreamLexerSource(String sourceName,
InputStream in,
List<String> list,
int line)
Create our food-source for the lexer
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getRemainingAsStream() |
boolean |
lastWasBeginOfLine() |
boolean |
matchMarker(org.jruby.util.ByteList match,
boolean indent,
boolean checkNewline)
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 to)
Is the next character equal to 'to'
|
int |
read()
Read next character from this source
|
org.jruby.util.ByteList |
readLineBytes() |
org.jruby.util.ByteList |
readUntil(char marker) |
int |
skipUntil(int marker) |
String |
toString() |
void |
unread(int c)
Pushes char back onto this source.
|
void |
unreadMany(CharSequence buffer) |
boolean |
wasBeginOfLine()
Was the last character read from the stream the first character on a line
|
captureFeature, getCurrentLine, getFilename, getLine, getOffset, getPosition, getPosition, getSource, getSource, getVirtualLine, makePointer, readCodepoint, startOfToken, uncaptureFeaturepublic InputStreamLexerSource(String sourceName, InputStream in, List<String> list, int line)
sourceName - is the file we are readingin - is what represents the contents of file sourceNameline - starting line number for source (used by eval)public int read()
throws IOException
read in class LexerSourceIOExceptionpublic void unread(int c)
unread in class LexerSourcec - to be put back onto the sourcepublic boolean peek(int to)
throws IOException
peek in class LexerSourceto - character to compare againstIOExceptionpublic org.jruby.util.ByteList readLineBytes()
throws IOException
readLineBytes in class LexerSourceIOExceptionpublic int skipUntil(int marker)
throws IOException
skipUntil in class LexerSourceIOExceptionpublic void unreadMany(CharSequence buffer)
unreadMany in class LexerSourcepublic boolean matchMarker(org.jruby.util.ByteList match,
boolean indent,
boolean checkNewline)
throws IOException
LexerSourcematchMarker in class LexerSourcematch - to match againstindent - eat any leading whitespacecheckNewline - includes a check that marker is followed by newline or EOFIOException - if an error occurred reading from underlying IO sourcepublic boolean wasBeginOfLine()
wasBeginOfLine in class LexerSourcepublic boolean lastWasBeginOfLine()
lastWasBeginOfLine in class LexerSourcepublic org.jruby.util.ByteList readUntil(char marker)
throws IOException
readUntil in class LexerSourceIOExceptionpublic InputStream getRemainingAsStream() throws IOException
getRemainingAsStream in class LexerSourceIOExceptionCopyright © 2001-2015 JRuby. All Rights Reserved.