Scope

/**
* A Scope. A scope is the lexical extent over which all identifiers with the same name refer to the same variable.
* Modules, Classes and Functions are all Scopes. There are no other scopes.
* The scopes for expressions that create new scopes, lambdas and comprehensions, are handled by creating an anonymous Function.
*/

Inherit from CombineElement

Primary key: id: int

schema Scope extends CombineElement {
  @primary id: int
}

Scope::getParent

/**
* @brief gets the parent element of the element
* @return CombineElement 
*/
pub fn getParent(self: Scope) -> CombineElement;

Scope::getAnAncestor

/**
* @brief gets an ancestor of the element.
* @return CombineElement 
*/
pub fn getAnAncestor(self: Scope) -> *CombineElement;

Scope::getLocation

/**
* @brief gets the location for the element.
* @return Location
*/
pub fn getLocation(self: Scope) -> Location;

Scope::getAnAncestorForIndex

/**
* @brief gets the index for printing AST.
* @return int 
*/
pub fn getAnAncestorForIndex(self: Scope, index: int) -> CombineElement;

Scope::print

/**
* @brief gets the printable text for printing AST
* @return string 
*/
  • Parameter self: Scope
  • Return string
pub fn print(self: Scope) -> string;

Scope::__all__

Data constraint method.

pub fn __all__(db: PythonDB) -> *Scope;

Scope::getType

/**
* @brief gets the printable text for printing AST
* @return string 
*/
  • Parameter self: Scope
  • Return string
pub fn getType(self: Scope) -> string;

Scope::getEnclosingScope

/**
* @brief gets the immediately enclosing scope (module, function or class) whose body contains this statement.
* @return Scope 
*/
pub fn getEnclosingScope(self: Scope) -> Scope;

Scope::getParentOid

  • Parameter self: Scope
  • Return int
pub fn getParentOid(self: Scope) -> int;