C# Class Rhino.Ast.UnaryExpression

AST node representing unary operators such as ++ , ~ , typeof and delete . The type field is set to the appropriate Token type for the operator. The node length spans from the operator to the end of the operand (for prefix operators) or from the start of the operand to the operator (for postfix).

The default xml namespace = <expr> statement in E4X (JavaScript 1.6) is represented as a UnaryExpression of node type Rhino.Token.DEFAULTNAMESPACE , wrapped with an ExpressionStatement .

Inheritance: AstNode
Mostrar archivo Open project: hazzik/Rhino.Net Class Usage Examples

Public Methods

Method Description
GetOperand ( ) : AstNode
GetOperator ( ) : int

Returns operator token – alias for Rhino.Node.GetType()

IsPostfix ( ) : bool

Returns whether the operator is postfix

IsPrefix ( ) : bool

Returns whether the operator is prefix

SetIsPostfix ( bool isPostfix ) : void

Sets whether the operator is postfix

SetOperand ( AstNode operand ) : void

Sets the operand, and sets its parent to be this node.

Sets the operand, and sets its parent to be this node.

SetOperator ( int @operator ) : void

Sets operator – same as Rhino.Node.SetType(int) , but throws an exception if the operator is invalid

ToSource ( int depth ) : string
UnaryExpression ( ) : System
UnaryExpression ( int pos ) : System
UnaryExpression ( int pos, int len ) : System

Constructs a new postfix UnaryExpression

UnaryExpression ( int @operator, int operatorPosition, AstNode operand ) : System

Constructs a new prefix UnaryExpression.

Constructs a new prefix UnaryExpression.

UnaryExpression ( int @operator, int operatorPosition, AstNode operand, bool postFix ) : System

Constructs a new UnaryExpression with the specified operator and operand.

Constructs a new UnaryExpression with the specified operator and operand. It sets the parent of the operand, and sets its own bounds to encompass the operator and operand.

Visit ( NodeVisitor v ) : void

Visits this node, then the operand.

Visits this node, then the operand.

Method Details

GetOperand() public method

public GetOperand ( ) : AstNode
return AstNode

GetOperator() public method

Returns operator token – alias for Rhino.Node.GetType()
public GetOperator ( ) : int
return int

IsPostfix() public method

Returns whether the operator is postfix
public IsPostfix ( ) : bool
return bool

IsPrefix() public method

Returns whether the operator is prefix
public IsPrefix ( ) : bool
return bool

SetIsPostfix() public method

Sets whether the operator is postfix
public SetIsPostfix ( bool isPostfix ) : void
isPostfix bool
return void

SetOperand() public method

Sets the operand, and sets its parent to be this node.
Sets the operand, and sets its parent to be this node.
/// } if /// operand /// is /// null ///
public SetOperand ( AstNode operand ) : void
operand AstNode
return void

SetOperator() public method

Sets operator – same as Rhino.Node.SetType(int) , but throws an exception if the operator is invalid
/// if operator is not a valid /// Token code ///
public SetOperator ( int @operator ) : void
@operator int
return void

ToSource() public method

public ToSource ( int depth ) : string
depth int
return string

UnaryExpression() public method

public UnaryExpression ( ) : System
return System

UnaryExpression() public method

public UnaryExpression ( int pos ) : System
pos int
return System

UnaryExpression() public method

Constructs a new postfix UnaryExpression
public UnaryExpression ( int pos, int len ) : System
pos int
len int
return System

UnaryExpression() public method

Constructs a new prefix UnaryExpression.
Constructs a new prefix UnaryExpression.
public UnaryExpression ( int @operator, int operatorPosition, AstNode operand ) : System
@operator int
operatorPosition int
operand AstNode
return System

UnaryExpression() public method

Constructs a new UnaryExpression with the specified operator and operand.
Constructs a new UnaryExpression with the specified operator and operand. It sets the parent of the operand, and sets its own bounds to encompass the operator and operand.
/// } if /// operand /// is /// null ///
public UnaryExpression ( int @operator, int operatorPosition, AstNode operand, bool postFix ) : System
@operator int
operatorPosition int the absolute position of the operator.
operand AstNode the operand expression
postFix bool true if the operator follows the operand. Int
return System

Visit() public method

Visits this node, then the operand.
Visits this node, then the operand.
public Visit ( NodeVisitor v ) : void
v NodeVisitor
return void