-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPostfixTest.java
executable file
·46 lines (41 loc) · 1.54 KB
/
PostfixTest.java
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
package jstest.prefix;
import base.Selector;
import jstest.expression.Dialect;
import static jstest.expression.Operations.*;
/**
* @author Georgiy Korneev ([email protected])
*/
public final class PostfixTest {
public static final Selector SELECTOR = Kind.selector(
PostfixTest.class,
"postfix", "parsePostfix", new Dialect("%s", "%s", "({args} {op})", " "),
"Empty input", "",
"Unknown variable", "a",
"Invalid number", "-a",
"Missing )", "(z (x y +) *",
"Missing (", "z (x y +) *)",
"Unknown operation", "( x y @@)",
"Excessive info", "(x y +) x",
"Empty op", "()",
"Invalid unary (0 args)", "(negate)",
"Invalid unary (2 args)", "(x y negate)",
"Invalid binary (0 args)", "(+)",
"Invalid binary (1 args)", "(x +)",
"Invalid binary (3 args)", "(x y z +)",
"Variable op (0 args)", "(x)",
"Variable op (1 args)", "(1 x)",
"Variable op (2 args)", "(1 2 x)",
"Const op (0 args)", "(0)",
"Const op (1 args)", "(0 1)",
"Const op (2 args)", "(0 1 2)")
.variant("Base")
.variant("MeanVar", MEAN, VAR)
.variant("SumexpSoftmax", SUMEXP, SOFTMAX)
.selector();
private PostfixTest() {
}
public static void main(final String... args) {
// ParserTest.myBase.main(args);
SELECTOR.main(args);
}
}