#include "config.h" #include "number.h" #include "packedintarray.h" #include "lexer.h" #include "token.h" #include "parser.h" #include "options.h" #include "scriptengine.h" #include #include #include #include #include using namespace Bu; void numResult( const class Number &num ) { println("==> %1").arg( num ); } void dispError( const Bu::String &sMsg ) { println(sMsg); } void dispMessage( const Bu::String &sMsg ) { println(sMsg); } int main( int argc, char *argv[] ) { try { Options opt( argc, argv ); println(CLIC_VERSION_STR); println("Try \\exit, \\help, \\scale, and \\radix commands."); println(""); Lexer lex( sioRaw ); lex.setScale( opt.getScale() ); lex.setRadix( opt.getRadix() ); Parser parser( lex ); ScriptEngine se; se.sigNumResult = Bu::slot(numResult); se.sigError = Bu::slot(dispError); se.sigMessage = Bu::slot(dispMessage); for(;;) { Expression *pExpr = parser.parse(); se.exec( pExpr ); delete pExpr; } } catch( std::exception &e ) { Bu::println("Error: %1").arg( e.what() ); } return 0; }