// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
usingSystem.Collections.Immutable;
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// Represents a reference to a local variable synthesized by language analysis.
/// </summary>
/// <remarks>
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// Represents different kinds of do loop statements.
/// </summary>
publicenumDoLoopKind
{
None=0x0,
/// <summary>
/// Indicates a C# 'do while' or a VB 'Do While' loop where the loop condition is executed at the bottom of the loop, i.e. end of the loop iteration.
/// Loop executes while the loop condition evaluates to <code>true</code>.
/// </summary>
DoWhileBottomLoop=0x1,
/// <summary>
/// Indicates a VB 'Do While' loop with the loop condition executed at the top of the loop, i.e. beginning of the loop iteration.
/// Loop executes while the loop condition evaluates to <code>true</code>.
/// </summary>
DoWhileTopLoop=0x2,
/// <summary>
/// Indicates a VB 'Do Until' loop with the loop condition executed at the bottom of the loop, i.e. end of the loop iteration.
/// Loop executes while the loop condition evaluates to <code>false</code>.
/// </summary>
DoUntilBottomLoop=0x3,
/// <summary>
/// Indicates a VB 'Do Until' loop with the loop condition executed at the top of the loop, i.e. beginning of the loop iteration.
/// Loop executes while the loop condition evaluates to <code>false</code>.
/// </summary>
DoUntilTopLoop=0x4,
/// <summary>
/// Indicates an invalid loop. For example, VB 'Do While' or 'Do Until' loop with syntax errors where both the top and bottom conditions are provided.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// Represents a C# 'do while' or VB 'Do While' or 'Do Until' loop statement.
/// </summary>
/// <remarks>
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.
/// </remarks>
publicinterfaceIDoLoopStatement:ILoopStatement
{
/// <summary>
/// Condition of the loop.
/// </summary>
IOperationCondition{get;}
/// <summary>
/// Represents kind of do loop statement.
/// </summary>
DoLoopKindDoLoopKind{get;}
/// <summary>
/// Additional conditional supplied for loop in error cases, which is ignored by the compiler.
/// For example, for VB 'Do While' or 'Do Until' loop with syntax errors where both the top and bottom conditions are provided.
/// The top condition is preferred and exposed as <see cref="Condition"/> and the bottom condition is ignored and exposed by this property.
/// This property should be null for all non-error cases.
/// Statements to execute before entry to the loop. For C# these come from the first clause of the for statement. For VB these initialize the index variable of the For statement.
/// List of operations to execute before entry to the loop. This comes from the first clause of the for statement.
/// </summary>
ImmutableArray<IOperation>Before{get;}
/// <summary>
/// Statements to execute at the bottom of the loop. For C# these come from the third clause of the for statement. For VB these increment the index variable of the For statement.
/// Condition of the loop. This comes from the second clause of the for statement.
/// </summary>
ImmutableArray<IOperation>AtLoopBottom{get;}
IOperationCondition{get;}
/// <summary>
/// Declarations local to the loop.
/// List of operations to execute at the bottom of the loop. This comes from the third clause of the for statement.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
usingSystem.Collections.Immutable;
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// Represents a C# while, for, or do statement, or a VB While, For, or Do statement.
/// Represents a C# 'while' or a VB 'While' loop statement.
/// </summary>
/// <remarks>
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
usingSystem.Collections.Immutable;
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// Kinds of loops.
/// Kinds of loop statements.
/// </summary>
publicenumLoopKind
{
None=0x0,
/// <summary>
/// Indicates a C# while or do loop, or a VB While or Do loop.
/// Represents a <see cref="IDoLoopStatement"/> in C# or VB.
/// </summary>
Do=0x1,
/// <summary>
/// Represents a <see cref="IWhileLoopStatement"/> in C# or VB.
/// </summary>
While=0x2,
/// <summary>
/// Indicates a <see cref="IForLoopStatement"/> in C#.
/// </summary>
WhileUntil=0x1,
For=0x3,
/// <summary>
/// Indicates a C# for loop or a VB For loop.
/// Indicates a <see cref="IForToLoopStatement"/> in VB.
/// </summary>
For=0x2,
ForTo=0x4,
/// <summary>
/// Indicates a C# foreach loop or a VB For Each loop.
/// Indicates a <see cref="IForEachLoopStatement"/> in C# or VB.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
usingSystem.Collections.Immutable;
namespaceMicrosoft.CodeAnalysis.Semantics
{
/// <summary>
/// Kinds of synthetic local references.
/// </summary>
publicenumSyntheticLocalKind
{
None=0x0,
/// <summary>
/// Created to capture the step value of a VB for loop.
/// </summary>
ForLoopStepValue=0x1,
/// <summary>
/// Created to capture the limit value of a VB for loop.
IExpressionStatement(OperationKind.ExpressionStatement)(Syntax:'For i = 0 T ... Next')
Expression:ICompoundAssignmentExpression(BinaryOperatorKind.Add)(OperationKind.CompoundAssignmentExpression,Type:System.Int32)(Syntax:'For i = 0 T ... Next')
Right:IConversionExpression(Explicit,TryCast:False,Unchecked)(OperationKind.ConversionExpression,Type:System.Int32,Constant:1)(Syntax:'For i = 0 T ... Next')
StepValue:IConversionExpression(Explicit,TryCast:False,Unchecked)(OperationKind.ConversionExpression,Type:System.Int32,Constant:1)(Syntax:'For i = 0 T ... Next')
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
ImportsMicrosoft.CodeAnalysis.Semantics
ImportsMicrosoft.CodeAnalysis.Test.Utilities
...
...
@@ -205,29 +205,19 @@ Module Program
EndModule
]]>.Value
DimexpectedOperationTree=<![CDATA[
IForLoopStatement(LoopKind.For)(OperationKind.LoopStatement,IsInvalid)(Syntax:'For i As In ... Next i')
IExpressionStatement(OperationKind.ExpressionStatement,IsInvalid)(Syntax:'For i As In ... Next i')
Expression:ICompoundAssignmentExpression(BinaryOperatorKind.Add)(OperationKind.CompoundAssignmentExpression,Type:System.Int32,IsInvalid)(Syntax:'For i As In ... Next i')
Left:ILocalReferenceExpression:i(OperationKind.LocalReferenceExpression,Type:System.Int32)(Syntax:'i As Integer')
Right:IConversionExpression(Explicit,TryCast:False,Unchecked)(OperationKind.ConversionExpression,Type:System.Int32,Constant:1,IsInvalid)(Syntax:'For i As In ... Next i')
StepValue:IConversionExpression(Explicit,TryCast:False,Unchecked)(OperationKind.ConversionExpression,Type:System.Int32,Constant:1,IsInvalid)(Syntax:'For i As In ... Next i')