org.jrubyparser.lexer
Class StrTerm

java.lang.Object
  extended by org.jrubyparser.lexer.StrTerm
Direct Known Subclasses:
HeredocTerm, StringTerm

public abstract class StrTerm
extends Object


Field Summary
protected  int processingEmbedded
          Flag set while we're processing embedded Ruby expressions.
 
Constructor Summary
StrTerm()
           
 
Method Summary
abstract  Object getMutableState()
          Record any mutable state from this StrTerm such that it can be set back to this exact state through a call to setMutableState(java.lang.Object) later on.
abstract  boolean isSubstituting()
          Report whether this string should be substituting things like \n into newlines (double quoting rules).
abstract  int parseString(Lexer lexer, LexerSource src)
           
abstract  void setMutableState(Object o)
          Support for incremental lexing: set current state of the term.
abstract  void splitEmbeddedTokens()
          Tell this string term to return separate tokens for embedded ruby code (#$foo, #@foo, #{foo})
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processingEmbedded

protected int processingEmbedded
Flag set while we're processing embedded Ruby expressions. It will be 0 when we are not, or otherwise set to the the relevant embedded type (EMBEDDED_DVAR or EMBEDDED_DEXPR)

Constructor Detail

StrTerm

public StrTerm()
Method Detail

parseString

public abstract int parseString(Lexer lexer,
                                LexerSource src)
                         throws IOException
Throws:
IOException

splitEmbeddedTokens

public abstract void splitEmbeddedTokens()
Tell this string term to return separate tokens for embedded ruby code (#$foo, #@foo, #{foo})


isSubstituting

public abstract boolean isSubstituting()
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)


getMutableState

public abstract Object getMutableState()
Record any mutable state from this StrTerm such that it can be set back to this exact state through a call to 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}".


setMutableState

public abstract void setMutableState(Object o)
Support for incremental lexing: set current state of the term. See getMutableState()



Copyright © 2013. All Rights Reserved.