This code uses a visitor to evaluate simple expressions. Each file is linked below; the full collection is available as visitor-example.zip
visitor-example.zip
Classes used to represent expressions:
Exp.java
BinaryExp.java
DivideExp.java
Identifier.java
IntegerLiteral.java
MinusExp.java
PlusExp.java
TimesExp.java
ExpVisitor.java
Evaluator.java