diff options
| author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-04-23 00:24:42 -0600 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-04-23 00:24:42 -0600 |
| commit | a1c15f046183373baf5deb66e77188e656806fb7 (patch) | |
| tree | fc1a7f584e67dc583d335f09d5271a45ff7d9df4 /submit/ast/BinaryOperatorType.java | |
| parent | 5f28f80c4e25a56cd444914c2f0b3da5e7fdb088 (diff) | |
| download | cminus-main.tar.gz cminus-main.zip | |
Diffstat (limited to 'submit/ast/BinaryOperatorType.java')
| -rw-r--r-- | submit/ast/BinaryOperatorType.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/submit/ast/BinaryOperatorType.java b/submit/ast/BinaryOperatorType.java index 37235c8..fea3d6e 100644 --- a/submit/ast/BinaryOperatorType.java +++ b/submit/ast/BinaryOperatorType.java @@ -10,15 +10,23 @@ package submit.ast; */ public enum BinaryOperatorType { - OR("||"), AND("&&"), - LE("<="), LT("<"), GT(">"), GE(">="), EQ("=="), NE("!="), - PLUS("+"), MINUS("-"), TIMES("*"), DIVIDE("/"), MOD("%"); + OR("||"), + AND("&&"), + LE("<="), + LT("<"), + GT(">"), + GE(">="), + EQ("=="), + NE("!="), + PLUS("+"), + MINUS("-"), + TIMES("*"), + DIVIDE("/"), + MOD("%"); private final String value; - private BinaryOperatorType(String value) { - this.value = value; - } + private BinaryOperatorType(String value) { this.value = value; } public static BinaryOperatorType fromString(String s) { for (BinaryOperatorType at : BinaryOperatorType.values()) { @@ -26,12 +34,12 @@ public enum BinaryOperatorType { return at; } } - throw new RuntimeException("Illegal string in OperatorType.fromString(): " + s); + throw new RuntimeException("Illegal string in OperatorType.fromString(): " + + s); } @Override public String toString() { return value; } - } |
