File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -375,11 +375,11 @@ public class EvalVisitor implements ExprVisitor {
375375
376376 public void visit (NumExpr e ) { erg. push(e. getValue()); }
377377 public void visit (MulExpr e ) {
378- e. getE1(). accept(this ); e. getE1 (). accept(this );
378+ e. getE1(). accept(this ); e. getE2 (). accept(this );
379379 erg. push(erg. pop() * erg. pop());
380380 }
381381 public void visit (AddExpr e ) {
382- e. getE1(). accept(this ); e. getE1 (). accept(this );
382+ e. getE1(). accept(this ); e. getE2 (). accept(this );
383383 erg. push(erg. pop() + erg. pop());
384384 }
385385 public int getResult () { return erg. peek(); }
@@ -390,11 +390,11 @@ public class PrintVisitor implements ExprVisitor {
390390
391391 public void visit (NumExpr e ) { erg. push(" NumExpr(" + e. getValue() + " )" ); }
392392 public void visit (MulExpr e ) {
393- e. getE1(). accept(this ); e. getE1 (). accept(this );
393+ e. getE1(). accept(this ); e. getE2 (). accept(this );
394394 erg. push(" MulExpr(" + erg. pop() + " , " + erg. pop() + " )" );
395395 }
396396 public void visit (AddExpr e ) {
397- e. getE1(). accept(this ); e. getE1 (). accept(this );
397+ e. getE1(). accept(this ); e. getE2 (). accept(this );
398398 erg. push(" AddExpr(" + erg. pop() + " , " + erg. pop() + " )" );
399399 }
400400 public String getResult () { return erg. peek(); }
You can’t perform that action at this time.
0 commit comments