A model representing a unary operation over an expression, for example:
!TRUE
!(A == 2)
-15
Properties | Type | Description |
---|---|---|
_meta | Meta |
See
Meta
for more information.
|
_type |
|
|
expr◊ | BinaryOp |
The expression to which the unary operation will be applied.
See
definitions.expression in
BinaryOp
for more information.
|
op◊ |
The operation to be performed on
|
|
|
||
|
{
"_type": "AST.UnaryOp",
"op": "!",
"expr": {
"_type": "AST.Bool",
"value": true
}
}
{
"_type": "AST.UnaryOp",
"op": "!",
"expr": {
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Identifier",
"value": "A"
},
"op": "==",
"right": {
"_type": "AST.Integer",
"value": 2
}
}
}
{
"_type": "AST.UnaryOp",
"op": "-",
"expr": {
"_type": "AST.Integer",
"value": 15
}
}
{
"additionalProperties": false,
"info": [
"A model representing a unary operation over an expression, for example:",
[
" - `!TRUE`",
" - `!(A == 2)`",
" - `-15`"
]
],
"examples": [
{
"_type": "AST.UnaryOp",
"op": "!",
"expr": {
"_type": "AST.Bool",
"value": true
}
},
{
"_type": "AST.UnaryOp",
"op": "!",
"expr": {
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Identifier",
"value": "A"
},
"op": "==",
"right": {
"_type": "AST.Integer",
"value": 2
}
}
},
{
"_type": "AST.UnaryOp",
"op": "-",
"expr": {
"_type": "AST.Integer",
"value": 15
}
}
],
"properties": {
"_meta": {
"$ref": "../Meta.json"
},
"_type": {
"enum": [
"AST.UnaryOp"
]
},
"op": {
"info": [
"The operation to be performed on `expr`."
],
"enum": [
"!",
"-",
"NOT"
]
},
"expr": {
"info": [
"The expression to which the unary operation will be applied."
],
"$ref": "BinaryOp.json#/definitions/expression"
}
},
"required": [
"expr",
"op"
],
"title": "UnaryOp",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#"
}