Adding support for sum expressions.
[repair.git] / Repair / RepairCompiler / MCC / TDL.cup
index 92704f68ad41d213e9fa40b4d8cd7b604031cadb..c905958facbef2b5e6538b65a9098587e489728d 100755 (executable)
@@ -120,6 +120,7 @@ parser code {:
     terminal SUB; 
     terminal MULT; 
     terminal DIV;
+    terminal SUM;
 
     terminal NOT;
     terminal LT;
@@ -543,6 +544,12 @@ literal ::=
        debugMessage(PRODSTRING);
        RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("decimal").addChild(dec).getRoot();
        :}
+
+       | SUB DECIMAL:dec
+       {:
+       debugMessage(PRODSTRING);
+       RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("decimal").addChild("-"+dec).getRoot();
+       :}
         
        | STRING:str
        {: