public final class RangedVariableUtils
extends java.lang.Object
RangedVariable
Modifier and Type | Method and Description |
---|---|
static ru.ispras.fortress.data.DataType |
getDataType(ru.ispras.castle.ast.RangedVariable rangedVariable)
Returns the data type of this object.
|
static ru.ispras.castle.ast.Range |
getRangeInvariant(ru.ispras.fortress.expression.Node left,
ru.ispras.fortress.expression.Node right,
boolean ascend)
Returns the invariant in range form.
|
static ru.ispras.fortress.expression.Node |
transformNodeWithRanged(ru.ispras.castle.ast.RangedVariable rangedVariable,
ru.ispras.fortress.expression.Node value)
Transforms the specified node with assistance of the specified ranged variable.
|
public static ru.ispras.fortress.expression.Node transformNodeWithRanged(ru.ispras.castle.ast.RangedVariable rangedVariable, ru.ispras.fortress.expression.Node value)
For example, we have a pair '(a[x], b)' where 'a[x]' is ranged variable and 'b'
is node. Such pair may come from Assignment
node constructor parameters
that should be transformed to (NodeVariable, Node) pair. This method transforms 'b'
expression in such way that the result can be assigned to RangedVariable's NodeVariable field
without any Range.
rangedVariable
- Ranged variable that is used in transformation.value
- Node to be transformed.public static ru.ispras.fortress.data.DataType getDataType(ru.ispras.castle.ast.RangedVariable rangedVariable)
rangedVariable
- Variable that type is calculated.public static ru.ispras.castle.ast.Range getRangeInvariant(ru.ispras.fortress.expression.Node left, ru.ispras.fortress.expression.Node right, boolean ascend)
left
- The first border of the range invariant.right
- The second border of the ranged invariant.ascend
- Flag that shows whether second border is greater than the first one.