GlobalScope

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.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun addDeclaration(declaration: Declaration, addToAST: Boolean)
Link copied to clipboard
fun addLabelStatement(labelStatement: LabelStatement)
Link copied to clipboard
Link copied to clipboard
fun addValueDeclaration(valueDeclaration: ValueDeclaration, addToAST: Boolean)

THe value declarations are only set in the ast node if the handler of the ast node may not know the outer

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Because the way we currently handle parallel parsing in TranslationManager.parseParallel, we end up with multiple GlobalScope objects, one for each TranslationUnitDeclaration. In the end, we need to merge all these different scopes into one final global scope. To be somewhat consistent with the behaviour of TranslationManager.parseSequentially, we assign the last translation unit declaration we see to the AST node of the GlobalScope. This is not completely ideal, but the best we can do for now.

Properties

Link copied to clipboard
override 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

FQN Name currently valid

Link copied to clipboard

A map of typedefs keyed by their alias.