// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*- /* * (c) 2017 Jan Horáček * (c) 2017-2019 Zuzana Baranová * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #include #include using namespace divine; int main( int argc, char **argv ) { try { rt::NativeDiosCC nativeCC( { argv + 1, argv + argc } ); nativeCC.set_cxx( brq::ends_with( argv[ 0 ], "diosc++" ) ); auto& po = nativeCC._po; if ( po.hasHelp || po.hasVersion ) { nativeCC.print_info( ui::version() ); return 0; } return nativeCC.run(); } catch ( divcc::compile_error &err ) { std::cerr << err.what() << std::endl; return 1; } catch ( std::runtime_error &err ) { std::cerr << "compilation failed: " << err.what() << std::endl; return 2; } }