Parser/QueryParser.cpp
antlrcpp::Any QueryParser::visitQuery(SPARQLParser::QueryContext *ctx)
{
	// printNode(ctx, "query");

	visit(ctx->prologue());

	// Only one of the following children is valid
	if (ctx->selectquery())
	{
		query_tree_ptr->setQueryForm(QueryTree::Select_Query);
		visit(ctx->selectquery());
	}
	if (ctx->constructquery())	// Not supported?
		visit(ctx->constructquery());
	if (ctx->describequery())	// Not supported?
		visit(ctx->describequery());
	if (ctx->askquery())
	{
		query_tree_ptr->setQueryForm(QueryTree::Ask_Query);
		visit(ctx->askquery());
	}

	visit(ctx->valuesClause());

	return antlrcpp::Any();
}
/**
	query : prologue( selectquery | constructquery | describequery | askquery )valuesClause ;
	Visit node query: recursively call visit on each of its children.
	(Redundant, can be removed without affecting QueryParser's function)

	@param ctx pointer to query's context.
	@return a dummy antlrcpp::Any object.
*/
query : prologue( selectquery | constructquery | describequery | askquery )valuesClause ;
Visit node query: recursively call visit on each of its children.
(Redundant, can be removed without affecting QueryParser's function)
query : prologue ( selectquery | constructquery | describequery | askquery ) valuesClause ; Visit node query : recursively call visit on each of its children . ( Redundant can be removed without affecting QueryParser ' s function )
antlrcpp::Any QueryParser::visitQuery(SPARQLParser::QueryContext *ctx)
{
	visit(ctx->prologue());
	if (ctx->selectquery())
	{
		query_tree_ptr->setQueryForm(QueryTree::Select_Query);
		visit(ctx->selectquery());
	}
	if (ctx->constructquery())	
		visit(ctx->constructquery());
	if (ctx->describequery())	
		visit(ctx->describequery());
	if (ctx->askquery())
	{
		query_tree_ptr->setQueryForm(QueryTree::Ask_Query);
		visit(ctx->askquery());
	}
	visit(ctx->valuesClause());
	return antlrcpp::Any();
}
antlrcpp :: Any QueryParser :: visitQuery ( SPARQLParser :: QueryContext * ctx ) { visit ( ctx -> prologue ( ) ) ; if ( ctx -> selectquery ( ) ) { query_tree_ptr -> setQueryForm ( QueryTree :: Select_Query ) ; visit ( ctx -> selectquery ( ) ) ; } if ( ctx -> constructquery ( ) ) visit ( ctx -> constructquery ( ) ) ; if ( ctx -> describequery ( ) ) visit ( ctx -> describequery ( ) ) ; if ( ctx -> askquery ( ) ) { query_tree_ptr -> setQueryForm ( QueryTree :: Ask_Query ) ; visit ( ctx -> askquery ( ) ) ; } visit ( ctx -> valuesClause ( ) ) ; return antlrcpp :: Any ( ) ; }
query : prologue( selectquery | constructquery | describequery | askquery )valuesClause ;
Visit node query: recursively call visit on each of its children.
query : prologue ( selectquery | constructquery | describequery | askquery ) valuesClause ; Visit node query : recursively call visit on each of its children .
// printNode(ctx, "query"); // Only one of the following children is valid // Not supported? // Not supported?