Package-level declarations

Types

Link copied to clipboard

Scope of validity associated to a block of statements. Variables declared inside a block are not visible outside.

Link copied to clipboard
interface Breakable

Represents scopes that can be interrupted by a BreakStatement.

Link copied to clipboard
interface Continuable

Represents scopes that can be interrupted by a ContinueStatement.

Link copied to clipboard

Represents a scope that is only visible in the current file. This is usually used in programming languages for file-level imports.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard
Link copied to clipboard

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 latter case, the derived RecordScope should be used.

Link copied to clipboard
class RecordScope(node: Node? = null) : NameScope

Represents the scope of a record or class, most likely created by a RecordDeclaration.

Link copied to clipboard
abstract class Scope(var astNode: Node?)

Represent semantic scopes in the language. Depending on the language scopes can have visibility restriction and can act as namespaces to avoid name collisions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias Symbol = String

A symbol is a simple, local name. It is valid within the scope that declares it and all of its child scopes. However, a child scope can usually "shadow" a symbol of a higher scope.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open class ValueDeclarationScope(var astNode: Node?) : Scope

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

Functions

Link copied to clipboard
fun SymbolMap.mergeFrom(symbolMap: SymbolMap)

This function merges in all entries from the symbolMap into the current SymbolMap.