public final class SmvPrinterUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addWhitespace(java.lang.String string)
Adds two whitespaces to the end of the string.
|
static java.lang.String |
getClockAssignment(ru.ispras.fortress.expression.NodeVariable clock)
Generates clock assignment.
|
static java.lang.String |
getFormattedName(java.lang.String name) |
static java.lang.String |
getInputVarDeclareSection(java.util.Map<ru.ispras.fortress.expression.NodeVariable,VariableDeclaration> inputs,
SmvExprPrinter printer)
Generates a IVAR declaration section in SMV format from a collection of input variables.
|
static java.lang.String |
getModuleDeclaration(java.lang.String name)
Generates a module declaration in SMV format with empty parameter list.
|
static java.lang.String |
getModuleDeclaration(java.lang.String name,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputs)
Generates a module declaration in SMV format.
|
static java.lang.String |
getModuleInstantiation(java.lang.String instanceName,
java.lang.String moduleName,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> parameters)
Generates a module instantiation in SMV format.
|
static java.lang.String |
getName(ru.ispras.fortress.expression.NodeVariable variable)
Checks whether the variable name is acceptable by SMV syntax.
|
static java.lang.String |
getTypeConvertion(ru.ispras.fortress.data.DataTypeId sourceType,
ru.ispras.fortress.data.DataTypeId targetType)
Returns the type conversion string from the source type into the target type if possible.
|
static java.util.List<ru.ispras.fortress.expression.NodeVariable> |
getUsedVariables(ru.ispras.fortress.expression.Node node)
Returns the variables which are used in the specified
Node . |
static java.lang.String |
getVarDeclareSection(java.util.Map<ru.ispras.fortress.expression.NodeVariable,VariableDeclaration> variables,
SmvExprPrinter printer)
Generates a VAR declaration section in SMV format from a collection of variables.
|
static java.lang.String |
getVariableDeclaration(ru.ispras.fortress.expression.NodeVariable variable,
VariableDeclaration declaration,
SmvExprPrinter printer,
java.lang.String keyword)
Generates a variable declaration in SMV format.
|
static ru.ispras.fortress.expression.Node |
makeSubstitutions(ru.ispras.fortress.expression.Node node)
Performs the following substitutions on the specified Node:
Substitutes a power operation by an arithmetic left shift operation.
|
static java.lang.String |
removeWhitespace(java.lang.String string)
Removes two symbols from the end of the string.
|
static ru.ispras.fortress.expression.Node |
substitutePower(ru.ispras.fortress.expression.Node node)
Searches for power operations in the node and replaces them by arithmetic left shift operation.
|
public static java.lang.String getModuleDeclaration(java.lang.String name, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> inputs)
name
- - the specified module name.inputs
- - the specified collection of parameters.public static java.lang.String getModuleDeclaration(java.lang.String name)
name
- - the specified module name.public static java.lang.String getModuleInstantiation(java.lang.String instanceName, java.lang.String moduleName, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> parameters)
instanceName
- - the specified module instance name.moduleName
- - the specified module name.parameters
- - the specified collection of parameters.public static java.lang.String getName(ru.ispras.fortress.expression.NodeVariable variable)
variable
- - the specified variable.public static java.lang.String getInputVarDeclareSection(java.util.Map<ru.ispras.fortress.expression.NodeVariable,VariableDeclaration> inputs, SmvExprPrinter printer)
inputs
- - the input variable-declaration mapping.printer
- - the specified SmvExprPrinter
.public static java.lang.String getVarDeclareSection(java.util.Map<ru.ispras.fortress.expression.NodeVariable,VariableDeclaration> variables, SmvExprPrinter printer)
variables
- - the variable-declaration mappingprinter
- - the specified SmvExprPrinter
.public static java.lang.String getVariableDeclaration(ru.ispras.fortress.expression.NodeVariable variable, VariableDeclaration declaration, SmvExprPrinter printer, java.lang.String keyword)
variable
- - the specified variable.declaration
- - the variable declaration.printer
- - the specified SmvExprPrinter
.public static java.lang.String addWhitespace(java.lang.String string)
string
- - the specified string.public static java.lang.String removeWhitespace(java.lang.String string)
string
- - the specified string.public static ru.ispras.fortress.expression.Node substitutePower(ru.ispras.fortress.expression.Node node)
node
- - the specified Node
.public static ru.ispras.fortress.expression.Node makeSubstitutions(ru.ispras.fortress.expression.Node node)
node
- - the specified node.public static java.util.List<ru.ispras.fortress.expression.NodeVariable> getUsedVariables(ru.ispras.fortress.expression.Node node)
Node
.node
- - the specified node.NodeVariable
.public static java.lang.String getTypeConvertion(ru.ispras.fortress.data.DataTypeId sourceType, ru.ispras.fortress.data.DataTypeId targetType)
sourceType
- - the specified source type.targetType
- - the specified target type.public static java.lang.String getClockAssignment(ru.ispras.fortress.expression.NodeVariable clock)
clock
- - the specified clock variable.public static java.lang.String getFormattedName(java.lang.String name)