CompilationUnit Class

Definition

Represents a compilation. Apart from storing and providing the means to update the compilation itself, this class stores referenced content and provides the infrastructure to track global symbols.

public class CompilationUnit : IDisposable, Microsoft.Quantum.QsCompiler.DataTypes.IReaderWriterLock
type CompilationUnit = class
    interface IReaderWriterLock
    interface IDisposable
Public Class CompilationUnit
Implements IDisposable, IReaderWriterLock
Inheritance
CompilationUnit
Implements

Remarks

IMPORTANT: The responsibility to update the compilation to match changes to Microsoft.Quantum.QsCompiler.CompilationBuilder.CompilationUnit.GlobalSymbols lays within the the managing entity.

Methods

Build()

Returns the built Q# compilation reflecting the current internal state.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EnterReadLock()

Enters a read-lock, provided none of the dependent locks is set, or a compilation lock is already held.

EnterUpgradeableReadLock()

Enters an upgradeable read-lock, provided none of the dependent locks is set, or a suitable compilation lock is aready held.

EnterWriteLock()

Enters a write-lock, provided none of the dependent locks is set, or a suitable compilation lock is already held.

ExitReadLock() System.Object.ExitReadLock
ExitUpgradeableReadLock()
ExitWriteLock() System.Object.ExitWriteLock
GetOpenDirectives(String)

Returns a look-up that contains the names of all namespaces and the corresponding short hand, if any, imported within a certain source file for nsName.

NewSyntaxTree(IEnumerable<QsCallable>, IEnumerable<QsCustomType>, IReadOnlyDictionary<String,ILookup<String,ImmutableArray<String>>>)

Builds a syntax tree containing callables and types, and attaches the documentation specified by documentation - if any - to each namespace.

Applies to