Kaydet (Commit) f220c391 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

make SQL grammar Generalised LR

This fixes parsing failures, like e.g.
warn:legacy.osl:30429:1:dbaccess/source/core/api/SingleSelectQueryComposer.cxx:783: OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!
when opening query "Balance" of https://bugs.freedesktop.org/attachment.cgi?id=71964

OTOH, since we have reduce/reduce conflicts, we might have true
ambiguities in our grammar. This change makes the parsing fail
in the presence of full-expression ambiguities instead of making
a ~arbitrary choice.

Change-Id: I88574da91045dd52f198f193c78d144302f298a4
üst 6eb9c378
......@@ -839,7 +839,7 @@ void OSQLParser::killThousandSeparator(OSQLParseNode* pLiteral)
}
}
// -----------------------------------------------------------------------------
OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral)
OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*const& pLiteral)
{
if ( !pLiteral )
return NULL;
......@@ -957,7 +957,7 @@ OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral)
return pReturn;
}
// -----------------------------------------------------------------------------
sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral,OSQLParseNode*& pCompare,OSQLParseNode* pLiteral2)
sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* const pLiteral,OSQLParseNode*const & pCompare,OSQLParseNode* pLiteral2)
{
OSL_ENSURE(inPredicateCheck(),"Only in predicate check allowed!");
sal_Int16 nErg = 0;
......@@ -986,7 +986,7 @@ sal_Int16 OSQLParser::buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode*
return nErg;
}
// -----------------------------------------------------------------------------
sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode*& pAppend, OSQLParseNode*& pLiteral, const OSQLParseNode* pEscape)
sal_Int16 OSQLParser::buildLikeRule(OSQLParseNode* const& pAppend, OSQLParseNode*& pLiteral, const OSQLParseNode* pEscape)
{
sal_Int16 nErg = 0;
sal_Int32 nType = 0;
......
......@@ -170,7 +170,7 @@ namespace connectivity
OSQLParseNode* buildDate(sal_Int32 _nType,OSQLParseNode*& pLiteral);
bool extractDate(OSQLParseNode* pLiteral,double& _rfValue);
void killThousandSeparator(OSQLParseNode* pLiteral);
OSQLParseNode* convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral);
OSQLParseNode* convertNode(sal_Int32 nType,OSQLParseNode*const& pLiteral);
// makes a string out of a number, pLiteral will be deleted
OSQLParseNode* buildNode_STR_NUM(OSQLParseNode*& pLiteral);
OSQLParseNode* buildNode_Date(const double& fValue, sal_Int32 nType);
......@@ -238,9 +238,9 @@ namespace connectivity
sal_Int16 buildComparsionRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral);
// pCompre will be deleted if it is not used
sal_Int16 buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* pLiteral,OSQLParseNode*& pCompare,OSQLParseNode* pLiteral2 = NULL);
sal_Int16 buildPredicateRule(OSQLParseNode*& pAppend,OSQLParseNode* const pLiteral,OSQLParseNode*const & pCompare,OSQLParseNode* pLiteral2 = NULL);
sal_Int16 buildLikeRule(OSQLParseNode*& pAppend,OSQLParseNode*& pLiteral,const OSQLParseNode* pEscape);
sal_Int16 buildLikeRule(OSQLParseNode* const& pAppend,OSQLParseNode*& pLiteral,const OSQLParseNode* pEscape);
sal_Int16 buildStringNodes(OSQLParseNode*& pLiteral);
#else
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment