1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com
.google
.appengine
.api
.search
.query
;
5 import org
.antlr
.runtime
.tree
.Tree
;
8 * Defines an interface of the visitor invoked by the walker.
10 * @param <T> the type of the context object accompanying visited tree nodes.
13 public interface QueryTreeVisitor
<T
extends QueryTreeContext
<T
>> {
16 * Visits a node that represents a sequence of expressions.
18 void visitSequence(Tree node
, T context
);
21 * Visits a node that represents a conjunction (logical and) of conditions.
23 void visitConjunction(Tree node
, T context
);
26 * Visits a node that represents a disjunction (logical or) of conditions.
28 void visitDisjunction(Tree node
, T context
);
31 * Visits a node that represents a negation of conditions.
33 void visitNegation(Tree node
, T context
);
36 * Visits a node that represents a text field that is subject to query rewrite.
38 void visitFuzzy(Tree node
, T context
);
41 * Visits a node that represents a text field that must not be altered.
43 void visitLiteral(Tree node
, T context
);
46 * Visits a node that represents that a field value must be less than some
49 void visitLessThan(Tree node
, T context
);
52 * Visits a node that represents that a field value must be less than or
53 * equal to some specified value.
55 void visitLessOrEqual(Tree node
, T context
);
58 * Visits a node that represents that a field value must be greater than some
61 void visitGreaterThan(Tree node
, T context
);
64 * Visits a node that represents an inequality between a field and value.
66 void visitGreaterOrEqual(Tree node
, T context
);
69 * Visits a node that represents that a field value must be greater than
70 * or equal to some specified value.
72 void visitEqual(Tree node
, T context
);
75 * Visits a node that represents that a field must contain a value.
77 void visitContains(Tree node
, T context
);
80 * Visits a node that represents a constant value.
82 void visitValue(Tree node
, T context
);
85 * Visits a node that represents a function computed on some arguments.
87 void visitFunction(Tree node
, T context
);
90 * Visits a node that represents a global field.
92 void visitGlobal(Tree node
, T context
);
95 * Catch-all method for future type of query nodes.
97 void visitOther(Tree node
, T context
);