From eb30b928ad744fe5cdb0bdec0e8e388a1abcfdfe Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Fri, 6 Sep 2024 18:22:17 +0200 Subject: [PATCH] Version 1.0.0 --- CompilerFileList.txt | 9 +++ compiler | Bin 0 -> 62240 bytes main.cpp | 160 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 CompilerFileList.txt create mode 100755 compiler create mode 100644 main.cpp diff --git a/CompilerFileList.txt b/CompilerFileList.txt new file mode 100644 index 0000000..b2789fd --- /dev/null +++ b/CompilerFileList.txt @@ -0,0 +1,9 @@ +# main prog +main.cpp + +# std version +-std=c++17 + +# warnings +-Wall +-Wextra diff --git a/compiler b/compiler new file mode 100755 index 0000000000000000000000000000000000000000..0430733d8ed4244c280803a0fb32e77c1e6f73bb GIT binary patch literal 62240 zcmeHw34B!5_5aHzVKdQUMYJ*^A}GX6_TUzl2NPw9389GKV=@`YXp)JONemP$HqesB zSZdK)Yi+bHXl+aVx7JdZut?Ba8<$#Y(W13FQ>^lFPtmYYd95B@I2U!VWkhO-(*&00D7+tbH9_w1?q&M!P) zaMOhw-dvFR?UQaDH47|`$BJQ^cA^dSY&eJ={PW zwZTcwD0}($jkd@C)kkjvApPxC%zuW=8(*eH&oyyLhQyuKq?SMbaq1{W- zLG9$HIrz^=2R(}&~4*syr!JfZ%@T+MK^_uN~zraDx z0f%<+JM@<`9Pkwm_PNW!4gm*$&Ua`R8XH{rOFX{q(C)u*D7W9CzOOsfi^d68VxdS+ zb->p<#MO%&{Pu?qe*QHFfB2Du{MTTI2{w8@h;mQRPSsZYKoGO3LO9-lA5PG+v^5Jw zx?KS6ixS^6Um#K?|5mgY@lRhQ@NY@}U&7xAf7@m8_(RBNCx1TVlRjm434W!IW*Dm) zf{jLV*c%EPhGvv6ns3zlL;h8P=CD7sX#TAFV55JLx2E1NX!ew)3#!7!hT&^#bGzMn zHQwfc4##QCMs<7MbtMi78aL5}7H<$bLDldL?cfL_&_<~K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4>RL|o>V~kl1~80|922ZlXZW73Kh&h< z;Ip>=96a!!(-aEg*7fje3#z6iP+vPOP%BY*Xl)w3rh(b(yv=o5PVMSO6d_@F(V{_oRG)ccLr()qCOOGDM{`*{&Q$SU&!akgse}$m9Bpfc1=5J#C9|eWV zH`}jCvPxK06StCM<4Cl(Dqq2mz(Xpk{OUUtTV;O5N3!TpX$6mi ze&o94#Hv}vZ!2DJD70g0rYku_|i-^ph zX*z}wq4Ft6-{H09SMLEl^i9F9`l(VtXA;RlTTxDcuF9_}#o!K;H~2Hdd~}o`4g( R{O?5t$5f@L%#e`O{x39z#B2Zn literal 0 HcmV?d00001 diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..d426f12 --- /dev/null +++ b/main.cpp @@ -0,0 +1,160 @@ +#include +#include +#include +#include +#include + +#include + +// Functions decllaration +bool read_file(std::ifstream &compilerfilelist, std::vector &includesfilesnames); +void generate_command(const std::vector &includesfilesnames, std::string &command); +std::string color(int r, int g, int b); +std::string color(); +std::string error_msg(); + +// Main +int main(const int argc, const char *argv[]) +{ + if(argc != 2) + { + std::cerr << error_msg() << "Vous n'avez pas entré le bon nombre d'arguments.\n"; + return 1; + } + + std::string nomfichiersortie {argv[1]}; + + if(std::empty(nomfichiersortie)) + { + std::cerr << error_msg() << "Vous devez indiquer un nom de sortie.\n"; + return 1; + } + + for(const char character : nomfichiersortie) + { + if((character < 65 || character > 90) && (character < 97 || character > 122) && character != '.' && character != '/' && character != '_' && (character < 48 && character > 57)) + { + std::cerr << error_msg() << "Nom de fichier de sortie non valide : \"" << nomfichiersortie << "\"\n"; + return 1; + } + } + + std::ifstream compilerfilelist {"CompilerFileList.txt"}; + if(!compilerfilelist) + { + std::cerr << error_msg() << "Le fichier \"CompilerFileList.txt\" n'existe pas." << std::endl; + return 1; + } + + std::vector includesfilesnames {}; + bool error {read_file(compilerfilelist, includesfilesnames)}; + if(error == true) + { + std::cerr << '\n' << error_msg() << "Impossible de lancer la creation de la commande de compilation, certain noms de fichier contenus dans \"CompilerFileList.txt\" ne sont pas corrects.\n"; + return 1; + } + + if(std::empty(includesfilesnames)) + { + std::cerr << '\n' << error_msg() << "Le fichier \"CompilerFileList.txt\" ne contient aucun nom de fichier."; + return 1; + } + + std::string command {"g++ -o " + nomfichiersortie + " "}; + generate_command(includesfilesnames, command); + + std::cout << "\nVoici la commande qui vas être executée :\n\"" << command << "\"\n\n"; + + system(command.c_str()); +/* + std::cout << "\nLe programme vas être executé...\n\n"; + + command = "./" + nomfichiersortie; + system(command.c_str()); + + std::cout << "\nFin du programme.\n"; +*/ + return 0; +} + +// Functions definition +bool read_file(std::ifstream &compilerfilelist, std::vector &includesfilesnames) +{ + std::string includefilename {}; + + unsigned int line_num {0}; + bool error {false}; + + while(std::getline(compilerfilelist, includefilename)) + { + line_num++; + + if(includefilename.front() == '#' && includefilename.size() > 1) + { + if(line_num != 1) + std::cout << '\n'; + std::string category {std::begin(includefilename) + 1, std::end(includefilename)}; + std::cout << "-- " << color(59, 80, 255) << "Catégorie" << color() << category << '\n'; + } + else if(!(std::empty(includefilename)) && includefilename.front() != '#') + { + for(const char &character : includefilename) + { + if((character < 65 || character > 90) && (character < 97 || character > 122) && character != '.' && character != '/' && character != '_' && character != '-' && (character < 48 && character > 57) && character != '$' && character != '(' && character != ')') + { + std::cout << error_msg() << "Ligne " << line_num << " dans \"CompilerFileList.txt\". Nom d'argument invalide : \"" << includefilename << "\"\n"; + error = true; + break; + } + } + + if(error == false) + { + includesfilesnames.push_back(includefilename); + std::cout << color(37, 155, 36) << "Réussite" << color() << " : Argument \"" << includefilename << "\" ajouté à la liste des arguments à donner au compilateur.\n"; + } + } + } + + return error; +} + +void generate_command(const std::vector &includesfilesnames, std::string &command) +{ + for(const std::string &includefilename : includesfilesnames) + { + command += includefilename + " "; + } + + command.pop_back(); +} + +std::string color(int r, int g, int b) +{ + assert(r < 256); + assert(g < 256); + assert(b < 256); + assert(r >= 0); + assert(g >= 0); + assert(b >= 0); + + std::string colorstr {"\e[38;2;"}; + colorstr += std::to_string(r); + colorstr += ';'; + colorstr += std::to_string(g); + colorstr += ';'; + colorstr += std::to_string(b); + colorstr += 'm'; + + return colorstr; +} + +std::string color() +{ + return "\e[m"; +} + +std::string error_msg() +{ + return color(208, 23, 22) + "Erreur" + color() + ": "; +}