From 7498093d0224e0bd857009941cf8539b93d05af7 Mon Sep 17 00:00:00 2001 From: zosrothko Date: Tue, 31 Oct 2017 08:15:05 +0100 Subject: [PATCH] Refactor VisualStudio project --- .gitignore | 161 ++++++++++++++++++ {MSVC => msvc}/calc/calc.vcxproj | 11 +- {MSVC => msvc}/calc/calc.vcxproj.filters | 5 - {MSVC => msvc}/getopt.c | 0 {MSVC => msvc}/getopt.h | 0 MSVC/greg-vs120.sln => msvc/greg-vs140.sln | 2 +- .../greg-vs140.vcxproj | 6 +- .../greg-vs140.vcxproj.filters | 0 samples/calc.leg | 24 +-- 9 files changed, 182 insertions(+), 27 deletions(-) rename {MSVC => msvc}/calc/calc.vcxproj (93%) rename {MSVC => msvc}/calc/calc.vcxproj.filters (87%) rename {MSVC => msvc}/getopt.c (100%) rename {MSVC => msvc}/getopt.h (100%) rename MSVC/greg-vs120.sln => msvc/greg-vs140.sln (97%) rename MSVC/greg-vs120.vcxproj => msvc/greg-vs140.vcxproj (96%) rename MSVC/greg-vs120.vcxproj.filters => msvc/greg-vs140.vcxproj.filters (100%) diff --git a/.gitignore b/.gitignore index 8dc6ad2..179f1ee 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,164 @@ greg greg.exe samples/*.leg.c + + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + + +# Compiled # +############ +*.com +*.class +*.dll +*.dylib +*.exe +*.slo +*.lo +*.o +*.so +*.lai +*.la +*.a +*.d + + +# Make # +######## +config.build +config.make +*.cache/** + + +# autogenerated make from CDT # +############################## +subdir.mk +objects.mk +sources.mk +makefile +Makefile +Makefile.in +aclocal.m4 +configure +config.h +config.status + + +# CMake # +######## +cmake_install.cmake +cmake_uninstall.cmake +CMakeFiles +CMakeCache.txt +CPackConfig.cmake +CPackSourceConfig.cmake + + +# Logs and databases # +###################### +*.log* +*.sqlite +*.db + + + +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db +*~ + +# VS generated files # +###################### +.vs/ +*.opendb +*.bsc +*.sbr +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.ipch +*.ncb +*.suo +*.sdf +*.opensdf +*.tlb +*.tlh +*.ilk +*.lib +*.exp +*.idb +*.rc +*.res +*.manifest +*.tlog +*.lastbuildstate +*.iobj +*.ipdb +*.unsuccessfulbuild +*nativecodeanalysis* +*codeanalysis* + + +# Eclipse generated files # +########################### +#.project +#.cproject +.settings +cmake-build/ +.metadata/ +RemoteSystemsTempFiles/ + +# Eclipse Maven m2e generated files # +##################################### +**/target/ + + +# Temporary files # +################### +*.bak + + +# Eclipse generated class directory # +##################################### +/cls + +# makedep dependencies files # +############################## +**/.deps/ diff --git a/MSVC/calc/calc.vcxproj b/msvc/calc/calc.vcxproj similarity index 93% rename from MSVC/calc/calc.vcxproj rename to msvc/calc/calc.vcxproj index b02c3a8..3ed8da5 100644 --- a/MSVC/calc/calc.vcxproj +++ b/msvc/calc/calc.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -14,18 +14,19 @@ {607AA625-3E9D-4691-B9A5-9BDBB4620AF1} Win32Proj calc + 8.1 Application true - v120 + v140 Unicode Application false - v120 + v140 true Unicode @@ -41,6 +42,7 @@ true + $(ProjectName)d false @@ -79,9 +81,6 @@ - - - diff --git a/MSVC/calc/calc.vcxproj.filters b/msvc/calc/calc.vcxproj.filters similarity index 87% rename from MSVC/calc/calc.vcxproj.filters rename to msvc/calc/calc.vcxproj.filters index 28632e7..40ec8a6 100644 --- a/MSVC/calc/calc.vcxproj.filters +++ b/msvc/calc/calc.vcxproj.filters @@ -18,9 +18,4 @@ - - - Fichiers sources - - \ No newline at end of file diff --git a/MSVC/getopt.c b/msvc/getopt.c similarity index 100% rename from MSVC/getopt.c rename to msvc/getopt.c diff --git a/MSVC/getopt.h b/msvc/getopt.h similarity index 100% rename from MSVC/getopt.h rename to msvc/getopt.h diff --git a/MSVC/greg-vs120.sln b/msvc/greg-vs140.sln similarity index 97% rename from MSVC/greg-vs120.sln rename to msvc/greg-vs140.sln index 4b5aeeb..54ad2a2 100644 --- a/MSVC/greg-vs120.sln +++ b/msvc/greg-vs140.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Express 2013 for Windows Desktop VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "greg", "greg-vs120.vcxproj", "{DE253F1D-68B4-4A2B-A6FD-1A7176934DD1}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "greg", "greg-vs140.vcxproj", "{DE253F1D-68B4-4A2B-A6FD-1A7176934DD1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "calc", "calc\calc.vcxproj", "{607AA625-3E9D-4691-B9A5-9BDBB4620AF1}" EndProject diff --git a/MSVC/greg-vs120.vcxproj b/msvc/greg-vs140.vcxproj similarity index 96% rename from MSVC/greg-vs120.vcxproj rename to msvc/greg-vs140.vcxproj index 50d3f68..1757f9b 100644 --- a/MSVC/greg-vs120.vcxproj +++ b/msvc/greg-vs140.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,13 +20,13 @@ Application true - v120 + v140 Unicode Application false - v120 + v140 true Unicode diff --git a/MSVC/greg-vs120.vcxproj.filters b/msvc/greg-vs140.vcxproj.filters similarity index 100% rename from MSVC/greg-vs120.vcxproj.filters rename to msvc/greg-vs140.vcxproj.filters diff --git a/samples/calc.leg b/samples/calc.leg index 39fe04b..a3cc129 100644 --- a/samples/calc.leg +++ b/samples/calc.leg @@ -4,27 +4,27 @@ int vars[26]; %} Stmt = - e:Expr EOL { printf("%d\n", e); } - | ( !EOL . )* EOL { printf("error\n"); } + | ( !EOL . )* EOL { printf("error\n"); } Expr = i:ID ASSIGN s:Sum { $$= vars[i]= s; } - | s:Sum { $$= s; } + | s:Sum { $$= s; } Sum = l:Product - ( PLUS r:Product { l += r; } - | MINUS r:Product { l -= r; } - )* { $$= l; } + ( PLUS r:Product { l += r; } + | MINUS r:Product { l -= r; } + )* { $$= l; } Product = l:Value - ( TIMES r:Value { l *= r; } - | DIVIDE r:Value { l /= r; } - )* { $$= l; } + ( TIMES r:Value { l *= r; } + | DIVIDE r:Value { l /= r; } + )* { $$= l; } -Value = i:NUMBER { $$= atoi(yytext); } - | i:ID !ASSIGN { $$= vars[i]; } - | OPEN i:Expr CLOSE { $$= i; } +Value = i:NUMBER { $$= atoi(yytext); } + | i:ID !ASSIGN { $$= vars[i]; } + | OPEN i:Expr CLOSE { $$= i; } NUMBER = < [0-9]+ > - { $$= atoi(yytext); } -ID = < [a-z] > - { $$= yytext[0] - 'a'; } +ID = < [a-z] > - { $$= yytext[0] - 'a'; } ASSIGN = '=' - PLUS = '+' - MINUS = '-' -