File tree Expand file tree Collapse file tree 3 files changed +55
-14
lines changed Expand file tree Collapse file tree 3 files changed +55
-14
lines changed Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.22)
2+ project (French_Programming_Language)
3+
4+ set (CMAKE_CXX_STANDARD 20)
5+
6+ add_executable (French_Programming_Language
7+ src/TokenBuilding.cpp
8+ src/TokenBuilding.h
9+ src/Parser.cpp
10+ src/Parser.h
11+ src/FonctionDefinition.cpp
12+ src/FonctionDefinition.h
13+ src/TypeManager.cpp
14+ src/TypeManager.h
15+ src/VariableDefinition.cpp
16+ src/VariableDefinition.h
17+ main.cpp)
Original file line number Diff line number Diff line change 1+ #include " src/TokenBuilding.h"
2+ #include " src/Parser.h"
3+ #include < iostream>
4+ #include < fstream>
5+
6+ int main () {
7+ std::cout << " F.P.L. : Chargement\n\n " << std::endl;
8+
9+ std::ifstream file {" ../main.fpl" };
10+ if (!file) { std::cerr << " Fichier introuvable." << std::endl; return 1 ; }
11+
12+ std::string f_content ((std::istreambuf_iterator<char >(file)), (std::istreambuf_iterator<char >()));
13+
14+ // std::cout << f_content << std::endl;
15+
16+ FPL::TokenBuilding t;
17+ std::vector<FPL::Token> tokens = t.parseToken (f_content);
18+
19+ /*
20+ for (auto &token : tokens) {
21+ token.DebugPrint();
22+ }
23+ */
24+
25+ FPL::Parser parser;
26+ parser.parse (tokens);
27+
28+ parser.DebugPrint ();
29+
30+ return 0 ;
31+ }
Original file line number Diff line number Diff line change 1- envoyer HEY MAN
1+ definir principal(texte arg, entier a) {
2+ variable entier a -> 10
3+ variable decimal b -> 10.5
4+ envoyer "Yo la compagnie."
5+ }
26
3- variable texte cc -> HEY
4- variable math calcul -> 5 + 15
5- variable math calculdeux -> 1.5 + 3
7+ envoyer "Yo la compagnie."
68
7- envoyer hi man
8- envoyer cc
9- envoyer calcul
10- envoyer calculdeux
11- envoyer bye man
12-
13- envoyer Resultat de 1,5 + 3 : [calculdeux]
14-
15- changer cc -> BYE
16- envoyer cc
9+ variable entier nombre -> 50
You can’t perform that action at this time.
0 commit comments