org.jetbrains.jet.lang.parsing
Interface TokenStreamPattern

All Known Implementing Classes:
AbstractTokenStreamPattern, FirstBefore, LastBefore

public interface TokenStreamPattern


Method Summary
 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 bracet counts makes a "top level position" Straightforward meaning would be: if all counts are zero, then it's a top level
 boolean processToken(int offset, boolean topLevel)
          Called on each token
 int result()
           
 

Method Detail

processToken

boolean processToken(int offset,
                     boolean topLevel)
Called on each token

Parameters:
offset -
topLevel - see isTopLevel(int, int, int, int)
Returns:
true to stop

result

int result()
Returns:
the position where the predicate has matched, -1 if no match was found

isTopLevel

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


handleUnmatchedClosing

boolean handleUnmatchedClosing(com.intellij.psi.tree.IElementType token)
Called on right parentheses, brackets, braces and angles (>)

Parameters:
token - the closing bracket
Returns:
true to stop matching, false to proceed