Random Data
As a utility to code synthesis we have the random data component. This has two functions:
getType
getValue
This is used to randomly generate variables for synthesised code. Some times we want to declare a variable and a random choice of type is needed. The function takes no input and returns the character list of the type such as “bool”, “int” or “char”. When we declare a variable or for limits in control structures we need values for the variables. These are randomly generated with in the following ranges.
Type |
Range |
---|---|
int |
0-1000 |
dec |
0.0-1.0 |
bool |
0/1 |
char |
a-z |