Package gw.lang.parser
Class ExternalSymbolMapBase
- java.lang.Object
-
- gw.lang.parser.ExternalSymbolMapBase
-
- All Implemented Interfaces:
IExternalSymbolMap
- Direct Known Subclasses:
ExternalSymbolMapForMap
,ExternalSymbolMapSymbolTableWrapper
public abstract class ExternalSymbolMapBase extends Object implements IExternalSymbolMap
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExternalSymbolMapBase(boolean assumeSymbolsRequireExternalSymbolMapArgument)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ISymbol
getSymbol(String name)
Object
getValue(String name)
Returns the value for the symbol with the given name.Object
getValue(String name, int iArrayDims)
Called via bytecode.Object
invoke(String name, Object[] args)
Invokes the named external function with the given arguments.void
setValue(String name, Object value)
Sets the value of the symbol with the given name.protected boolean
shouldAddInExternalSymbolMapArgumentForFunctionSymbol(IFunctionSymbol symbol)
protected void
verifySymbol(String name, ISymbol symbol)
-
-
-
Method Detail
-
getValue
public Object getValue(String name)
Description copied from interface:IExternalSymbolMap
Returns the value for the symbol with the given name. Throws a runtime exception if the name does not correspond to a valid external symbol.- Specified by:
getValue
in interfaceIExternalSymbolMap
- Parameters:
name
- the name of the symbol- Returns:
- the current value of the symbol
-
getValue
public Object getValue(String name, int iArrayDims)
Description copied from interface:IExternalSymbolMap
Called via bytecode.- Specified by:
getValue
in interfaceIExternalSymbolMap
iArrayDims
- the expected number of array dimensions of the the symbol's type, useful for debugger expr evaluation for dynamically unwrapping type a single elem array (a captured var)- Returns:
-
setValue
public void setValue(String name, Object value)
Description copied from interface:IExternalSymbolMap
Sets the value of the symbol with the given name. Throws a runtime exception if the name does not correspond to a valid external symbol.- Specified by:
setValue
in interfaceIExternalSymbolMap
- Parameters:
name
- the name of the symbolvalue
- the new value to give that symbol
-
invoke
public Object invoke(String name, Object[] args)
Description copied from interface:IExternalSymbolMap
Invokes the named external function with the given arguments. The name argument should correspond to the result of calling getName() on the external function symbol.- Specified by:
invoke
in interfaceIExternalSymbolMap
- Parameters:
name
- the name of the function symbolargs
- the arguments to the method- Returns:
- the result of the function invocation
-
shouldAddInExternalSymbolMapArgumentForFunctionSymbol
protected boolean shouldAddInExternalSymbolMapArgumentForFunctionSymbol(IFunctionSymbol symbol)
-
-