|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.lexer.yacc.LexerSource
org.jruby.lexer.yacc.InputStreamLexerSource
public class InputStreamLexerSource
Field Summary |
---|
Fields inherited from class org.jruby.lexer.yacc.LexerSource |
---|
line, offset |
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
static LexerSource |
getSource(java.lang.String name,
java.io.InputStream content,
java.util.List<java.lang.String> list,
ParserConfiguration configuration)
Create a source. |
boolean |
lastWasBeginOfLine()
|
boolean |
matchMarker(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 |
ByteList |
readLineBytes()
|
ByteList |
readUntil(char marker)
|
int |
skipUntil(int c)
|
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 |
Methods inherited from class org.jruby.lexer.yacc.LexerSource |
---|
captureFeature, getFilename, getLine, getOffset, getPosition, getPosition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public 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 wantMethod Detail |
---|
public int read() throws java.io.IOException
read
in class LexerSource
java.io.IOException
public void unread(int c)
unread
in class LexerSource
to
- be put back onto the sourcepublic boolean peek(int to) throws java.io.IOException
peek
in class LexerSource
to
- character to compare against
java.io.IOException
public static LexerSource getSource(java.lang.String name, java.io.InputStream content, java.util.List<java.lang.String> list, ParserConfiguration configuration)
name
- the name of the source (e.g a filename: foo.rb)content
- the data of the source
public ByteList readLineBytes() throws java.io.IOException
readLineBytes
in class LexerSource
java.io.IOException
public int skipUntil(int c) throws java.io.IOException
skipUntil
in class LexerSource
java.io.IOException
public void unreadMany(java.lang.CharSequence buffer)
unreadMany
in class LexerSource
public boolean matchMarker(ByteList match, boolean indent, boolean checkNewline) throws java.io.IOException
LexerSource
matchMarker
in class LexerSource
match
- to match againstindent
- eat any leading whitespacecheckNewline
- includes a check that marker is followed by newline or EOF
java.io.IOException
- if an error occurred reading from underlying IO sourcepublic boolean wasBeginOfLine()
wasBeginOfLine
in class LexerSource
public boolean lastWasBeginOfLine()
lastWasBeginOfLine
in class LexerSource
public java.lang.String toString()
toString
in class java.lang.Object
public ByteList readUntil(char marker) throws java.io.IOException
readUntil
in class LexerSource
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |