SourceForge.net Logo
VariableTypeStore.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2001, 2008,
3 * DecisionSoft Limited. All rights reserved.
4 * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved.
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef _VARIABLETYPESTORE_HPP
21#define _VARIABLETYPESTORE_HPP
22
23#include <xqilla/framework/XQillaExport.hpp>
24#include <xercesc/util/XercesDefs.hpp>
26
27class SequenceType;
29class StaticAnalysis;
30class XQGlobalVariable;
31
34class XQILLA_API VariableTypeStore : public XERCES_CPP_NAMESPACE_QUALIFIER XMemory
35{
36public:
38 virtual ~VariableTypeStore() {};
39
41 virtual void clear() = 0;
42
44 virtual void addLocalScope() = 0;
46 virtual void addLogicalBlockScope() = 0;
49 virtual void removeScope() = 0;
50
52 virtual void declareGlobalVar(const XMLCh* namespaceURI, const XMLCh* name,
53 const StaticAnalysis &src, XQGlobalVariable *global) = 0;
54
56 virtual const StaticAnalysis* getGlobalVar(const XMLCh* namespaceURI, const XMLCh* name,
57 XQGlobalVariable **global = 0) const = 0;
58
61 virtual void declareVar(const XMLCh* namespaceURI, const XMLCh* name,
62 const StaticAnalysis &src) = 0;
63
67 virtual const StaticAnalysis *getVar(const XMLCh* namespaceURI, const XMLCh* name,
68 XQGlobalVariable **global = 0) const = 0;
69};
70
71#endif
Records access to various parts of the context during static resolution.
Definition StaticAnalysis.hpp:36
This is the wrapper class for the variable store, which implements the lookup and scoping of simple v...
Definition VariableTypeStore.hpp:35
virtual void clear()=0
Clears all variable values and added scopes from the store.
virtual void removeScope()=0
Removes the top level scope from the store.
virtual void addLocalScope()=0
Adds a new local scope to the store.
virtual const StaticAnalysis * getVar(const XMLCh *namespaceURI, const XMLCh *name, XQGlobalVariable **global=0) const =0
Looks up the value of a variable in the current scope, using ident as an qname.
virtual void addLogicalBlockScope()=0
Adds a new logical block scope to the store.
virtual void declareGlobalVar(const XMLCh *namespaceURI, const XMLCh *name, const StaticAnalysis &src, XQGlobalVariable *global)=0
Declares and/or sets a variable in the global scope.
virtual void declareVar(const XMLCh *namespaceURI, const XMLCh *name, const StaticAnalysis &src)=0
Declare a var in the top level scope (A full set of these namespaceURI/name pair methods should be ma...
virtual ~VariableTypeStore()
default destructor
Definition VariableTypeStore.hpp:38
virtual const StaticAnalysis * getGlobalVar(const XMLCh *namespaceURI, const XMLCh *name, XQGlobalVariable **global=0) const =0
Gets a variable from the global scope.
Definition XPath2MemoryManager.hpp:46