Package gw.lang.parser
Class StandardScope<K extends java.lang.CharSequence,V extends ISymbol>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- gw.lang.parser.StandardScope<K,V>
-
- 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
-
-
Field Summary
Fields Modifier and Type Field Description private IActivationContext_activationContextprivate int_csr
-
Constructor Summary
Constructors Modifier Constructor Description StandardScope()StandardScope(int iSize)StandardScope(IActivationContext context)StandardScope(IActivationContext context, int iSize)protectedStandardScope(StandardScope copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StandardScope<K,V>copy()Shallow copy this scopeintcountSymbols()visit all symbols in this Scope,IActivationContextgetActivationCtx()Get the activation record context.intgetCSR()voidsetCSR(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
-
-
-
-
Field Detail
-
_activationContext
private IActivationContext _activationContext
-
_csr
private int _csr
-
-
Constructor Detail
-
StandardScope
public StandardScope()
-
StandardScope
public StandardScope(IActivationContext context)
-
StandardScope
public StandardScope(int iSize)
-
StandardScope
public StandardScope(IActivationContext context, int iSize)
-
StandardScope
protected StandardScope(StandardScope copy)
-
-
Method Detail
-
copy
public StandardScope<K,V> copy()
Description copied from interface:IScopeShallow copy this scope
-
getActivationCtx
public IActivationContext getActivationCtx()
Description copied from interface:IScopeGet 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:
getActivationCtxin interfaceIScope<K extends java.lang.CharSequence,V extends ISymbol>- Returns:
- The activation context.
-
countSymbols
public int countSymbols()
Description copied from interface:IScopevisit all symbols in this Scope,- Specified by:
countSymbolsin interfaceIScope<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()
-
-