org.jruby.lexer.yacc
Class ByteArrayLexerSource

java.lang.Object
  extended by org.jruby.lexer.yacc.LexerSource
      extended by org.jruby.lexer.yacc.ByteArrayLexerSource

public class ByteArrayLexerSource
extends LexerSource

Author:
nicksieger

Field Summary
 
Fields inherited from class org.jruby.lexer.yacc.LexerSource
line, offset
 
Constructor Summary
ByteArrayLexerSource(java.lang.String sourceName, byte[] in, java.util.List<java.lang.String> list, int line, boolean extraPositionInformation)
           
 
Method Summary
 java.lang.String getCurrentLine()
           
 java.io.InputStream getRemainingAsStream()
           
 boolean lastWasBeginOfLine()
           
 boolean matchMarker(org.jruby.util.ByteList marker, boolean indent, boolean withNewline)
          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 c)
           
 int read()
           
 org.jruby.util.ByteList readLineBytes()
           
 org.jruby.util.ByteList readUntil(char marker)
           
 int skipUntil(int marker)
           
 void unread(int c)
           
 void unreadMany(java.lang.CharSequence line)
           
 boolean wasBeginOfLine()
           
 
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
 

Constructor Detail

ByteArrayLexerSource

public ByteArrayLexerSource(java.lang.String sourceName,
                            byte[] in,
                            java.util.List<java.lang.String> list,
                            int line,
                            boolean extraPositionInformation)
Method Detail

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 against
indent - eat any leading whitespace
withNewline - 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.