com.aptana.ide.editor.js.environment
Class JSLexemeListWalker

java.lang.Object
  extended by com.aptana.ide.editor.js.environment.LexemeListWalker
      extended by com.aptana.ide.editor.js.environment.JSLexemeListWalker

public class JSLexemeListWalker
extends LexemeListWalker

Walks a list of JSLexemes, performing a function on each one


Nested Class Summary
 
Nested classes/interfaces inherited from class com.aptana.ide.editor.js.environment.LexemeListWalker
LexemeListWalker.AbortException
 
Field Summary
 
Fields inherited from class com.aptana.ide.editor.js.environment.LexemeListWalker
currentIndex, lexemeList, llSize
 
Constructor Summary
protected JSLexemeListWalker(Environment env, IScope initialScope, LexemeBasedEnvironmentLoader envLoader)
          Creates a new instance of JSLexemeListWalker
 
Method Summary
protected  void onLexeme(Lexeme lexeme, int index)
          The method called on each lexeme
 int walkList(IParseState parseState, int startIndex)
          Walks the list of lexemes, calling "onLexeme" on each one
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSLexemeListWalker

protected JSLexemeListWalker(Environment env,
                             IScope initialScope,
                             LexemeBasedEnvironmentLoader envLoader)
Creates a new instance of JSLexemeListWalker

Parameters:
env - The current JS environment
initialScope - The initial scope
envLoader - The current environment loader
Method Detail

walkList

public int walkList(IParseState parseState,
                    int startIndex)
Description copied from class: LexemeListWalker
Walks the list of lexemes, calling "onLexeme" on each one

Overrides:
walkList in class LexemeListWalker
Parameters:
parseState - The current parse state
startIndex - The lexeme list index at which to begin walking
Returns:
The ending index (generally the last index of the list)
See Also:
LexemeListWalker.walkList(IParseState, int)

onLexeme

protected void onLexeme(Lexeme lexeme,
                        int index)
                 throws LexemeListWalker.AbortException
Description copied from class: LexemeListWalker
The method called on each lexeme

Specified by:
onLexeme in class LexemeListWalker
Parameters:
lexeme - The lexeme to process
index - the index of the lexeme in the lexeme list
Throws:
LexemeListWalker.AbortException - An exception to throw if we wish to abort the walking operation
See Also:
LexemeListWalker.onLexeme(Lexeme, int)