KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > xquery > parser > util > Constants


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23
24 package org.xquark.xquery.parser.util;
25
26
27 public interface Constants {
28
29
30     
31     public final static int NOTHING = -1;
32     
33     /**
34      * These constants represent the
35      * different <code>AxisSpecifier</code>
36      * in <i>XPath</i>.
37      */

38     
39     // separators
40
public final static String JavaDoc[] SEPARATORSTRINGS = {
41         "/",
42 // "//",
43
};
44     
45     public final static int CHILD_SEPARATOR = 0;
46     // public final static int DESCENDANT_SELF_SEPARATOR = 1;
47

48     public final static int MAX_SEPARATOR = 0;
49     
50     /**
51      * These constants represent the
52      * quantifiers used in <i>Xpath</i>
53      * expressions.
54      */

55     public final static String JavaDoc[] QUANTIFIERSSTRINGS = {
56         "some",
57         "every"
58     };
59     
60     public final static int SOME_QUANTIFIER = 0;
61     public final static int EVERY_QUANTIFIER = 1;
62     
63     public final static int MAX_QUANTIFIER = 1;
64     
65     
66     /**
67      * These constants represent the
68      * comparison operators used in
69      * <i>Quilt</i>.
70      */

71     public final static String JavaDoc[] COMPOPSSTRINGS = {
72         "=",
73         ">",
74         ">=",
75         "<=",
76         "<",
77         "!=",
78
79         "eq",
80         "gt",
81         "ge",
82         "le",
83         "lt",
84         "ne",
85
86         "is",
87         "<<",
88         ">>"
89     };
90     
91     public final static int EQ_COMPOP = 0;
92     public final static int GT_COMPOP = 1;
93     public final static int GEQ_COMPOP = 2;
94     public final static int LEQ_COMPOP = 3;
95     public final static int LT_COMPOP = 4;
96     public final static int NEQ_COMPOP = 5;
97     // danger keep same order as above!!!
98
public final static int EQ_VALUECOMP = 6;
99     public final static int GT_VALUECOMP = 7;
100     public final static int GE_VALUECOMP = 8;
101     public final static int LE_VALUECOMP = 9;
102     public final static int LT_VALUECOMP = 10;
103     public final static int NE_VALUECOMP = 11;
104
105     public final static int IS_NODECOMP = 12;
106     public final static int LEAST_NODECOMP = 13;
107     public final static int GREATEST_NODECOMP = 14;
108        
109     public final static int MAX_COMPOP = 14;
110     
111 // /**
112
// * The entry in this array gives the
113
// * key of the reverse comparison
114
// * operator in the array <code>COMPOPS</code>.
115
// */
116
// public final static int[] COMPOPS_REVERSE = {
117
// 1,
118
// 0,
119
// 3,
120
// 2,
121
// 4,
122
// 5,
123
// };
124

125     /**
126      * These constants represent the
127      * binary operators on node-lists
128      * used in <i>Quilt</i>.
129      */

130     
131     public final static String JavaDoc[] NODELISTOPERATORSSTRINGS = {
132         " | ",
133         " union ",
134         " after ",
135         " before ",
136         " except ",
137         " or ",
138         " and ",
139         " intersect "
140     };
141     
142     public final static int UNION_NODELISTOPERATOR = 0;
143     public final static int INTER_NODELISTOPERATOR = 1;
144     public final static int AFTER_NODELISTOPERATOR = 2;
145     public final static int BEFORE_NODELISTOPERATOR = 3;
146     public final static int EXCEPT_NODELISTOPERATOR = 4;
147     public final static int OR_NODELISTOPERATOR = 5;
148     public final static int AND_NODELISTOPERATOR = 6;
149     public final static int INTERSECT_NODELISTOPERATOR = 7;
150     
151     public final static int MAX_NODELISTOPERATOR = 7;
152     
153     /**
154      * These constants refer to the
155      * different types of basic
156      * <i>Quilt</i> values used in our
157      * evaluation semantics.
158      */

159     
160     // arithmetic operations
161

162     public final static String JavaDoc[] ARITHMETICSSTRINGS = {
163         "+",
164         "-",
165         "*",
166         "/",
167         "mod",
168         "idiv"
169     };
170     
171     public final static int PLUS_ARITHMETICS = 0;
172     public final static int MINUS_ARITHMETICS = 1;
173     public final static int MULTIPLY_ARITHMETICS = 2;
174     public final static int DIVIDE_ARITHMETICS = 3;
175     public final static int MODULO_ARITHMETICS = 4;
176     public final static int INTEGER_DIVIDE_ARITHMETICS = 5;
177     
178     public final static int MAX_ARITHMETICS = 5;
179     
180     // typing operations
181

182     public final static String JavaDoc[] TYPINGSTRINGS = {
183         "cast",
184         "treat",
185     };
186     
187     public final static int CAST_TYPING = 0;
188     public final static int TREAT_TYPING = 1;
189     
190     public final static int MAX_TYPING = 1;
191     
192     // order operations
193
public final static String JavaDoc[] ORDERSSTRINGS = {
194         "ascending",
195         "descending",
196         "greatest",
197         "least",
198         "place_order"
199     };
200     
201     public final static int ASCENDING_ORDER = 0;
202     public final static int DESCENDING_ORDER = 1;
203     public final static int GREATEST_ORDER = 2;
204     public final static int LEAST_ORDER = 3;
205     public final static int PLACE_ORDER = 4;
206     
207     public final static int MAX_ORDER = 4;
208     
209     // binding type
210
public final static int LET_BINDINGTYPE = 0;
211     public final static int FOR_BINDINGTYPE = 1;
212     public final static int QUANTIFIER_BINDINGTYPE = 2;
213     public final static int FUNCTION_BINDINGTYPE = 3;
214     public final static int OUTERFOR_BINDINGTYPE = 4;
215     public final static int TYPESWITCH_BINDINGTYPE = 5;
216     public final static int OUTERLET_BINDINGTYPE = 6;
217     public final static int POSITION_BINDINGTYPE = 7;
218     public final static int DECLARATION_BINDINGTYPE = 8;
219     public final static int PARAMETER_BINDINGTYPE = 9;
220     
221     public final static int MAX_BINDINGTYPE = 9;
222     
223     // declaration type
224
public final static int NAMESPACE_DECL = 0;
225     public final static int SCHEMA_DECL = 1;
226     
227     public final static int MAX_DECL = 1;
228     
229     // WRAPPER SQL STUFF
230

231     // Boolean Operators
232
public final static int AND = 0;
233     public final static int OR = 1;
234     public final static int NOT = 2;
235     public final static String JavaDoc[] BOOLEAN_OPERATORS = {
236         "and",
237         "or",
238         "not"
239     };
240     // Aggregation functions
241
public final static int AVG = 0;
242     public final static int COUNT = 1;
243     public final static int MAX = 2;
244     public final static int MIN = 3;
245     public final static int SUM = 4;
246     public final static String JavaDoc[] AGGREGATEOPS = {
247         "avg",
248         "count",
249         "max",
250         "min",
251         "sum"
252     } ;
253     
254     // Occurrence Indicator
255
public final static String JavaDoc[] OCCURRENCE_INDICATORS = {
256         "*",
257         "+",
258         "?"
259     };
260     public final static int OCCURRENCE_STAR = 0;
261     public final static int OCCURRENCE_PLUS = 1;
262     public final static int OCCURRENCE_QUESTION_MARK = 2;
263     public final static int MAX_OCCURRENCE_INDICATORS = 3;
264     
265     
266     // Validation
267
public final static String JavaDoc[] VALIDATIONSTRINGS = {
268         "lax",
269         "strict",
270         "skip"
271     };
272     public final static int VALIDATION_LAX = 0;
273     public final static int VALIDATION_STRICT = 1;
274     public final static int VALIDATION_SKIP = 2;
275     public final static int VALIDATION_PRESERVE = 3;
276
277     public final static String JavaDoc[] SCOPE_STRINGS = {
278         "global",
279         "context"
280     };
281     public final static int SCOPE_GLOBAL = 0;
282     public final static int SCOPE_CONTEXT = 1;
283
284     // xmlspace
285
public final static String JavaDoc[] XMLSPACESTRINGS = {
286         "preserve",
287         "strip"
288     };
289     public final static int XMLSPACE_PRESERVE = 0;
290     public final static int XMLSPACE_STRIP = 1;
291     
292     // schema context path
293
public final static int NOAXIS = 0;
294     public final static int WITHAXIS = 1;
295     public final static int WITHATTAXIS = 2;
296     public final static int WITHTYPE = 3;
297 }
298
299
300
301
302
303
304
305
306
Popular Tags