This repository was archived by the owner on Nov 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathProgramOptions.xml
More file actions
141 lines (138 loc) · 7.39 KB
/
ProgramOptions.xml
File metadata and controls
141 lines (138 loc) · 7.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="utf-8" ?>
<ProgramOptions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
PROBABILITY TABLES. Each table contains a list of types and their weights.
Types from the table are selected randomly proportionally to their weight.
-->
<AssignmentOperators>
<item type="Basic" weight="6" /> <!-- OPERATOR = -->
<item type="Add" weight="4" /> <!-- OPERATOR += -->
<item type="Sub" weight="1" /> <!-- OPERATOR -= -->
<item type="Mul" weight="1" /> <!-- OPERATOR *= -->
<item type="Div" weight="1" /> <!-- OPERATOR /= -->
<item type="Mod" weight="1" /> <!-- OPERATOR %= -->
<item type="PreInc" weight="2" /> <!-- OPERATOR ++ (prefix) -->
<item type="PostDec" weight="2" /> <!-- OPERATOR ‐‐ (postfix) -->
<item type="PreDec" weight="2" /> <!-- OPERATOR ‐‐ (prefix) -->
<item type="PostInc" weight="2" /> <!-- OPERATOR ++ (postfix) -->
</AssignmentOperators>
<UnaryOperators>
<item type="Plus" weight="1" /> <!-- OPERATOR + (unary) -->
<item type="Typeof" weight="2" /> <!-- OPERATOR typeof -->
<item type="Minus" weight="1" /> <!-- OPERATOR - (unary) -->
<item type="Not" weight="1" /> <!-- OPERATOR ! -->
<item type="Sqrt" weight="3" /> <!-- FUNCTION Math.sqrt -->
<item type="Exp" weight="0" /> <!-- FUNCTION Math.exp -->
<item type="Log" weight="0" /> <!-- FUNCTION Math.log -->
<item type="Sin" weight="0" /> <!-- FUNCTION Math.sin -->
<item type="Cos" weight="0" /> <!-- FUNCTION Math.cos -->
<item type="Atan" weight="0" /> <!-- FUNCTION Math.atan -->
<item type="Floor" weight="1" /> <!-- FUNCTION Math.floor -->
<item type="Ceil" weight="1" /> <!-- FUNCTION Math.ceil -->
<item type="Abs" weight="1" /> <!-- FUNCTION Math.abs -->
<item type="Trunc" weight="1" /> <!-- FUNCTION Math.trunc -->
<item type="Cbrt" weight="0" /> <!-- FUNCTION Math.cbrt -->
</UnaryOperators>
<BinaryOperators>
<item type="Add" weight="8" /> <!-- OPERATOR + -->
<item type="Comma" weight="1" /> <!-- OPERATOR , -->
<item type="Sub" weight="2" /> <!-- OPERATOR - -->
<item type="Mul" weight="2" /> <!-- OPERATOR * -->
<item type="Div" weight="2" /> <!-- OPERATOR / -->
<item type="Mod" weight="2" /> <!-- OPERATOR % -->
<item type="Less" weight="2" /> <!-- OPERATOR < -->
<item type="Greater" weight="2" /> <!-- OPERATOR > -->
<item type="Equal" weight="2" /> <!-- OPERATOR == -->
<item type="NotEqual" weight="2" /> <!-- OPERATOR != -->
<item type="Min" weight="1" /> <!-- FUNCTION Math.min -->
<item type="Max" weight="1" /> <!-- FUNCTION Math.max -->
<item type="BitAnd" weight="1" /> <!-- OPERATOR & -->
<item type="BitOr" weight="1" /> <!-- OPERATOR | -->
<item type="Xor" weight="1" /> <!-- OPERATOR ^ -->
</BinaryOperators>
<Literals>
<item type="String" weight="2" />
<item type="Numeric" weight="4" />
<item type="Object" weight="2" />
</Literals>
<NumericLiterals>
<item type="Boolean" weight="3" />
<item type="DecimalInteger" weight="3" />
<item type="BinaryInteger" weight="1" />
<item type="OctalInteger" weight="3" />
<item type="SmallInteger" weight="3" />
<item type="HexInteger" weight="3" />
<item type="FixedFloat" weight="3" />
<item type="ExpFloat" weight="3" />
</NumericLiterals>
<Expressions>
<item type="AssignmentExpression" weight="4" />
<item type="BinaryExpression" weight="5" />
<item type="FunctionExpression" weight="6" />
<item type="Literal" weight="2" />
<item type="TernaryExpression" weight="1" />
<item type="UnaryExpression" weight="2" />
<item type="VariableInvocationExpression" weight="3" />
<item type="FunctionInvocationExpression" weight="1" />
<item type="VariableExpression" weight="2" />
<item type="EvalExpression" weight="2" />
<item type="ObjectSetExpression" weight="1" />
<item type="ObjectConstructorExpression" weight="1" />
</Expressions>
<Statements>
<item type="ReturnStatement" weight="2" />
<item type="BreakStatement" weight="1" />
<item type="AssignmentStatement" weight="9" />
<item type="IfElseStatement" weight="8" />
<item type="ForLoopStatement" weight="2" />
<item type="BlockStatement" weight="6" />
<item type="VariableInvocationStatement" weight="4" />
<item type="ObjectSetStatement" weight="2" />
<item type="ThrowStatement" weight="1" />
</Statements>
<AssignmentInForLoop>
<item type="Add" weight="3" /> <!-- for(expr; expr; var += expr) -->
<item type="Sub" weight="3" /> <!-- for(expr; expr; var -= expr) -->
<item type="Mul" weight="3" /> <!-- for(expr; expr; var *= expr) -->
<item type="Div" weight="3" /> <!-- for(expr; expr; var /= expr) -->
<item type="PostInc" weight="2" /> <!-- for(expr; expr; var++) -->
<item type="PostDec" weight="2" /> <!-- for(expr; expr; var‐‐) -->
</AssignmentInForLoop>
<!--
RANGES. Expects two integers separated by a dash.
First integer is the minimum (inclusive) and the second is the maximum (inclusive).
The value of the associated parameter is generated from the specified range at random for every program.
-->
<GlobalVariablesCountRange>12-12</GlobalVariablesCountRange>
<LocalVariablesCountRange>0-3</LocalVariablesCountRange>
<BlockStatementsRange>2-4</BlockStatementsRange>
<FunctionStatementsRange>5-7</FunctionStatementsRange>
<FunctionParametersCountRange>1-3</FunctionParametersCountRange>
<StringLiteralLengthRange>0-10</StringLiteralLengthRange>
<MaxCallDepthRange>3-3</MaxCallDepthRange>
<MaxLoopCyclesRange>1000-2000</MaxLoopCyclesRange>
<MaxStringLengthRange>35-50</MaxStringLengthRange>
<MathPrecisionRange>10-14</MathPrecisionRange> <!-- Functions with inexact results (such as Math.exp or Math.sqrt) are rounded to MathPrecision significant digits. -->
<ObjectLiteralSizeRange>0-4</ObjectLiteralSizeRange>
<EvalStringLength>10-10</EvalStringLength>
<!--
SCALAR OPTIONS.
-->
<ObjectSetPropertyCount>4</ObjectSetPropertyCount>
<VariableInitializerDepth>1</VariableInitializerDepth>
<MaxFunctionDepth>1</MaxFunctionDepth>
<MaxObjectLiteralDepth>1</MaxObjectLiteralDepth>
<EnableCallDepthProtection>true</EnableCallDepthProtection>
<EnableLoopCyclesProtection>true</EnableLoopCyclesProtection>
<MaxExpressionDepth>3</MaxExpressionDepth>
<MaxStatementDepth>2</MaxStatementDepth>
<ConstVariableChance>0.1</ConstVariableChance>
<ElseChance>0.5</ElseChance> <!-- if(expr) stmt; else stmt; instead of if(expr) stmt; -->
<FunctionsAreConstants>true</FunctionsAreConstants> <!-- Determines whether a function variable can be assigned to. -->
<VariableSelectorScopeFactor>2</VariableSelectorScopeFactor> <!-- Variables from the enclosing function scope are selected preferentially with this factor. 0 disables this function. -->
<ForLoopVariableBoundsChance>0.35</ForLoopVariableBoundsChance> <!-- for(expr; var1 < var2; expr) instead of for(expr; var1 < literal; expr) -->
<AllowFunctionInvocationInLoop>false</AllowFunctionInvocationInLoop>
<FunctionValueOfOverride>true</FunctionValueOfOverride>
<CatchChance>0.4</CatchChance>
<ObjectLiteralVariableChance>0.5</ObjectLiteralVariableChance>
</ProgramOptions>