org.jruby.lexer.yacc
Class ByteListLexerSource
java.lang.Object
org.jruby.lexer.yacc.LexerSource
org.jruby.lexer.yacc.ByteListLexerSource
- Direct Known Subclasses:
- CapturingByteListLexerSource
public class ByteListLexerSource
- extends LexerSource
Constructor Summary |
ByteListLexerSource(java.lang.String sourceName,
ByteList bytelist,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ByteListLexerSource
public ByteListLexerSource(java.lang.String sourceName,
ByteList bytelist,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
matchMarker
public boolean matchMarker(ByteList marker,
boolean indent,
boolean checkNewline)
throws java.io.IOException
- Description copied from class:
LexerSource
- 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.
- Specified by:
matchMarker
in class LexerSource
- Parameters:
marker
- to match againstindent
- eat any leading whitespacecheckNewline
- includes a check that marker is followed by newline or EOF
- Returns:
- true if marker matches...false otherwise
- Throws:
java.io.IOException
- if an error occurred reading from underlying IO source
peek
public boolean peek(int c)
throws java.io.IOException
- Specified by:
peek
in class LexerSource
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Specified by:
read
in class LexerSource
- Throws:
java.io.IOException
readLineBytes
public ByteList readLineBytes()
throws java.io.IOException
- Specified by:
readLineBytes
in class LexerSource
- Throws:
java.io.IOException
skipUntil
public int skipUntil(int c)
throws java.io.IOException
- Specified by:
skipUntil
in class LexerSource
- Throws:
java.io.IOException
unread
public void unread(int c)
- Specified by:
unread
in class LexerSource
unreadMany
public void unreadMany(java.lang.CharSequence line)
- Specified by:
unreadMany
in class LexerSource
wasBeginOfLine
public boolean wasBeginOfLine()
- Specified by:
wasBeginOfLine
in class LexerSource
lastWasBeginOfLine
public boolean lastWasBeginOfLine()
- Specified by:
lastWasBeginOfLine
in class LexerSource
getSource
public static LexerSource getSource(java.lang.String file,
ByteList content,
java.util.List<java.lang.String> list,
ParserConfiguration configuration)
getOffset
public int getOffset()
- Description copied from class:
LexerSource
- The location of the last byte we read from the source.
- Overrides:
getOffset
in class LexerSource
- Returns:
- current location of source
readUntil
public ByteList readUntil(char marker)
throws java.io.IOException
- Specified by:
readUntil
in class LexerSource
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2002-2007 JRuby Team. All Rights Reserved.