1 /*
2 * Copyright 2015-2018 HuntLabs.cn
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */16 modulehunt.sql.visitor.SQLEvalVisitor;
17 18 importhunt.collection;
19 20 importhunt.sql.visitor.functions.Function;
21 importhunt.sql.visitor.SQLASTVisitor;
22 23 importstd.concurrency : initOnce;
24 25 interfaceSQLEvalVisitor : SQLASTVisitor {
26 27 enumstringEVAL_VALUE = "eval.value";
28 enumstringEVAL_EXPR = "eval.expr";
29 30 staticObjectEVAL_ERROR() {
31 __gsharedObjectinst;
32 returninitOnce!inst(newObject());
33 }
34 35 staticObjectEVAL_VALUE_COUNT() {
36 __gsharedObjectinst;
37 returninitOnce!inst(newObject());
38 }
39 40 staticObjectEVAL_VALUE_NULL() {
41 __gsharedObjectinst;
42 returninitOnce!inst(newObject());
43 }
44 45 FunctiongetFunction(stringfuncName);
46 47 voidregisterFunction(stringfuncName, Functionfunction_p);
48 49 voidunregisterFunction(stringfuncName);
50 51 List!(Object) getParameters();
52 53 voidsetParameters(List!(Object) parameters);
54 55 intincrementAndGetVariantIndex();
56 57 boolisMarkVariantIndex();
58 59 voidsetMarkVariantIndex(boolmarkVariantIndex);
60 }