Microsoft.Quantum.QsCompiler.Transformations.BasicTransformations Namespace

Classes

FilterBySourceFile

Calling Transform on a syntax tree returns a new tree that only contains the type and callable declarations that are defined in the source file with the identifier given upon initialization. The transformation also ensures that the elements in each namespace are ordered according to the location at which they are defined in the file. Auto-generated declarations will be ordered alphabetically.

FilterBySourceFile.NamespaceTransformation
FilterBySourceFile.TransformationState
FoldOverExpressions<TState,TResult>

Class that evaluates a fold on upon transforming an expression. If recur is set to true in the internal state of the transformation, the fold function given on initialization is applied to all subexpressions as well as the expression itself - i.e. the fold it take starting on inner expressions (from the inside out). Otherwise the specified folder is only applied to the expression itself. The result of the fold is accessible via the FoldResult property in the internal state of the transformation. The transformation itself merely walks expressions and rebuilding is disabled.

GetSourceFiles
GetSourceFiles.TransformationState
SelectByAllContainedExpressions

Class that allows to transform scopes by keeping only statements whose expressions satisfy a certain criterion. Calling Transform will build a new Scope that contains only the statements for which all contained expressions or subexpressions satisfy the condition given on initialization. Note that subexpressions will only be verified if evaluateOnSubexpressions is set to true (default value).

SelectByAnyContainedExpression

Class that allows to transform scopes by keeping only statements that contain certain expressions. Calling Transform will build a new Scope that contains only the statements which contain an expression or subexpression (only if evaluateOnSubexpressions is set to true) that satisfies the condition given on initialization.

SelectByFoldingOverExpressions

Class that allows to transform scopes by keeping only statements whose expressions satisfy a certain criterion. Calling Transform will build a new Scope that contains only the statements for which the fold of a given condition over all contained expressions evaluates to true. If evaluateOnSubexpressions is set to true, the fold is evaluated on all subexpressions as well.

SelectByFoldingOverExpressions.StatementTransformation<TSelector>
SelectByFoldingOverExpressions.TransformationState
TypedExpressionWalker<T>

Upon transformation, applies the specified action to each expression and subexpression. The action to apply is specified upon construction, and will be applied before recurring into subexpressions. The transformation merely walks expressions and rebuilding is disabled.

Interfaces

FoldOverExpressions<TState,TResult>.IFoldingState