Package org.kie.dmn.feel.lang
Interface Scope
-
- All Known Implementing Classes:
ScopeImpl,WrappingScopeImpl
public interface Scope
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChildScope(Scope scope)Adds an enclosed (child) scopebooleandefine(Symbol symbol)Defines a new symbol in this scopebooleanfollowUp(java.lang.String token, boolean isPredict)This method is used during context-aware parsing to find multi-token symbols iteratively.java.util.Map<java.lang.String,Scope>getChildScopes()Gets a map of all children scopes.java.lang.StringgetName()Returns the scope nameScopegetParentScope()Returns the enclosing (parent) scopejava.util.Map<java.lang.String,Symbol>getSymbols()TypegetType()maybe null.Symbolresolve(java.lang.String id)Searches and returns a symbol with the given id if it exists.Symbolresolve(java.lang.String[] qualifiedName)Searches and returns a symbol with the given qualified name if it exists.voidstart(java.lang.String token)This method is used during context-aware parsing to find multi-token symbols iteratively.
-
-
-
Field Detail
-
BUILT_IN
static final java.lang.String BUILT_IN
- See Also:
- Constant Field Values
-
GLOBAL
static final java.lang.String GLOBAL
- See Also:
- Constant Field Values
-
LOCAL
static final java.lang.String LOCAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the scope name- Returns:
-
getParentScope
Scope getParentScope()
Returns the enclosing (parent) scope- Returns:
-
addChildScope
void addChildScope(Scope scope)
Adds an enclosed (child) scope- Parameters:
scope-
-
getChildScopes
java.util.Map<java.lang.String,Scope> getChildScopes()
Gets a map of all children scopes. The key of the map is the string name of the children scope and the value is the scope itself.- Returns:
-
define
boolean define(Symbol symbol)
Defines a new symbol in this scope- Parameters:
symbol-- Returns:
-
resolve
Symbol resolve(java.lang.String id)
Searches and returns a symbol with the given id if it exists. The search is recursive up, so if a symbol is not found in the current scope, the algorithm searches the parent scopes all the way to the root built-in scope.- Parameters:
id-- Returns:
-
resolve
Symbol resolve(java.lang.String[] qualifiedName)
Searches and returns a symbol with the given qualified name if it exists. The search is recursive up, so if a symbol is not found in the current scope, the algorith searches the parend scopes all the way to the root built-in scope.- Parameters:
qualifiedName-- Returns:
-
start
void start(java.lang.String token)
This method is used during context-aware parsing to find multi-token symbols iteratively. It is used in conjunction with the #followUp method below.- Parameters:
token-
-
followUp
boolean followUp(java.lang.String token, boolean isPredict)This method is used during context-aware parsing to find multi-token symbols iteratively. It is used in conjunction with the #start method above.- Parameters:
token-
-
getSymbols
java.util.Map<java.lang.String,Symbol> getSymbols()
-
getType
Type getType()
maybe null.
-
-