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(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.voidsetChildScopes(java.util.Map<java.lang.String,Scope> childScopes)voidsetName(java.lang.String name)voidsetParentScope(Scope parentScope)voidstart(java.lang.String token)This method is used during context-aware parsing to find multi-token symbols iteratively.static TokenTreetokenTreeFromSymbols(java.util.Map<java.lang.String,Symbol> symbols)java.lang.StringtoString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:ScopeReturns the scope name
-
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(java.lang.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(java.lang.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(java.lang.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 java.util.Map<java.lang.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:
-
setChildScopes
public void setChildScopes(java.util.Map<java.lang.String,Scope> childScopes)
-
getSymbols
public java.util.Map<java.lang.String,Symbol> getSymbols()
- Specified by:
getSymbolsin interfaceScope
-
start
public void start(java.lang.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(java.lang.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.
-
tokenTreeFromSymbols
public static TokenTree tokenTreeFromSymbols(java.util.Map<java.lang.String,Symbol> symbols)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-