Skip to content
Snippets Groups Projects
Commit a83bbecb authored by Jan Trávníček's avatar Jan Trávníček
Browse files

aql binary

parent 0c7d0cd8
No related branches found
No related tags found
No related merge requests found
-include makefile.conf
-include ../build.conf
-include ../makefile-binary
EXECUTABLE:=aql2
LINK_PATHS=../alib2cli/ ../alib2elgo/ ../alib2algo/ ../alib2raw/ ../alib2str/ ../alib2data/ ../alib2common/ ../alib2std/
LINK_LIBRARIES=alib2cli alib2elgo alib2algo alib2raw alib2str alib2data alib2common alib2std xml2
INCLUDE_PATHS=\$$(SOURCES_BASE_DIR)/../../alib2cli/src/ \$$(SOURCES_BASE_DIR)/../../alib2data/src/ \$$(SOURCES_BASE_DIR)/../../alib2common/src/ \$$(SOURCES_BASE_DIR)/../../alib2std/src/ /usr/include/libxml2/
/*
* aql.cpp
*
* Created on: 26. 3. 2014
* Author: Jan Travnicek
*/
#include <measure>
#include <tclap/CmdLine.h>
#include <global/GlobalData.h>
#include <lexer/Lexer.h>
#include <parser/Parser.h>
int main ( int argc, char * argv[] ) {
//TODO interfacing to stdin / unnamed pipes and stdout
try {
common::GlobalData::argc = argc;
common::GlobalData::argv = argv;
TCLAP::CmdLine cmd ( "Algorithms query language binary", ' ', "0.01" );
TCLAP::ValueArg < std::string > query ( "q", "query", "Query index", true, "", "query");
cmd.add ( query );
TCLAP::SwitchArg measure ( "m", "measure", "Measure times", false );
cmd.add ( measure );
TCLAP::SwitchArg verbose ( "v", "verbose", "Be verbose", false );
cmd.add ( verbose );
cmd.parse ( argc, argv );
if(verbose.isSet())
common::GlobalData::verbose = true;
if(measure.isSet())
common::GlobalData::measure = true;
measurements::start ( "Overal", measurements::Type::OVERALL );
cli::Parser parser ( cli::Lexer ( query.getValue ( ) ) );
parser.execute ( )->translateAndEval ( nullptr );
measurements::end ( );
if ( measure.getValue ( ) )
std::cmeasure << measurements::results ( ) << std::endl;
return 0;
} catch ( const exception::CommonException & exception ) {
alib::XmlDataFactory::toStdout ( exception );
return 1;
} catch ( const TCLAP::ArgException & exception ) {
std::cout << exception.error ( ) << std::endl;
return 2;
} catch ( const std::exception & exception ) {
std::cerr << "Exception caught: " << exception.what ( ) << std::endl;
return 3;
} catch ( ... ) {
std::cerr << "Unknown exception caught." << std::endl;
return 127;
}
}
...@@ -61,6 +61,7 @@ SUBDIRS_BINS = aecho2 \ ...@@ -61,6 +61,7 @@ SUBDIRS_BINS = aecho2 \
atrim2 \ atrim2 \
tniceprint \ tniceprint \
aintrospection2 \ aintrospection2 \
aql2 \
   
define NEW_LINE define NEW_LINE
   
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment