package hiro.yoshioka.ast.sql.oracle.util;

import hiro.yoshioka.ast.sql.oracle.SimpleNode;
import hiro.yoshioka.ast.sql.oracle.Token;

public class SpecialTokenCollectorVisitor extends DefaultSQLNodeVisitor {
	StringBuilder _buf = new StringBuilder();

	public Object doJob(SimpleNode node, Object data) {
		_buf.append(((Token) node.getFirstToken()).getSpecialTokensImage());
		SimpleNode n;
		for (int ord = 0; ord < node.jjtGetNumChildren(); ord++) {
			n = (SimpleNode) node.jjtGetChild(ord);
			n.jjtAccept(this, data);
		}
		return _buf.toString();
	}

}
