Interface Scope

    • 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.