Package org.kie.dmn.feel.lang.types
Class ScopeImpl
- java.lang.Object
-
- org.kie.dmn.feel.lang.types.ScopeImpl
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.voidsetChildScopes(Map<String,Scope> childScopes)voidsetName(String name)voidsetParentScope(Scope parentScope)voidstart(String token)This method is used during context-aware parsing to find multi-token symbols iteratively.static TokenTreetokenTreeFromSymbols(Map<String,Symbol> symbols)StringtoString()
-
-
-
Method Detail
-
getParentScope
public Scope getParentScope()
Description copied from interface:ScopeReturns the enclosing (parent) scope- Specified by:
getParentScopein interfaceScope- Returns:
-
define
public boolean define(Symbol symbol)
Description copied from interface:ScopeDefines a new symbol in this scope
-
resolve
public Symbol resolve(String id)
Description copied from interface:ScopeSearches 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.
-
resolve
public Symbol resolve(String[] qualifiedName)
Description copied from interface:ScopeSearches 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.
-
setName
public void setName(String name)
-
setParentScope
public void setParentScope(Scope parentScope)
-
addChildScope
public void addChildScope(Scope scope)
Description copied from interface:ScopeAdds an enclosed (child) scope- Specified by:
addChildScopein interfaceScope
-
getChildScopes
public Map<String,Scope> getChildScopes()
Description copied from interface:ScopeGets 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.- Specified by:
getChildScopesin interfaceScope- Returns:
-
getSymbols
public Map<String,Symbol> getSymbols()
- Specified by:
getSymbolsin interfaceScope
-
start
public void start(String token)
Description copied from interface:ScopeThis method is used during context-aware parsing to find multi-token symbols iteratively. It is used in conjunction with the #followUp method below.
-
followUp
public boolean followUp(String token, boolean isPredict)
Description copied from interface:ScopeThis method is used during context-aware parsing to find multi-token symbols iteratively. It is used in conjunction with the #start method above.
-
-