aboutsummaryrefslogtreecommitdiff
path: root/Calculator.java
diff options
context:
space:
mode:
Diffstat (limited to 'Calculator.java')
-rw-r--r--Calculator.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/Calculator.java b/Calculator.java
index 43804c3..7070c87 100644
--- a/Calculator.java
+++ b/Calculator.java
@@ -1,5 +1,6 @@
public class Calculator {
public static void main(String[] args) {
+ GFrame frame = new GFrame("Calculator");
String expr = "(84 / 4 * 3 - 9) * 2 + 1 / 5"; // 108.2
Parser p;
if (args.length == 0) {
@@ -7,8 +8,7 @@ public class Calculator {
} else {
p = new Parser(args[0]);
}
- String postfix = p.toPostFix();
- // System.out.println("pfix => \t " + postfix);
- System.out.println(p.evalExpr(postfix));
+ System.out.println("postfix => \t " + p.getPostfix());
+ System.out.println(p.eval());
}
}