aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/couscous/ast/Operator.java
blob: 2a6ebfa51140c96101cbddff0b054990afd99145 (plain)
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
package org.zwobble.couscous.ast;

public enum Operator {
    BOOLEAN_AND("&&", true),
    BOOLEAN_OR("||", true),
    BOOLEAN_NOT("!", true),

    ADD("+", false),
    SUBTRACT("-", false),
    MULTIPLY("*", false),
    DIVIDE("/", false),
    MOD("%", false),

    EQUALS("==", true),
    NOT_EQUALS("!=", true),
    GREATER_THAN(">", true),
    GREATER_THAN_OR_EQUAL(">=", true),
    LESS_THAN("<", true),
    LESS_THAN_OR_EQUAL("<=", true);

    private final String symbol;
    private final boolean isBoolean;

    Operator(String symbol, boolean isBoolean) {
        this.symbol = symbol;
        this.isBoolean = isBoolean;
    }

    public String getSymbol() {
        return symbol;
    }

    public boolean isBoolean() {
        return isBoolean;
    }
}