2014-10-25 15:13:40 +00:00
|
|
|
/*
|
2016-11-18 23:13:20 +00:00
|
|
|
This file is part of solidity.
|
2014-10-25 15:13:40 +00:00
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
solidity is free software: you can redistribute it and/or modify
|
2014-10-25 15:13:40 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
2016-11-18 23:13:20 +00:00
|
|
|
solidity is distributed in the hope that it will be useful,
|
2014-10-25 15:13:40 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2016-11-18 23:13:20 +00:00
|
|
|
along with solidity. If not, see <http://www.gnu.org/licenses/>.
|
2014-10-25 15:13:40 +00:00
|
|
|
*/
|
2020-07-17 14:54:12 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0
|
2014-10-25 15:13:40 +00:00
|
|
|
/**
|
|
|
|
* @author Christian <c@ethdev.com>
|
|
|
|
* @date 2014
|
2014-10-25 16:30:43 +00:00
|
|
|
* Solidity commandline compiler.
|
2014-10-25 15:13:40 +00:00
|
|
|
*/
|
2014-10-10 14:37:54 +00:00
|
|
|
|
2019-03-28 12:07:52 +00:00
|
|
|
#include <solc/CommandLineInterface.h>
|
2021-08-09 09:36:29 +00:00
|
|
|
|
|
|
|
#include <liblangutil/Exceptions.h>
|
|
|
|
|
2019-03-28 12:07:52 +00:00
|
|
|
#include <boost/exception/all.hpp>
|
2021-08-09 09:36:29 +00:00
|
|
|
|
2015-08-19 23:09:39 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using namespace std;
|
2021-08-09 09:36:29 +00:00
|
|
|
using namespace solidity;
|
2014-12-08 15:42:56 +00:00
|
|
|
|
2016-08-30 11:29:37 +00:00
|
|
|
|
2014-10-10 14:37:54 +00:00
|
|
|
int main(int argc, char** argv)
|
|
|
|
{
|
2021-08-09 09:36:29 +00:00
|
|
|
try
|
|
|
|
{
|
|
|
|
solidity::frontend::CommandLineInterface cli(cin, cout, cerr);
|
2021-10-12 12:16:29 +00:00
|
|
|
return cli.run(argc, argv) ? 0 : 1;
|
2021-08-09 09:36:29 +00:00
|
|
|
}
|
|
|
|
catch (smtutil::SMTLogicError const& _exception)
|
|
|
|
{
|
|
|
|
cerr << "SMT logic error:" << endl;
|
|
|
|
cerr << boost::diagnostic_information(_exception);
|
2021-06-13 13:53:16 +00:00
|
|
|
return 1;
|
2021-08-09 09:36:29 +00:00
|
|
|
}
|
|
|
|
catch (langutil::UnimplementedFeatureError const& _exception)
|
|
|
|
{
|
|
|
|
cerr << "Unimplemented feature:" << endl;
|
|
|
|
cerr << boost::diagnostic_information(_exception);
|
2014-12-09 16:39:34 +00:00
|
|
|
return 1;
|
2021-08-09 09:36:29 +00:00
|
|
|
}
|
|
|
|
catch (langutil::InternalCompilerError const& _exception)
|
2015-08-19 23:09:39 +00:00
|
|
|
{
|
2021-08-09 09:36:29 +00:00
|
|
|
cerr << "Internal compiler error:" << endl;
|
|
|
|
cerr << boost::diagnostic_information(_exception);
|
|
|
|
return 1;
|
2015-08-19 23:09:39 +00:00
|
|
|
}
|
|
|
|
catch (boost::exception const& _exception)
|
|
|
|
{
|
2021-08-09 09:36:29 +00:00
|
|
|
cerr << "Uncaught exception:" << endl;
|
|
|
|
cerr << boost::diagnostic_information(_exception) << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
catch (std::exception const& _exception)
|
|
|
|
{
|
|
|
|
cerr << "Uncaught exception:" << endl;
|
|
|
|
cerr << boost::diagnostic_information(_exception) << endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
cerr << "Uncaught exception" << endl;
|
|
|
|
cerr << boost::current_exception_diagnostic_information() << endl;
|
|
|
|
return 1;
|
2015-08-19 23:09:39 +00:00
|
|
|
}
|
2014-10-10 14:37:54 +00:00
|
|
|
}
|