208 lines
12 KiB
C#
208 lines
12 KiB
C#
using Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax;
|
|||
|
|
|
||
|
|
namespace Microsoft.CodeAnalysis.CSharp.Syntax;
|
||
|
|
|
||
|
|
public sealed class JoinClauseSyntax : QueryClauseSyntax
|
||
|
|
{
|
||
|
|
private TypeSyntax? type;
|
||
|
|
|
||
|
|
private ExpressionSyntax? inExpression;
|
||
|
|
|
||
|
|
private ExpressionSyntax? leftExpression;
|
||
|
|
|
||
|
|
private ExpressionSyntax? rightExpression;
|
||
|
|
|
||
|
|
private JoinIntoClauseSyntax? into;
|
||
|
|
|
||
|
|
public SyntaxToken JoinKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.JoinClauseSyntax)(object)((SyntaxNode)this).Green).joinKeyword, ((SyntaxNode)this).Position, 0);
|
||
|
|
|
||
|
|
public TypeSyntax? Type => ((SyntaxNode)this).GetRed<TypeSyntax>(ref type, 1);
|
||
|
|
|
||
|
|
public SyntaxToken Identifier => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.JoinClauseSyntax)(object)((SyntaxNode)this).Green).identifier, ((SyntaxNode)this).GetChildPosition(2), ((SyntaxNode)this).GetChildIndex(2));
|
||
|
|
|
||
|
|
public SyntaxToken InKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.JoinClauseSyntax)(object)((SyntaxNode)this).Green).inKeyword, ((SyntaxNode)this).GetChildPosition(3), ((SyntaxNode)this).GetChildIndex(3));
|
||
|
|
|
||
|
|
public ExpressionSyntax InExpression => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref inExpression, 4);
|
||
|
|
|
||
|
|
public SyntaxToken OnKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.JoinClauseSyntax)(object)((SyntaxNode)this).Green).onKeyword, ((SyntaxNode)this).GetChildPosition(5), ((SyntaxNode)this).GetChildIndex(5));
|
||
|
|
|
||
|
|
public ExpressionSyntax LeftExpression => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref leftExpression, 6);
|
||
|
|
|
||
|
|
public SyntaxToken EqualsKeyword => new SyntaxToken((SyntaxNode)(object)this, (GreenNode)(object)((Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.JoinClauseSyntax)(object)((SyntaxNode)this).Green).equalsKeyword, ((SyntaxNode)this).GetChildPosition(7), ((SyntaxNode)this).GetChildIndex(7));
|
||
|
|
|
||
|
|
public ExpressionSyntax RightExpression => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref rightExpression, 8);
|
||
|
|
|
||
|
|
public JoinIntoClauseSyntax? Into => ((SyntaxNode)this).GetRed<JoinIntoClauseSyntax>(ref into, 9);
|
||
|
|
|
||
|
|
internal JoinClauseSyntax(Microsoft.CodeAnalysis.CSharp.Syntax.InternalSyntax.CSharpSyntaxNode green, SyntaxNode? parent, int position)
|
||
|
|
: base(green, parent, position)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override SyntaxNode? GetNodeSlot(int index)
|
||
|
|
{
|
||
|
|
return (SyntaxNode?)(index switch
|
||
|
|
{
|
||
|
|
1 => ((SyntaxNode)this).GetRed<TypeSyntax>(ref type, 1),
|
||
|
|
4 => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref inExpression, 4),
|
||
|
|
6 => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref leftExpression, 6),
|
||
|
|
8 => ((SyntaxNode)this).GetRed<ExpressionSyntax>(ref rightExpression, 8),
|
||
|
|
9 => ((SyntaxNode)this).GetRed<JoinIntoClauseSyntax>(ref into, 9),
|
||
|
|
_ => null,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
internal override SyntaxNode? GetCachedSlot(int index)
|
||
|
|
{
|
||
|
|
return (SyntaxNode?)(index switch
|
||
|
|
{
|
||
|
|
1 => type,
|
||
|
|
4 => inExpression,
|
||
|
|
6 => leftExpression,
|
||
|
|
8 => rightExpression,
|
||
|
|
9 => into,
|
||
|
|
_ => null,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void Accept(CSharpSyntaxVisitor visitor)
|
||
|
|
{
|
||
|
|
visitor.VisitJoinClause(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public override TResult? Accept<TResult>(CSharpSyntaxVisitor<TResult> visitor)
|
||
|
|
{
|
||
|
|
return visitor.VisitJoinClause(this);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax Update(SyntaxToken joinKeyword, TypeSyntax? type, SyntaxToken identifier, SyntaxToken inKeyword, ExpressionSyntax inExpression, SyntaxToken onKeyword, ExpressionSyntax leftExpression, SyntaxToken equalsKeyword, ExpressionSyntax rightExpression, JoinIntoClauseSyntax? into)
|
||
|
|
{
|
||
|
|
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
if (joinKeyword != JoinKeyword || type != Type || identifier != Identifier || inKeyword != InKeyword || inExpression != InExpression || onKeyword != OnKeyword || leftExpression != LeftExpression || equalsKeyword != EqualsKeyword || rightExpression != RightExpression || into != Into)
|
||
|
|
{
|
||
|
|
JoinClauseSyntax joinClauseSyntax = SyntaxFactory.JoinClause(joinKeyword, type, identifier, inKeyword, inExpression, onKeyword, leftExpression, equalsKeyword, rightExpression, into);
|
||
|
|
SyntaxAnnotation[] annotations = ((SyntaxNode)this).GetAnnotations();
|
||
|
|
if (annotations == null || annotations.Length == 0)
|
||
|
|
{
|
||
|
|
return joinClauseSyntax;
|
||
|
|
}
|
||
|
|
return joinClauseSyntax.WithAnnotations(annotations);
|
||
|
|
}
|
||
|
|
return this;
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithJoinKeyword(SyntaxToken joinKeyword)
|
||
|
|
{
|
||
|
|
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(joinKeyword, Type, Identifier, InKeyword, InExpression, OnKeyword, LeftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithType(TypeSyntax? type)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, type, Identifier, InKeyword, InExpression, OnKeyword, LeftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithIdentifier(SyntaxToken identifier)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, identifier, InKeyword, InExpression, OnKeyword, LeftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithInKeyword(SyntaxToken inKeyword)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, inKeyword, InExpression, OnKeyword, LeftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithInExpression(ExpressionSyntax inExpression)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, InKeyword, inExpression, OnKeyword, LeftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithOnKeyword(SyntaxToken onKeyword)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, InKeyword, InExpression, onKeyword, LeftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithLeftExpression(ExpressionSyntax leftExpression)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, InKeyword, InExpression, OnKeyword, leftExpression, EqualsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithEqualsKeyword(SyntaxToken equalsKeyword)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, InKeyword, InExpression, OnKeyword, LeftExpression, equalsKeyword, RightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithRightExpression(ExpressionSyntax rightExpression)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, InKeyword, InExpression, OnKeyword, LeftExpression, EqualsKeyword, rightExpression, Into);
|
||
|
|
}
|
||
|
|
|
||
|
|
public JoinClauseSyntax WithInto(JoinIntoClauseSyntax? into)
|
||
|
|
{
|
||
|
|
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
|
||
|
|
return Update(JoinKeyword, Type, Identifier, InKeyword, InExpression, OnKeyword, LeftExpression, EqualsKeyword, RightExpression, into);
|
||
|
|
}
|
||
|
|
}
|