public class Rel extends Node {

	public Node left, right;
	public int op;

	public Rel(int op, Node left, Node right) {
		this.op = op;
		this.left = left;
		this.right = right;
	}

	@Override
	public Value interp(Scope s) {
		Value lv = left.interp(s);
		Value rv = right.interp(s);

		if (lv instanceof StringValue && rv instanceof StringValue) {
			String l = ((StringValue) lv).value;
			String r = ((StringValue) rv).value;
			return new BoolValue(op(l.compareTo(r), 0));
		}
		if (lv instanceof IntValue && rv instanceof IntValue) {
			int l = ((IntValue) lv).value;
			int r = ((IntValue) rv).value;
			return new BoolValue(op(l, r));
		}
		if (lv instanceof FloatValue && rv instanceof FloatValue) {
			int l = (int) ((FloatValue) lv).value;
			int r = (int) ((FloatValue) rv).value;
			return new BoolValue(op(l, r));
		}
		return Value.FALSE;
	}

	private boolean op(int l, int r) {
		boolean ret = false;
		switch (op) {
		case '>':
			ret = l > r;
			break;
		case '<':
			ret = l < r;
			break;
		case Tag.EQ:
			ret = l == r;
			break;
		case Tag.NE:
			ret = l != r;
			break;
		case Tag.LE:
			ret = l <= r;
			break;
		case Tag.GE:
			ret = l >= r;
			break;
		}
		return ret;
	}

	@Override
	public Value typecheck(Scope s) {
		Value lv = left.interp(s);
		Value rv = right.interp(s);
		if ((lv instanceof FloatValue && rv instanceof FloatValue)
				|| (lv instanceof IntValue && rv instanceof IntValue)
				|| (lv instanceof StringValue && lv instanceof StringValue))
			return Type.BOOL;
		S.error("Type math error!");
		return null;
	}
}

@@ -1170,16 +1170,63 @@
 %09break;%0A
+%09%09default:%0A%09%09%09S.error(%22%E4%B8%8D%E6%94%AF%E6%8C%81%E6%93%8D%E4%BD%9C%E7%AC%A6: %22 + (char) op);%0A
 %09%09%7D%0A%09%09re
@@ -1593,12 +1593,17 @@
 urn 
-null
+Value.ANY
 ;%0A%09%7D

improve typechek and interp