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 protectedExternalSymbolMapBase(boolean assumeSymbolsRequireExternalSymbolMapArgument)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ISymbolgetSymbol(String name)ObjectgetValue(String name)Returns the value for the symbol with the given name.ObjectgetValue(String name, int iArrayDims)Called via bytecode.Objectinvoke(String name, Object[] args)Invokes the named external function with the given arguments.voidsetValue(String name, Object value)Sets the value of the symbol with the given name.protected booleanshouldAddInExternalSymbolMapArgumentForFunctionSymbol(IFunctionSymbol symbol)protected voidverifySymbol(String name, ISymbol symbol)
-
-
-
Method Detail
-
getValue
public Object getValue(String name)
Description copied from interface:IExternalSymbolMapReturns 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:
getValuein 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:IExternalSymbolMapCalled via bytecode.- Specified by:
getValuein interfaceIExternalSymbolMapiArrayDims- 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:IExternalSymbolMapSets 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:
setValuein 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:IExternalSymbolMapInvokes 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:
invokein 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)
-
-