A model representing binary operations such as A == B, A ==> B etc.
| Definitions | Type | Description |
|---|---|---|
| expression |
anyOf [
]
|
A definition used to easily compose all of the known AST in different parts of the schema.
anyOf Types.String
anyOf Types.Field
anyOf Types.PstateField
anyOf Types.RegisterType
anyOf Values.Value
anyOf Bool
anyOf Real
anyOf Integer
anyOf Set
anyOf Function
anyOf SquareOp
anyOf ArrayAccessOp
anyOf Concat
anyOf Tuple
anyOf DotAtom
anyOf Identifier
anyOf TypeAnnotation
anyOf UnaryOp
anyOf #
|
A BinaryOp composition (only valid when composing constraints) allows the following:
FEAT_A ==> FEAT_BFEAT_A <=> FEAT_B| Properties | Type | Description |
|---|---|---|
| _meta | Meta |
See
Meta
for more information.
|
| _type |
|
|
| left◊ |
The left-hand-side of the constraint.
See
definitions.expression
for more information.
|
|
| op◊ |
The operation to be performed between
|
|
| right◊ |
The right-hand-side of the constraint.
See
definitions.expression
for more information.
|
|
|
||
Examples
|
||
|
||
A BinaryOp composition (used for every other expression other than constraints) allows the following:
A || BA << 2B IN {1, 2, 3}| Properties | Type | Description |
|---|---|---|
| _meta | Meta |
See
Meta
for more information.
|
| _type |
|
|
| left◊ |
The left-hand-side of the expression
See
definitions.expression
for more information.
|
|
| op◊ |
The operation to be performed between
|
|
| right◊ |
The right-hand-side of the expression
See
definitions.expression
for more information.
|
|
|
||
Examples
|
||
|
||
{
"definitions": {
"expression": {
"info": [
"A definition used to easily compose all of the known $(AST.) in different parts of the schema."
],
"anyOf": [
{
"$ref": "../Types/String.json"
},
{
"$ref": "../Types/Field.json"
},
{
"$ref": "../Types/PstateField.json"
},
{
"$ref": "../Types/RegisterType.json"
},
{
"$ref": "../Types/RegisterMultiFields.json"
},
{
"$ref": "../Values/Value.json"
},
{
"$ref": "Bool.json"
},
{
"$ref": "Real.json"
},
{
"$ref": "Integer.json"
},
{
"$ref": "Set.json"
},
{
"$ref": "Function.json"
},
{
"$ref": "SquareOp.json"
},
{
"$ref": "ArrayAccessOp.json"
},
{
"$ref": "Concat.json"
},
{
"$ref": "Tuple.json"
},
{
"$ref": "DotAtom.json"
},
{
"$ref": "Identifier.json"
},
{
"$ref": "TypeAnnotation.json"
},
{
"$ref": "UnaryOp.json"
},
{
"$ref": "#"
}
]
}
},
"info": [
"A model representing binary operations such as `A == B`, `A ==> B` etc."
],
"oneOf": [
{
"info": [
"A BinaryOp composition (only valid when composing constraints) allows the following:",
[
" - `FEAT_A ==> FEAT_B`",
" - `FEAT_A <=> FEAT_B`"
]
],
"type": "object",
"additionalProperties": false,
"properties": {
"_meta": {
"$ref": "../Meta.json"
},
"_type": {
"enum": [
"AST.BinaryOp"
]
},
"left": {
"info": [
"The left-hand-side of the constraint."
],
"$ref": "#/definitions/expression"
},
"op": {
"info": [
[
"The operation to be performed between `left` and `right`. ",
"See $(Traits.HasConstraints) for more detail around the meaning of ",
"the enums listed below."
]
],
"enum": [
"==>",
"<=>"
]
},
"right": {
"info": [
"The right-hand-side of the constraint."
],
"$ref": "#/definitions/expression"
}
},
"examples": [
{
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Identifier",
"value": "FEAT_A"
},
"op": "==>",
"right": {
"_type": "AST.Identifier",
"value": "FEAT_B"
}
}
],
"required": [
"left",
"op",
"right"
]
},
{
"type": "object",
"info": [
"A BinaryOp composition (used for every other expression other than constraints) allows the following:",
[
" - `A || B`",
" - `A << 2`",
" - `B IN {1, 2, 3}`"
]
],
"additionalProperties": false,
"properties": {
"_meta": {
"$ref": "../Meta.json"
},
"_type": {
"enum": [
"AST.BinaryOp"
]
},
"left": {
"info": [
"The left-hand-side of the expression"
],
"$ref": "#/definitions/expression"
},
"op": {
"info": [
"The operation to be performed between `left` and `right`."
],
"enum": [
"||",
"&&",
"<=",
">=",
"==",
"!=",
"<",
">",
"<<",
">>",
"+",
"-",
"OR",
"XOR",
"AND",
"*",
"/",
"^",
"::",
"++",
"IN",
"MOD",
"DIV",
"DIVRM"
]
},
"right": {
"info": [
"The right-hand-side of the expression"
],
"$ref": "#/definitions/expression"
}
},
"examples": [
{
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Identifier",
"value": "A"
},
"op": "||",
"right": {
"_type": "AST.Identifier",
"value": "B"
}
},
{
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Identifier",
"value": "A"
},
"op": "<<",
"right": {
"_type": "AST.Integer",
"value": 2
}
},
{
"_type": "AST.BinaryOp",
"left": {
"_type": "AST.Identifier",
"value": "B"
},
"op": "IN",
"right": {
"_type": "AST.Set",
"values": [
{
"_type": "AST.Integer",
"value": 1
},
{
"_type": "AST.Integer",
"value": 2
},
{
"_type": "AST.Integer",
"value": 3
}
]
}
}
],
"required": [
"left",
"op",
"right"
]
}
],
"title": "BinaryOp",
"$schema": "http://json-schema.org/draft-04/schema#"
}