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(String token, boolean isPredict)This method is used during context-aware parsing to find multi-token symbols iteratively.Map<String,Scope>getChildScopes()Gets a map of all children scopes.StringgetName()Returns the scope nameScopegetParentScope()Returns the enclosing (parent) scopeMap<String,Symbol>getSymbols()TypegetType()maybe null.Symbolresolve(String id)Searches and returns a symbol with the given id if it exists.Symbolresolve(String[] qualifiedName)Searches and returns a symbol with the given qualified name if it exists.voidstart(String token)This method is used during context-aware parsing to find multi-token symbols iteratively.
-
-
-
Field Detail
-
BUILT_IN
static final String BUILT_IN
- See Also:
- Constant Field Values
-
GLOBAL
static final String GLOBAL
- See Also:
- Constant Field Values
-
LOCAL
static final String LOCAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
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
Map<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(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(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(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(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-
-
getType
Type getType()
maybe null.
-
-