From 24f3ce54983348e1aa0229d5c08b3fe99d739d40 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 18 Apr 2016 13:04:01 -0400 Subject: Added operation condensing --- .../bjc/dicelang/ast/nodes/OperatorDiceNode.java | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java') diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java index ab47b56..c0f7bd3 100644 --- a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java +++ b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/OperatorDiceNode.java @@ -14,29 +14,33 @@ public enum OperatorDiceNode implements IDiceASTNode { */ ADD(MATH), /** - * Represents assigning one node to another + * Represents dividing two nodes */ - ASSIGN(EXPRESSION), + DIVIDE(MATH), /** - * Representings combining two node values together + * Represents multiplying two nodes */ - COMPOUND(DICE), + MULTIPLY(MATH), /** - * Represents dividing two nodes + * Represents subtracting two nodes */ - DIVIDE(MATH), + SUBTRACT(MATH), + /** + * Representings combining two node values together + */ + COMPOUND(DICE), /** * Represents using one node a variable number of times */ GROUP(DICE), /** - * Represents multiplying two nodes + * Represents assigning one node to another */ - MULTIPLY(MATH), + ASSIGN(EXPRESSION), /** - * Represents subtracting two nodes + * Represents evaluating one expression in the context of another */ - SUBTRACT(MATH); + LET(EXPRESSION); /** * Represents the group of operator this operator is sorted into. @@ -73,6 +77,8 @@ public enum OperatorDiceNode implements IDiceASTNode { case "c": case "compound": return COMPOUND; + case "=>": + return LET; default: throw new IllegalArgumentException( s + " is not a valid operator node"); -- cgit v1.2.3