RegexAlternationSyntax Class

Represents a list of branches separated by |.

public sealed class RegexAlternationSyntax : RegexSyntaxNode

Remarks

Every pattern body is an alternation, even one with a single branch and no | at all. Keeping the shape uniform means a consumer never has to handle two spellings of the same thing.

Inheritance
RegexSyntaxNode RegexAlternationSyntax

Properties

NameDescription
BarTokensGets the | that follows each branch. The one at i follows the branch at i.
Branches
HasAlternativesGets a value indicating whether the alternation has more than one branch.

Gets the | that follows each branch. The one at i follows the branch at i.

public IEnumerable<SyntaxToken> BarTokens { get; }

Branches

Syntax.g.cs
public SeparatedSyntaxList<RegexSequenceSyntax> Branches { get; }

No documentation is available.

Gets a value indicating whether the alternation has more than one branch.

public bool HasAlternatives { get; }

Property value

bool

Methods

NameDescription
Accept(RegexSyntaxVisitor)
Accept<TResult>(RegexSyntaxVisitor<TResult>)
Update(SeparatedSyntaxList<RegexSequenceSyntax>)Returns this node with the given parts, or itself when nothing changed.
WithBranches(SeparatedSyntaxList<RegexSequenceSyntax>)Returns this node with branches in place of its RegexAlternationSyntax.Branches.

Accept overloads

Accept(RegexSyntaxVisitor)

Syntax.g.cs
public override void Accept(RegexSyntaxVisitor visitor)
Parameters
visitor RegexSyntaxVisitor

No documentation is available.

Accept<TResult>(RegexSyntaxVisitor<TResult>)

Syntax.g.cs
public override TResult? Accept<TResult>(RegexSyntaxVisitor<TResult> visitor)
Type parameters
TResult
Parameters
visitor RegexSyntaxVisitor<TResult>
Returns

TResult?

No documentation is available.

Update(SeparatedSyntaxList<RegexSequenceSyntax>)

Syntax.g.cs

Returns this node with the given parts, or itself when nothing changed.

WithBranches(SeparatedSyntaxList<RegexSequenceSyntax>)

Syntax.g.cs

Returns this node with branches in place of its RegexAlternationSyntax.Branches.