org.jruby.lexer.yacc
Class ByteArrayLexerSource
java.lang.Object
org.jruby.lexer.yacc.LexerSource
org.jruby.lexer.yacc.ByteArrayLexerSource
public class ByteArrayLexerSource
- extends LexerSource
- Author:
- nicksieger
Constructor Summary |
ByteArrayLexerSource(java.lang.String sourceName,
byte[] in,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
|
Methods inherited from class org.jruby.lexer.yacc.LexerSource |
captureFeature, getFilename, getLine, getOffset, getPosition, getPosition, getSource, getSource, makePointer, readCodepoint, uncaptureFeature |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayLexerSource
public ByteArrayLexerSource(java.lang.String sourceName,
byte[] in,
java.util.List<java.lang.String> list,
int line,
boolean extraPositionInformation)
matchMarker
public boolean matchMarker(org.jruby.util.ByteList marker,
boolean indent,
boolean withNewline)
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 whitespacewithNewline
- 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
read
public int read()
- Specified by:
read
in class LexerSource
readUntil
public org.jruby.util.ByteList readUntil(char marker)
throws java.io.IOException
- Specified by:
readUntil
in class LexerSource
- Throws:
java.io.IOException
readLineBytes
public org.jruby.util.ByteList readLineBytes()
throws java.io.IOException
- Specified by:
readLineBytes
in class LexerSource
- Throws:
java.io.IOException
skipUntil
public int skipUntil(int marker)
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
peek
public boolean peek(int c)
throws java.io.IOException
- Specified by:
peek
in class LexerSource
- Throws:
java.io.IOException
lastWasBeginOfLine
public boolean lastWasBeginOfLine()
- Specified by:
lastWasBeginOfLine
in class LexerSource
wasBeginOfLine
public boolean wasBeginOfLine()
- Specified by:
wasBeginOfLine
in class LexerSource
getCurrentLine
public java.lang.String getCurrentLine()
- Overrides:
getCurrentLine
in class LexerSource
getRemainingAsStream
public java.io.InputStream getRemainingAsStream()
- Specified by:
getRemainingAsStream
in class LexerSource
Copyright © 2002-2009 JRuby Team. All Rights Reserved.