public final class TransformerUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static ru.ispras.fortress.expression.Node |
standardize(ru.ispras.fortress.expression.Node node)
Replace operations in expression with standard counterparts.
|
static ru.ispras.fortress.expression.Node |
standardize(ru.ispras.fortress.expression.Node node,
boolean reduce)
Replace operations in expression with standard counterparts.
|
static ru.ispras.fortress.expression.Node |
substitute(ru.ispras.fortress.expression.Node expression,
java.lang.String name,
ru.ispras.fortress.expression.Node term)
Substitutes the given term for variables with the specified name at the specified expression
and simplifies the result.
|
static ru.ispras.fortress.expression.Node |
toInt(ru.ispras.fortress.expression.Node node)
Reduces the specified expression and tries to convert it to integer data type.
|
public static ru.ispras.fortress.expression.Node standardize(ru.ispras.fortress.expression.Node node)
Wrapping method for Transformer.standardize
method.
Uses it's internal rules for additional replacements.
node
- Expression to be transformed.Transformer
public static ru.ispras.fortress.expression.Node standardize(ru.ispras.fortress.expression.Node node, boolean reduce)
Wrapping method for Transformer.standardize
method.
Uses it's internal rules for additional replacements.
node
- Expression to be transformed.reduce
- enables\disables reduction techniques.true
, the method applies Transformer.standardize
method;
it doesn't use it otherwise.Transformer
public static ru.ispras.fortress.expression.Node toInt(ru.ispras.fortress.expression.Node node)
It is recommended to use this method for non-variable-dependent expressions containing constants and operators.
node
- Expression to be simplified and converted.public static ru.ispras.fortress.expression.Node substitute(ru.ispras.fortress.expression.Node expression, java.lang.String name, ru.ispras.fortress.expression.Node term)
expression
- The expression in which substitution and simplification take place.name
- The name of variable to be substituted.term
- The term to which variables with the specified name should be substituted by.