org.jrubyparser.lexer
Class HeredocTerm

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

public class HeredocTerm
extends StrTerm

A lexing unit for scanning a heredoc element. Example:

 foo(<


Field Summary
 
Fields inherited from class org.jrubyparser.lexer.StrTerm
processingEmbedded
 
Constructor Summary
HeredocTerm(String marker, int func, String lastLine)
           
 
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 setMutableState later on.
 int hashCode()
           
 boolean isSubstituting()
          Report whether this string should be substituting things like \n into newlines.
 int parseString(Lexer lexer, LexerSource src)
           
 void setMutableState(Object o)
          Apply the given state object (earlier returned by getMutableState) to this StringTerm to revert state to the earlier snapshot.
 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

HeredocTerm

public HeredocTerm(String marker,
                   int func,
                   String lastLine)
Method Detail

parseString

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

isSubstituting

public boolean isSubstituting()
Report whether this string should be substituting things like \n into newlines. 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()
Record any mutable state from this StrTerm such that it can be set back to this exact state through a call to setMutableState 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)
Apply the given state object (earlier returned by getMutableState) to this StringTerm to revert state to the earlier snapshot.

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.