SyntaxTreeToQsharp Class

Definition

Class used to generate Q# code for compiled Q# namespaces. Upon calling Transform, the Output property is set to the Q# code corresponding to the given namespace.

public class SyntaxTreeToQsharp : Microsoft.Quantum.QsCompiler.Transformations.Core.SyntaxTreeTransformation<Microsoft.Quantum.QsCompiler.Transformations.QsCodeOutput.SyntaxTreeToQsharp.TransformationState>
type SyntaxTreeToQsharp = class
    inherit SyntaxTreeTransformation<SyntaxTreeToQsharp.TransformationState>
Public Class SyntaxTreeToQsharp
Inherits SyntaxTreeTransformation(Of SyntaxTreeToQsharp.TransformationState)
Inheritance

Constructors

SyntaxTreeToQsharp(TransformationContext)

Fields

ExternalImplementation
InvalidExpression
InvalidFunctorGenerator
InvalidIdentifier
InvalidInitializer
InvalidSet
InvalidSymbol
InvalidType

Properties

Default
ExpressionKinds (Inherited from SyntaxTreeTransformation<T>)
Expressions (Inherited from SyntaxTreeTransformation<T>)
Namespaces (Inherited from SyntaxTreeTransformation<T>)
SharedState (Inherited from SyntaxTreeTransformation<T>)
StatementKinds (Inherited from SyntaxTreeTransformation<T>)
Statements (Inherited from SyntaxTreeTransformation<T>)
Types (Inherited from SyntaxTreeTransformation<T>)

Methods

Apply(List<ImmutableDictionary<String,String>>, IEnumerable<QsNamespace>, ValueTuple<String,ImmutableDictionary<String,ImmutableArray<ValueTuple<String,String>>>>[])

For each file in the given parameter array of open directives, generates a dictionary that maps (the name of) each partial namespace contained in the file to a string containing the formatted Q# code for the part of the namespace. Qualified or unqualified names for types and identifiers are generated based on the given namespace and open directives. -> IMPORTANT: The given namespace is expected to contain all elements in that namespace for the entire compilation unit!

ArgumentTuple(QsTuple<LocalVariableDeclaration<QsLocalSymbol,ResolvedType>>, Func<ResolvedType,String>, Action, Boolean)
CharacteristicsExpression(ResolvedCharacteristics)
DeclarationSignature(QsCallable, Func<ResolvedType,String>, Action)
OnAbsoluteLocation(QsNullable<QsLocation>) (Inherited from SyntaxTreeTransformation<T>)
OnArgumentTuple(QsTuple<LocalVariableDeclaration<QsLocalSymbol,ResolvedType>>) (Inherited from SyntaxTreeTransformation<T>)
OnCompilation(QsCompilation) (Inherited from SyntaxTreeTransformation<T>)
OnExpressionRange(QsNullable<Range>) (Inherited from SyntaxTreeTransformation<T>)
OnItemName(UserDefinedType, String) (Inherited from SyntaxTreeTransformation<T>)
OnItemNameDeclaration(String) (Inherited from SyntaxTreeTransformation<T>)
OnLocalName(String) (Inherited from SyntaxTreeTransformation<T>)
OnLocalNameDeclaration(String) (Inherited from SyntaxTreeTransformation<T>)
OnRelativeLocation(QsNullable<QsLocation>) (Inherited from SyntaxTreeTransformation<T>)
OnSymbolLocation(QsNullable<Position>, Range) (Inherited from SyntaxTreeTransformation<T>)
OnTypeRange(TypeRange) (Inherited from SyntaxTreeTransformation<T>)
ToCode(QsCustomType)
ToCode(QsExpressionKind<TypedExpression,Identifier,ResolvedType>)
ToCode(QsNamespace)
ToCode(QsStatement)
ToCode(QsStatementKind)
ToCode(ResolvedType)
ToCode(TypedExpression)

Applies to