org.jetbrains.kotlin.parsing
Class AbstractTokenStreamPattern

java.lang.Object
  extended by org.jetbrains.kotlin.parsing.AbstractTokenStreamPattern
All Implemented Interfaces:
TokenStreamPattern
Direct Known Subclasses:
FirstBefore, LastBefore

public abstract class AbstractTokenStreamPattern
extends java.lang.Object
implements TokenStreamPattern


Field Summary
protected  int lastOccurrence
           
 
Constructor Summary
AbstractTokenStreamPattern()
           
 
Method Summary
protected  void fail()
           
 boolean handleUnmatchedClosing(com.intellij.psi.tree.IElementType token)
          Called on right parentheses, brackets, braces and angles (>)
 boolean isTopLevel(int openAngleBrackets, int openBrackets, int openBraces, int openParentheses)
          Decides if the combination of open bracket counts makes a "top level position" Straightforward meaning would be: if all counts are zero, then it's a top level
 int result()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jetbrains.kotlin.parsing.TokenStreamPattern
processToken
 

Field Detail

lastOccurrence

protected int lastOccurrence
Constructor Detail

AbstractTokenStreamPattern

public AbstractTokenStreamPattern()
Method Detail

fail

protected void fail()

result

public int result()
Specified by:
result in interface TokenStreamPattern
Returns:
the position where the predicate has matched, -1 if no match was found

isTopLevel

public boolean isTopLevel(int openAngleBrackets,
                          int openBrackets,
                          int openBraces,
                          int openParentheses)
Description copied from interface: TokenStreamPattern
Decides if the combination of open bracket counts makes a "top level position" Straightforward meaning would be: if all counts are zero, then it's a top level

Specified by:
isTopLevel in interface TokenStreamPattern

handleUnmatchedClosing

public boolean handleUnmatchedClosing(com.intellij.psi.tree.IElementType token)
Description copied from interface: TokenStreamPattern
Called on right parentheses, brackets, braces and angles (>)

Specified by:
handleUnmatchedClosing in interface TokenStreamPattern
Parameters:
token - the closing bracket
Returns:
true to stop matching, false to proceed