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
  • Field Details

    • _assumeSymbolsRequireExternalSymbolMapArgument

      private boolean _assumeSymbolsRequireExternalSymbolMapArgument
  • Constructor Details

    • ExternalSymbolMapBase

      protected ExternalSymbolMapBase(boolean assumeSymbolsRequireExternalSymbolMapArgument)
  • Method Details

    • 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 interface IExternalSymbolMap
      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 interface IExternalSymbolMap
      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:
    • isCapturedSymbol

      private boolean isCapturedSymbol(int iArrayDims, Object value, Class valueClass)
    • 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 interface IExternalSymbolMap
      Parameters:
      name - the name of the symbol
      value - 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 interface IExternalSymbolMap
      Parameters:
      name - the name of the function symbol
      args - the arguments to the method
      Returns:
      the result of the function invocation
    • shouldAddInExternalSymbolMapArgumentForFunctionSymbol

      protected boolean shouldAddInExternalSymbolMapArgumentForFunctionSymbol(IFunctionSymbol symbol)
    • verifySymbol

      protected void verifySymbol(String name, ISymbol symbol)
    • getSymbol

      protected abstract ISymbol getSymbol(String name)