ShellUnaryExpressionSyntax Class

Represents a prefix expression such as -x, !$a, or the conditional test -f file, and the postfix increment forms i++ and i--.

public sealed class ShellUnaryExpressionSyntax : ShellExpressionSyntax
Inheritance
ShellExpressionSyntax ShellUnaryExpressionSyntax

Properties

NameDescription
IsPostfixReturns true when the operator follows the operand, as in i++.
Operand
OperatorTextThe operator text, whichever side it is on.
PostfixOperatorToken
PrefixOperatorToken

Returns true when the operator follows the operand, as in i++.

public bool IsPostfix { get; }

Property value

bool

public ShellExpressionSyntax Operand { get; }

Property value

ShellExpressionSyntax

No documentation is available.

The operator text, whichever side it is on.

public string OperatorText { get; }

Property value

string

PostfixOperatorToken

Syntax.g.cs
public SyntaxToken PostfixOperatorToken { get; }

Property value

SyntaxToken

No documentation is available.

PrefixOperatorToken

Syntax.g.cs
public SyntaxToken PrefixOperatorToken { get; }

Property value

SyntaxToken

No documentation is available.

Methods

NameDescription
Accept(ShellSyntaxVisitor)
Accept<TResult>(ShellSyntaxVisitor<TResult>)
Update(SyntaxToken, ShellExpressionSyntax, SyntaxToken)Returns this node with the given parts, or itself when nothing changed.
WithOperand(ShellExpressionSyntax)Returns this node with operand in place of its ShellUnaryExpressionSyntax.Operand.
WithPostfixOperatorToken(SyntaxToken)Returns this node with postfixOperatorToken in place of its ShellUnaryExpressionSyntax.PostfixOperatorToken.
WithPrefixOperatorToken(SyntaxToken)Returns this node with prefixOperatorToken in place of its ShellUnaryExpressionSyntax.PrefixOperatorToken.

Accept overloads

Accept(ShellSyntaxVisitor)

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

No documentation is available.

Accept<TResult>(ShellSyntaxVisitor<TResult>)

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

TResult?

No documentation is available.

Update(SyntaxToken, ShellExpressionSyntax, SyntaxToken)

Syntax.g.cs

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

public ShellUnaryExpressionSyntax Update(SyntaxToken prefixOperatorToken, ShellExpressionSyntax operand, SyntaxToken postfixOperatorToken)

Parameters

prefixOperatorToken SyntaxToken
operand ShellExpressionSyntax
postfixOperatorToken SyntaxToken

Returns

ShellUnaryExpressionSyntax

WithOperand(ShellExpressionSyntax)

Syntax.g.cs

Returns this node with operand in place of its ShellUnaryExpressionSyntax.Operand.

WithPostfixOperatorToken(SyntaxToken)

Syntax.g.cs

Returns this node with postfixOperatorToken in place of its ShellUnaryExpressionSyntax.PostfixOperatorToken.

public ShellUnaryExpressionSyntax WithPostfixOperatorToken(SyntaxToken postfixOperatorToken)

Parameters

postfixOperatorToken SyntaxToken

Returns

ShellUnaryExpressionSyntax

WithPrefixOperatorToken(SyntaxToken)

Syntax.g.cs

Returns this node with prefixOperatorToken in place of its ShellUnaryExpressionSyntax.PrefixOperatorToken.

public ShellUnaryExpressionSyntax WithPrefixOperatorToken(SyntaxToken prefixOperatorToken)

Parameters

prefixOperatorToken SyntaxToken

Returns

ShellUnaryExpressionSyntax