zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #09282
[Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba
Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.
Requested reviews:
Markos Zaharioudakis (markos-za)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/104999
Fixed bug 867170
--
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/104999
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/api/staticcontextimpl.cpp'
--- src/api/staticcontextimpl.cpp 2012-05-05 02:39:12 +0000
+++ src/api/staticcontextimpl.cpp 2012-05-07 23:15:23 +0000
@@ -73,6 +73,7 @@
********************************************************************************/
StaticContextImpl::StaticContextImpl(DiagnosticHandler* aDiagnosticHandler)
:
+ theMaxVarId(2),
theDiagnosticHandler(aDiagnosticHandler),
theUserDiagnosticHandler(true),
theCollectionMgr(0)
@@ -97,6 +98,7 @@
DiagnosticHandler* aDiagnosticHandler)
:
theCtx(aCtx),
+ theMaxVarId(2),
theDiagnosticHandler(aDiagnosticHandler),
theUserDiagnosticHandler(true),
theCollectionMgr(0)
@@ -118,6 +120,7 @@
StaticContextImpl::StaticContextImpl(const StaticContextImpl& aStaticContext)
:
StaticContext(),
+ theMaxVarId(2),
theDiagnosticHandler(aStaticContext.theDiagnosticHandler),
theUserDiagnosticHandler(aStaticContext.theUserDiagnosticHandler),
theCollectionMgr(0)
@@ -1023,9 +1026,11 @@
theSctxMap = impl.theCompilerCB->theSctxMap;
}
+
static void
-toInternalPath(const std::vector<String>& aPublicStrings,
- std::vector<zstring>& aInternalStrings)
+toInternalPath(
+ const std::vector<String>& aPublicStrings,
+ std::vector<zstring>& aInternalStrings)
{
for (std::vector<String>::const_iterator lIter = aPublicStrings.begin();
lIter != aPublicStrings.end(); ++lIter)
@@ -1042,9 +1047,11 @@
}
}
+
static void
-toPublicPath(const std::vector<zstring>& aInternalStrings,
- std::vector<String>& aPublicStrings)
+toPublicPath(
+ const std::vector<zstring>& aInternalStrings,
+ std::vector<String>& aPublicStrings)
{
for (std::vector<zstring>::const_iterator lIter = aInternalStrings.begin();
lIter != aInternalStrings.end(); ++lIter)
@@ -1053,6 +1060,7 @@
}
}
+
void
StaticContextImpl::setURIPath(const std::vector<String> &aURIPath)
{
=== modified file 'src/api/staticcontextimpl.h'
--- src/api/staticcontextimpl.h 2012-05-05 02:39:12 +0000
+++ src/api/staticcontextimpl.h 2012-05-07 23:15:23 +0000
@@ -33,16 +33,29 @@
/*******************************************************************************
- theCtx : rchandle to the internal static_context obj that is
- wrapped by "this".
-
- theSctxMap :
-
- theDiagnosticHandler : Pointer to an error handle to handle any errors raised
- by the methods of this class.
- theUserDiagnosticHandler : If true, theDiagnosticHandler is owned by "this", and it
- should be deleted when "this" is destroyed. Otherwise,
- theDiagnosticHandler is not owned by "this".
+ theCtx :
+ --------
+ rchandle to the internal static_context obj that is wrapped by "this".
+
+ theSctxMap :
+ ------------
+
+ theMaxVarId :
+ -------------
+ If loadProlog() is called on "this", the compiler will store in theMaxVarId
+ the max variable id generated by the compilation of the given prolog. This
+ is needed by the "outer" query, where the prolog will be loaded to.
+
+ theDiagnosticHandler :
+ ----------------------
+ Pointer to an error handle to handle any errors raised by the methods of
+ this class.
+
+ theUserDiagnosticHandler :
+ --------------------------
+ If true, theDiagnosticHandler is owned by "this", and it should be deleted
+ when "this" is destroyed. Otherwise, theDiagnosticHandler is not owned by
+ "this".
********************************************************************************/
class StaticContextImpl : public StaticContext
{
@@ -54,6 +67,8 @@
std::map<int, static_context_t> theSctxMap;
+ ulong theMaxVarId;
+
DiagnosticHandler * theDiagnosticHandler;
bool theUserDiagnosticHandler;
@@ -70,25 +85,27 @@
virtual ~StaticContextImpl();
- void loadProlog(const String&, const Zorba_CompilerHints_t &hints);
+ void loadProlog(const String&, const Zorba_CompilerHints_t& hints);
+
+ ulong getMaxVarId() const { return theMaxVarId; }
+
+ void setMaxVarId(ulong v) { if (v > theMaxVarId) theMaxVarId = v; }
StaticContext_t createChildContext() const;
- bool addNamespace( const String& prefix, const String& URI );
-
- String getNamespaceURIByPrefix( const String& prefix ) const;
-
- void
- getNamespaceBindings( NsBindings& aBindings ) const;
-
- bool setDefaultElementAndTypeNamespace( const String& URI );
-
- String getDefaultElementAndTypeNamespace( ) const;
-
- bool setDefaultFunctionNamespace( const String& URI );
-
- virtual String
- getDefaultFunctionNamespace( ) const;
+ bool addNamespace(const String& prefix, const String& URI);
+
+ String getNamespaceURIByPrefix(const String& prefix) const;
+
+ void getNamespaceBindings(NsBindings& aBindings) const;
+
+ bool setDefaultElementAndTypeNamespace(const String& URI);
+
+ String getDefaultElementAndTypeNamespace() const;
+
+ bool setDefaultFunctionNamespace(const String& URI);
+
+ virtual String getDefaultFunctionNamespace() const;
virtual void
addCollation( const String& URI );