FileScope

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

The only supported AST node is a TranslationUnitDeclaration.

Constructors

Link copied to clipboard
constructor(astNode: TranslationUnitDeclaration?)

Properties

Link copied to clipboard
open var astNode: Node?
Link copied to clipboard

The list of child scopes.

Link copied to clipboard

Returns the GlobalScope of this scope by traversing its parents upwards.

Link copied to clipboard
var id: Long?

Required field for object graph mapping. It contains the scope id.

Link copied to clipboard
var name: Name?

The real new name

Link copied to clipboard

Scopes are nested and therefore have a parent child relationship, this two members will help navigate through the scopes,e.g. when looking up variables.

Link copied to clipboard

In some languages, the lookup scope of a symbol that is being resolved (e.g. of a Reference) can be adjusted through keywords (such as global in Python or PHP).

Link copied to clipboard

FQN Name currently valid

Link copied to clipboard

A map of symbols and their respective Declaration nodes that declare them.

Link copied to clipboard

Functions

Link copied to clipboard
fun addLabelStatement(labelStatement: LabelStatement)
Link copied to clipboard
fun addSymbol(symbol: Symbol, declaration: Declaration)

Adds a declaration with the defined symbol.

Link copied to clipboard
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun lookupSymbol(symbol: Symbol, thisScopeOnly: Boolean = false, replaceImports: Boolean = true, predicate: (Declaration) -> Boolean? = null): List<Declaration>

Looks up a list of Declaration nodes for the specified symbol. Optionally, predicate can be used for additional filtering.

Link copied to clipboard
open override fun toString(): String