Package-level declarations
Types
Represents a scope that is only visible in the current file. This is usually used in programming languages for file-level imports.
This should ideally only be called once. It constructs a new global scope, which is not associated to any AST node. However, depending on the language, a language frontend can explicitly set the ast node using ScopeManager.resetToGlobal if the language needs a global scope that is restricted to a translation unit, i.e. C++ while still maintaining a unique list of global variables.
Scope of validity associated to the local statement. Variables declared inside this statement are not visible outside.
A scope which acts as a namespace with a certain name, which is prefixed to all local names declared in it. This could be a package or other structural elements, like a class. In the first case, the derived NamespaceScope, in the latter case, the derived RecordScope should be used.
This scope is opened up by a NamespaceDeclaration and represents the scope of the whole namespace. This scope is special in a way that it will only exist once (per GlobalScope) and contains all symbols declared in this namespace, even if they are spread across multiple files.
Represents the scope of a record or class, most likely created by a RecordDeclaration.
This sealed (and abstract) class represents a Scope that in addition to declare variables also defines structures, such as classes, namespaces, etc.
Is a scope where local variables can be declared and independent of specific language constructs. Works for if, for, and extends to the block scope