Class StandardScope<K extends java.lang.CharSequence,​V extends ISymbol>

  • All Implemented Interfaces:
    IScope<K,​V>, java.io.Serializable, java.lang.Cloneable, java.util.Map<K,​V>
    Direct Known Subclasses:
    CommonSymbolsScope

    public class StandardScope<K extends java.lang.CharSequence,​V extends ISymbol>
    extends java.util.HashMap<K,​V>
    implements IScope<K,​V>
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      StandardScope<K,​V> copy()
      Shallow copy this scope
      int countSymbols()
      visit all symbols in this Scope,
      IActivationContext getActivationCtx()
      Get the activation record context.
      int getCSR()  
      void setCSR​(int csr)  
      • Methods inherited from class java.util.HashMap

        clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface gw.lang.parser.IScope

        put
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
    • Constructor Detail

      • StandardScope

        public StandardScope()
      • StandardScope

        public StandardScope​(int iSize)
    • Method Detail

      • copy

        public StandardScope<K,​V> copy()
        Description copied from interface: IScope
        Shallow copy this scope
        Specified by:
        copy in interface IScope<K extends java.lang.CharSequence,​V extends ISymbol>
      • getActivationCtx

        public IActivationContext getActivationCtx()
        Description copied from interface: IScope
        Get the activation record context. This can be any object representing the activation record e.g., a function symbol, a rule set context, whatever delimits a call boundary.
        Specified by:
        getActivationCtx in interface IScope<K extends java.lang.CharSequence,​V extends ISymbol>
        Returns:
        The activation context.
      • countSymbols

        public int countSymbols()
        Description copied from interface: IScope
        visit all symbols in this Scope,
        Specified by:
        countSymbols in interface IScope<K extends java.lang.CharSequence,​V extends ISymbol>
        Returns:
        true if the visitor want to continue visitiong other symbol/scope, false otherwise.
      • getCSR

        public int getCSR()
        Specified by:
        getCSR in interface IScope<K extends java.lang.CharSequence,​V extends ISymbol>
        Returns:
        the compile-time csr for this scope if it exists
      • setCSR

        public void setCSR​(int csr)
        Specified by:
        setCSR in interface IScope<K extends java.lang.CharSequence,​V extends ISymbol>