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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
|
syntax = "proto2";
message VarRef {
required int32 varnum = 1;
}
message ArrType {
repeated Const elements = 1;
}
message KVPair {
required string key = 1;
required string val = 2;
}
message HashType {
repeated KVPair keyval = 1;
}
message StringExtNoArg {
enum StrExtOp {
DUMP = 0;
STRIP = 1;
LSTRIP = 2;
RSTRIP = 3;
STRIPE = 4;
LSTRIPE = 5;
RSTRIPE = 6;
SWAPCASE = 7;
SWAPCASEE = 8;
SQUEEZE = 9;
}
required StrExtOp str_op = 1;
required string str_arg = 2;
}
message MathConst {
enum MathConstLit {
PI = 0;
E = 1;
}
required MathConstLit math_const = 1;
}
message Const {
oneof const_oneof {
uint32 int_lit = 1;
bool bool_val = 4;
}
}
message BinaryOp {
enum Op {
ADD = 0;
SUB = 1;
MUL = 2;
DIV = 3;
MOD = 4;
XOR = 5;
AND = 6;
OR = 7;
EQ = 8;
NE = 9;
LE = 10;
GE = 11;
LT = 12;
GT = 13;
RS = 14;
};
required Op op = 1;
required Rvalue left = 2;
required Rvalue right = 3;
}
message Rvalue {
oneof rvalue_oneof {
VarRef varref = 1;
Const cons = 2;
BinaryOp binop = 3;
}
}
message AssignmentStatement {
required Rvalue rvalue = 2;
}
message IfElse {
required Rvalue cond = 1;
required StatementSeq if_body = 2;
required StatementSeq else_body = 3;
}
//TODO: Add Switch statement
//message Switch {
// required Rvalue switch_var = 1;
// repeated Rvalue cond = 2;
//}
message Ternary {
required Rvalue tern_cond = 1;
required Rvalue t_branch = 2;
required Rvalue f_branch = 3;
}
message ObjectSpace {
enum OS_methods {
COUNT = 1;
}
required OS_methods os_func = 1;
required HashType os_arg = 2;
}
message Time {
enum T_methods {
AT = 1;
GM = 2;
}
required T_methods t_func = 1;
required uint32 t_arg = 2;
}
message Array {
enum Arr_methods {
FLATTEN = 1;
COMPACT = 2;
FETCH = 3;
FILL = 4;
ROTATE = 5;
ROTATE_E = 6;
DELETEIF = 7;
INSERT = 8;
BSEARCH = 9;
KEEPIF = 10;
SELECT = 11;
VALUES_AT = 12;
BLOCK = 13;
DIG = 14;
SLICE = 15;
PERM = 16;
COMB = 17;
ASSOC = 18;
RASSOC = 19;
}
required Arr_methods arr_func = 1;
required ArrType arr_arg = 2;
required Rvalue val_arg = 3;
}
message MathType {
oneof math_arg_oneof {
Rvalue math_rval = 2;
MathConst math_const = 3;
}
}
message MathOps {
enum Mops {
CBRT = 1;
COS = 2;
ERF = 3;
ERFC = 4;
LOG = 5;
LOG10 = 6;
LOG2 = 7;
SIN = 8;
SQRT = 9;
TAN = 10;
}
required Mops math_op = 1;
required MathType math_arg = 2;
}
message BuiltinFuncs {
oneof bifunc_oneof {
ObjectSpace os = 1;
Time time = 2;
Array arr = 3;
MathOps mops = 4;
}
}
message Statement {
oneof stmt_oneof {
AssignmentStatement assignment = 1;
IfElse ifelse = 2;
Ternary ternary_stmt = 3;
BuiltinFuncs builtins = 4;
StatementSeq blockstmt = 5;
}
}
message StatementSeq {
repeated Statement statements = 1;
}
message Function {
required StatementSeq statements = 1;
}
package ruby_fuzzer;
|