001package visitor.typecase;
002import enumeration.Op;
003
004public interface Expr { }
005
006class Const implements Expr {
007        public final int c;
008        public Const(int c) {
009                this.c = c;
010        }
011}
012
013class BinOp implements Expr {
014        public final Expr l;
015        public final Expr r;
016        public final Op op;
017
018        public BinOp(Expr l, Op op, Expr r) {
019                if ((l == null) || (op == null) || (r == null)) {
020                        throw new IllegalArgumentException();
021                }
022                this.op = op;
023                this.l = l;
024                this.r = r;
025        }
026}