Parser/QueryParser.cpp
void QueryParser::SPARQLParse(const string &query)
{
	istringstream ifs(query);

	SPARQLErrorListener lstnr;

	antlr4::ANTLRInputStream input(ifs);
	SPARQLLexer lexer(&input);
	lexer.removeErrorListeners();
	lexer.addErrorListener(&lstnr);

	antlr4::CommonTokenStream tokens(&lexer);
	SPARQLParser parser(&tokens);
	parser.removeErrorListeners();
	parser.addErrorListener(&lstnr);

	SPARQLParser::EntryContext *tree = parser.entry();
	// printTree(tree, 0);
	visitEntry(tree);
}
/**
	Overall driver function for query parsing.

	@param query the query string.
*/
Overall driver function for query parsing.
Overall driver function for query parsing .
void QueryParser::SPARQLParse(const string &query)
{
	istringstream ifs(query);
	SPARQLErrorListener lstnr;
	antlr4::ANTLRInputStream input(ifs);
	SPARQLLexer lexer(&input);
	lexer.removeErrorListeners();
	lexer.addErrorListener(&lstnr);
	antlr4::CommonTokenStream tokens(&lexer);
	SPARQLParser parser(&tokens);
	parser.removeErrorListeners();
	parser.addErrorListener(&lstnr);
	SPARQLParser::EntryContext *tree = parser.entry();
	visitEntry(tree);
}
void QueryParser :: SPARQLParse ( const string & query ) { istringstream ifs ( query ) ; SPARQLErrorListener lstnr ; antlr4 :: ANTLRInputStream input ( ifs ) ; SPARQLLexer lexer ( & input ) ; lexer . removeErrorListeners ( ) ; lexer . addErrorListener ( & lstnr ) ; antlr4 :: CommonTokenStream tokens ( & lexer ) ; SPARQLParser parser ( & tokens ) ; parser . removeErrorListeners ( ) ; parser . addErrorListener ( & lstnr ) ; SPARQLParser :: EntryContext * tree = parser . entry ( ) ; visitEntry ( tree ) ; }
Overall driver function for query parsing.
Overall driver function for query parsing .
// printTree(tree, 0);