Parser/QueryParser.cpp
antlrcpp::Any QueryParser::visitFilter(SPARQLParser::FilterContext *ctx, \
	QueryTree::GroupPattern &group_pattern)
{
	if (ctx->constraint()->functionCall())
		throw runtime_error("[ERROR]	Function call currently not supported in filter.");

	group_pattern.addOneFilter();

	if (ctx->constraint()->brackettedexpression())
		buildFilterTree(ctx->constraint()->brackettedexpression()->expression()->conditionalOrexpression(), \
			NULL, group_pattern.getLastFilter().root, "conditionalOrexpression");
	else if (ctx->constraint()->builtInCall())
		buildFilterTree(ctx->constraint()->builtInCall(), NULL, \
			group_pattern.getLastFilter().root, "builtInCall");

	return antlrcpp::Any();
}
/**
	filter : K_FILTER constraint ;
	Visit node filter: Add a FILTER to group_pattern, and construct the filter tree by
	calling buildFilterTree.

	@param ctx pointer to filter's context.
	@param group_pattern a group graph pattern.
	@return a dummy antlrcpp::Any object.
*/
filter : K_FILTER constraint ;
Visit node filter: Add a FILTER to group_pattern, and construct the filter tree by
calling buildFilterTree.
filter : K_FILTER constraint ; Visit node filter : Add a FILTER to group_pattern and construct the filter tree by calling buildFilterTree .
antlrcpp::Any QueryParser::visitFilter(SPARQLParser::FilterContext *ctx, \
	QueryTree::GroupPattern &group_pattern)
{
	if (ctx->constraint()->functionCall())
		throw runtime_error("[ERROR]	Function call currently not supported in filter.");
	group_pattern.addOneFilter();
	if (ctx->constraint()->brackettedexpression())
		buildFilterTree(ctx->constraint()->brackettedexpression()->expression()->conditionalOrexpression(), \
			NULL, group_pattern.getLastFilter().root, "conditionalOrexpression");
	else if (ctx->constraint()->builtInCall())
		buildFilterTree(ctx->constraint()->builtInCall(), NULL, \
			group_pattern.getLastFilter().root, "builtInCall");
	return antlrcpp::Any();
}
antlrcpp :: Any QueryParser :: visitFilter ( SPARQLParser :: FilterContext * ctx , QueryTree :: GroupPattern & group_pattern ) { if ( ctx -> constraint ( ) -> functionCall ( ) ) throw runtime_error ( " " ) ; group_pattern . addOneFilter ( ) ; if ( ctx -> constraint ( ) -> brackettedexpression ( ) ) buildFilterTree ( ctx -> constraint ( ) -> brackettedexpression ( ) -> expression ( ) -> conditionalOrexpression ( ) , NULL , group_pattern . getLastFilter ( ) . root , " " ) ; else if ( ctx -> constraint ( ) -> builtInCall ( ) ) buildFilterTree ( ctx -> constraint ( ) -> builtInCall ( ) , NULL , group_pattern . getLastFilter ( ) . root , " " ) ; return antlrcpp :: Any ( ) ; }
filter : K_FILTER constraint ;
Visit node filter: Add a FILTER to group_pattern, and construct the filter tree by
calling buildFilterTree.
filter : K_FILTER constraint ; Visit node filter : Add a FILTER to group_pattern and construct the filter tree by calling buildFilterTree .