Files
xeus-basic/libs/basic/main.cc
Avinal Kumar 61743fda3e Reformat and add copyright headers
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
Co-authored-by: Sarita Singh <saritasingh.0425@gmail.com>
2021-11-02 23:29:32 +05:30

43 lines
925 B
C++

/**
* SPDX-License-Identifier: Apache-2.0
* SPDX-FileCopyrightText: 2021 Avinal Kumar <avinal.xlvii@gmail.com>
*
* @file main.cc
* @brief Driver Code
*/
#include <fstream>
#include <iostream>
#include <sstream>
#include "basic/basic.hpp"
std::string outputs;
void replcc() {
std::cout << " _ _ \n"
<< "| |__ __ _ ___(_) ___ \n"
<< "| '_ \\ / _` / __| |/ __|\n"
<< "| |_) | (_| \\__ \\ | (__ \n"
<< "|_.__/ \\__,_|___/_|\\___|\n"
<< "(c) 2015-2016 Johan Van den Brande\n";
std::string input;
basic check;
while (getline(std::cin, input)) {
if (!input.compare("QUIT")) {
break;
}
if (!check.evaluate_line(input)) {
std::cerr << check.get_error() << "\n";
}
if (input == "RUN") {
std::cout << check.run();
}
}
}
int main(int argc, char *argv[]) {
replcc();
return EXIT_SUCCESS;
}