01: package org.obe.sql;
02:
03: /*
04: *
05: * Copyright (c) 2003 Adrian Price. All rights reserved.
06: */
07:
08: /**
09: *
10: *
11: * @author Adrian Price
12: */
13: public class SQLParserVisitorImpl implements SQLParserVisitor {
14: public SQLParserVisitorImpl() {
15: }
16:
17: public Object visit(SimpleNode node, Object data) {
18: System.out.println("visit(node=" + node + ", data=" + data
19: + ')');
20: switch (node.id) {
21: case SQLParserTreeConstants.JJTSQLCOLREF:
22: System.out.print("column: ");
23: node.dump("");
24: break;
25: case SQLParserTreeConstants.JJTSQLCOMPAREOP:
26: System.out.print("compareop: ");
27: node.dump("");
28: break;
29: case SQLParserTreeConstants.JJTSQLLITERAL:
30: System.out.print("literal: ");
31: node.dump("");
32: break;
33: }
34: node.childrenAccept(this, data);
35: return node;
36: }
37: }
|