01: package org.obe.sql;
02:
03: import java.io.IOException;
04: import java.io.Writer;
05:
06: /**
07: * @author Adrian Price
08: */
09: public class SQLCompareExprRight extends SimpleNode {
10: public SQLCompareExprRight(int id) {
11: super (id);
12: }
13:
14: public void write(Writer out) throws IOException {
15: children[0].write(out);
16: if (children.length == 2)
17: children[1].write(out);
18: }
19:
20: public Object execute(Object context, Object lhs) {
21: Object result;
22: switch (children.length) {
23: case 1:
24: result = children[0].execute(context, lhs);
25: break;
26: case 2:
27: Object rhs = children[1].execute(context);
28: result = children[0].execute(context, lhs, rhs);
29: break;
30: case 3:
31: // SQLCompareOp() SQLSumExpr() <JOINPLUS> SQLRightJoinClause()
32: default:
33: throw new UnsupportedOperationException(toString());
34: }
35: return result;
36: }
37: }
|