RegexAlternationSyntax Class
Represents a list of branches separated by |.
public sealed class RegexAlternationSyntax : RegexSyntaxNodeRemarks
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
RegexSyntaxNodeRegexAlternationSyntax
Properties
| Name | Description |
|---|---|
| BarTokens | Gets the | that follows each branch. The one at i follows the branch at i. |
| Branches | |
| HasAlternatives | Gets a value indicating whether the alternation has more than one branch. |
BarTokens
RegexAlternationSyntax.csGets the | that follows each branch. The one at i follows the branch at i.
public IEnumerable<SyntaxToken> BarTokens { get; }Property value
Branches
Syntax.g.cspublic SeparatedSyntaxList<RegexSequenceSyntax> Branches { get; }Property value
No documentation is available.
HasAlternatives
RegexAlternationSyntax.csMethods
| Name | Description |
|---|---|
| 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.cspublic override void Accept(RegexSyntaxVisitor visitor)Parameters
visitorRegexSyntaxVisitor
No documentation is available.
Accept<TResult>(RegexSyntaxVisitor<TResult>)
Syntax.g.cspublic override TResult? Accept<TResult>(RegexSyntaxVisitor<TResult> visitor)No documentation is available.
Update(SeparatedSyntaxList<RegexSequenceSyntax>)
Syntax.g.csReturns this node with the given parts, or itself when nothing changed.
public RegexAlternationSyntax Update(SeparatedSyntaxList<RegexSequenceSyntax> branches)WithBranches(SeparatedSyntaxList<RegexSequenceSyntax>)
Syntax.g.csReturns this node with branches in place of its RegexAlternationSyntax.Branches.
public RegexAlternationSyntax WithBranches(SeparatedSyntaxList<RegexSequenceSyntax> branches)