RegexSyntaxNode Class
The base of every node in a regular-expression tree.
public abstract class RegexSyntaxNode : SyntaxNode- Inheritance
SyntaxNodeRegexSyntaxNode
Properties
| Name | Description |
|---|---|
| Dialect | Gets the dialect the node was parsed as, or null when it is not part of a tree. |
| Options | Gets the options in effect at the first character of this node. |
| Parent | Gets the node this one is a child of, or null when it is the root of its tree. |
| SyntaxTree | Gets the tree this node belongs to, or null when it was built rather than parsed. |
Dialect
RegexSyntaxNode.csGets the dialect the node was parsed as, or null when it is not part of a tree.
public RegexDialect? Dialect { get; }Property value
Options
RegexSyntaxNode.csGets the options in effect at the first character of this node.
public RegexPatternOptions Options { get; }Property value
Remarks
Inline constructs such as (?i) change the options part-way through a pattern, so this is what was in effect where the node starts rather than what the whole pattern was parsed with. A node built by SyntaxFactory rather than parsed reports RegexPatternOptions.None.
Parent
RegexSyntaxNode.csGets the node this one is a child of, or null when it is the root of its tree.
public RegexSyntaxNode? Parent { get; }Property value
SyntaxTree
RegexSyntaxNode.csGets the tree this node belongs to, or null when it was built rather than parsed.
public RegexSyntaxTree? SyntaxTree { get; }Property value
Methods
| Name | Description |
|---|---|
| Accept(RegexSyntaxVisitor) | Calls the method of visitor that matches this node. |
| Accept<TResult>(RegexSyntaxVisitor<TResult>) | Calls the method of visitor that matches this node. |
| DescendantComments() | Gets every comment in this node, in source order. |
| Kind() | Gets what kind of node this is. |
Accept overloads
Accept(RegexSyntaxVisitor)
Calls the method of visitor that matches this node.
public abstract void Accept(RegexSyntaxVisitor visitor)Accept<TResult>(RegexSyntaxVisitor<TResult>)
Calls the method of visitor that matches this node.
public abstract TResult? Accept<TResult>(RegexSyntaxVisitor<TResult> visitor)Type parameters
TResult
Parameters
visitorRegexSyntaxVisitor<TResult>
Returns
TResult?
Exceptions
ArgumentNullExceptionvisitorisnull.
DescendantComments()
RegexSyntaxNode.csGets every comment in this node, in source order.
public IEnumerable<SyntaxTrivia> DescendantComments()