コード例 #1
0
ファイル: AggFinder.java プロジェクト: richwhitjr/optiq
 /**
  * Finds an aggregate.
  *
  * @param node Parse tree to search
  * @return First aggregate function in parse tree, or null if not found
  */
 public SqlNode findAgg(SqlNode node) {
   try {
     node.accept(this);
     return null;
   } catch (Util.FoundOne e) {
     Util.swallow(e, null);
     return (SqlNode) e.getNode();
   }
 }
コード例 #2
0
 /** Clones a SqlNode with a different position. */
 public SqlNode clone(SqlParserPos pos) {
   // REVIEW jvs 26-July-2006:  shouldn't pos be used here?  Or are
   // subclasses always supposed to override, in which case this
   // method should probably be abstract?
   try {
     return (SqlNode) super.clone();
   } catch (CloneNotSupportedException e) {
     throw Util.newInternal(e, "error while cloning " + this);
   }
 }
コード例 #3
0
 /**
  * Validates this node in an expression context.
  *
  * <p>Usually, this method does much the same as {@link #validate}, but a {@link SqlIdentifier}
  * can occur in expression and non-expression contexts.
  */
 public void validateExpr(SqlValidator validator, SqlValidatorScope scope) {
   validate(validator, scope);
   Util.discard(validator.deriveType(scope, this));
 }
コード例 #4
0
 /**
  * Creates a node.
  *
  * @param pos Parser position, must not be null.
  */
 SqlNode(SqlParserPos pos) {
   Util.pre(pos != null, "pos != null");
   this.pos = pos;
 }
 public String getSignatureTemplate(final int operandsCount) {
   Util.discard(operandsCount);
   return "{1} {0} {2} AND {3}";
 }