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

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

public class LexemeBasedEnvironmentLoader
extends java.lang.Object

Populates the JavaScript environment based on the current set of lexemes. It reloads the environment when files are opened or closed. This is the lexeme-based version of the parser in the pro product.

Author:
Spike Washburn, Kevin Lindsey

Constructor Summary
LexemeBasedEnvironmentLoader(Environment env)
          LexemeBasedEnvironmentLoader
 
Method Summary
 int getFileIndex()
          getFileIndex
 IScope getScope(int offset, IScope defaultScope)
          getScope
 void reloadEnvironment(IParseState parseState)
          reloadEnvironment
 void replaceFunctionDeclaration(int offset, IScope parentScope, java.lang.String functionName, JSFunction func)
          Replaces an existing definition of a variable in a scope with a function.
 void unloadEnvironment()
          unloadEnvironment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LexemeBasedEnvironmentLoader

public LexemeBasedEnvironmentLoader(Environment env)
LexemeBasedEnvironmentLoader

Parameters:
env -
Method Detail

getFileIndex

public int getFileIndex()
getFileIndex

Returns:
int

getScope

public IScope getScope(int offset,
                       IScope defaultScope)
getScope

Parameters:
offset -
defaultScope -
Returns:
IScope

reloadEnvironment

public void reloadEnvironment(IParseState parseState)
reloadEnvironment

Parameters:
parseState -

replaceFunctionDeclaration

public void replaceFunctionDeclaration(int offset,
                                       IScope parentScope,
                                       java.lang.String functionName,
                                       JSFunction func)
Replaces an existing definition of a variable in a scope with a function. If the previously assigned value had been assigned sub-properties, those properties are transfered to the replacement function.

Parameters:
offset -
parentScope -
functionName -
func -

unloadEnvironment

public void unloadEnvironment()
unloadEnvironment