public class InputStreamLexerSource extends LexerSource
line, offset| Constructor and Description |
|---|
InputStreamLexerSource(java.lang.String sourceName,
java.io.InputStream in,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
Create our food-source for the lexer
|
| Modifier and Type | Method and Description |
|---|---|
java.io.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) |
java.lang.String |
toString() |
void |
unread(int c)
Pushes char back onto this source.
|
void |
unreadMany(java.lang.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, makePointer, readCodepoint, uncaptureFeaturepublic InputStreamLexerSource(java.lang.String sourceName,
java.io.InputStream in,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
sourceName - is the file we are readingreader - is what represents the contents of file sourceNameline - starting line number for source (used by eval)extraPositionInformation - will gives us extra information that an IDE may wantpublic int read()
throws java.io.IOException
read in class LexerSourcejava.io.IOExceptionpublic void unread(int c)
unread in class LexerSourceto - be put back onto the sourcepublic boolean peek(int to)
throws java.io.IOException
peek in class LexerSourceto - character to compare againstjava.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 unreadMany(java.lang.CharSequence buffer)
unreadMany in class LexerSourcepublic boolean matchMarker(org.jruby.util.ByteList match,
boolean indent,
boolean checkNewline)
throws java.io.IOException
LexerSourcematchMarker in class LexerSourcematch - to match againstindent - eat any leading whitespacecheckNewline - includes a check that marker is followed by newline or EOFjava.io.IOException - if an error occurred reading from underlying IO sourcepublic boolean wasBeginOfLine()
wasBeginOfLine in class LexerSourcepublic boolean lastWasBeginOfLine()
lastWasBeginOfLine in class LexerSourcepublic java.lang.String toString()
toString in class java.lang.Objectpublic org.jruby.util.ByteList readUntil(char marker)
throws java.io.IOException
readUntil in class LexerSourcejava.io.IOExceptionpublic java.io.InputStream getRemainingAsStream()
throws java.io.IOException
getRemainingAsStream in class LexerSourcejava.io.IOExceptionCopyright © 2002-2009 JRuby Team. All Rights Reserved.