org.jrubyparser.lexer
Class StringTerm

java.lang.Object
  extended by org.jrubyparser.lexer.StrTerm
      extended by org.jrubyparser.lexer.StringTerm

public class StringTerm
extends StrTerm


Nested Class Summary
static class StringTerm.UnterminatedStringException
           
 
Field Summary
 
Fields inherited from class org.jrubyparser.lexer.StrTerm
processingEmbedded
 
Constructor Summary
StringTerm(int flags, int begin, int end)
           
 
Method Summary
 boolean equals(Object obj)
           
 Object getMutableState()
          Record any mutable state from this StrTerm such that it can be set back to this exact state through a call to StrTerm.setMutableState(java.lang.Object) later on.
 int hashCode()
           
 boolean isSubstituting()
          Report whether this string should be substituting things like \n into newlines (double quoting rules).
 int parseDExprIntoBuffer(Lexer lexer, LexerSource src, CStringBuilder buffer)
           
 int parseSimpleStringIntoBuffer(LexerSource src, CStringBuilder buffer)
           
 int parseString(Lexer lexer, LexerSource src)
           
 int parseStringIntoBuffer(Lexer lexer, LexerSource src, CStringBuilder buffer)
           
 void setMutableState(Object o)
          Support for incremental lexing: set current state of the term.
 void splitEmbeddedTokens()
          Tell this string term to return separate tokens for embedded ruby code (#$foo, #@foo, #{foo})
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringTerm

public StringTerm(int flags,
                  int begin,
                  int end)
Method Detail

parseString

public int parseString(Lexer lexer,
                       LexerSource src)
                throws IOException
Specified by:
parseString in class StrTerm
Throws:
IOException

parseSimpleStringIntoBuffer

public int parseSimpleStringIntoBuffer(LexerSource src,
                                       CStringBuilder buffer)
                                throws IOException
Throws:
IOException

parseStringIntoBuffer

public int parseStringIntoBuffer(Lexer lexer,
                                 LexerSource src,
                                 CStringBuilder buffer)
                          throws IOException
Throws:
IOException

parseDExprIntoBuffer

public int parseDExprIntoBuffer(Lexer lexer,
                                LexerSource src,
                                CStringBuilder buffer)
                         throws IOException
Throws:
IOException

isSubstituting

public boolean isSubstituting()
Description copied from class: StrTerm
Report whether this string should be substituting things like \n into newlines (double quoting rules). E.g. are we dealing with a "" string or a '' string (or their alternate representations)

Specified by:
isSubstituting in class StrTerm

getMutableState

public Object getMutableState()
Description copied from class: StrTerm
Record any mutable state from this StrTerm such that it can be set back to this exact state through a call to StrTerm.setMutableState(java.lang.Object) later on. Necessary for incremental lexing where we may restart lexing parts of a string (since they can be split up due to Ruby embedding like "Evaluated by Ruby: #{foo}".

Specified by:
getMutableState in class StrTerm

setMutableState

public void setMutableState(Object o)
Description copied from class: StrTerm
Support for incremental lexing: set current state of the term. See StrTerm.getMutableState()

Specified by:
setMutableState in class StrTerm

splitEmbeddedTokens

public void splitEmbeddedTokens()
Description copied from class: StrTerm
Tell this string term to return separate tokens for embedded ruby code (#$foo, #@foo, #{foo})

Specified by:
splitEmbeddedTokens in class StrTerm

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013. All Rights Reserved.