diff --git a/Compiler Source/DECLARE.C b/Compiler Source/DECLARE.C index c70a47c..9a0e927 100644 --- a/Compiler Source/DECLARE.C +++ b/Compiler Source/DECLARE.C @@ -301,7 +301,7 @@ static void if ((s_ptr->type == BINARY) || (s_ptr->type == DECIMAL) || (s_ptr->type == PICTURE)) - if (s_ptr->scale != FLOAT) + if (s_ptr->scale != D_FLOAT) s_ptr->scale = FIXED; /******************************************************************/ @@ -439,7 +439,7 @@ static long if (s_ptr->type == DECIMAL) /* decimal */ { - if ((s_ptr->prec_1 > 15) && (s_ptr->scale == FLOAT)) + if ((s_ptr->prec_1 > 15) && (s_ptr->scale == D_FLOAT)) report(88,s_ptr->spelling,__LINE__); else if ((s_ptr->prec_1 > 18) && (s_ptr->scale == FIXED)) diff --git a/Compiler Source/DT.C b/Compiler Source/DT.C index 01c32eb..ee9e42e 100644 --- a/Compiler Source/DT.C +++ b/Compiler Source/DT.C @@ -367,7 +367,7 @@ static void dump_operator (Any_ptr g_ptr) if (ptr->scale == FIXED) printf("Scale FIXED\n"); - if (ptr->scale == FLOAT) + if (ptr->scale == D_FLOAT) printf("Scale FLOAT\n"); printf ("Precision: %d,%d\n",ptr->prec_1,ptr->prec_2); diff --git a/Compiler Source/LIST.C b/Compiler Source/LIST.C index 03a0b9c..cb15d6e 100644 --- a/Compiler Source/LIST.C +++ b/Compiler Source/LIST.C @@ -65,6 +65,7 @@ #include /* #include */ #include "options.h" +#include /***************************************************************************/ /* I N T E R N A L L Y D E F I N E D P R O T O T Y P E S */ @@ -97,8 +98,12 @@ FILE *LISTING = NULL; static char buffer[130]; /* was 80 */ char locn[8]; char length[8]; -/*struct dostime_t st; -struct dosdate_t sd; */ +SYSTEMTIME st; +DWORD dwVersion = 0; +DWORD dwMajorVersion = 0; +DWORD dwMinorVersion = 0; +DWORD dwBuild = 0; +/*struct dosdate_t sd; */ /***************************************************************************/ /* This function will open the listing file. */ @@ -118,8 +123,13 @@ int open_listing (char name[]) /* strcpy (path,searchpath(name)); */ - /*getdate (&sd); - gettime (&st); */ + GetSystemTime(&st); + dwVersion = GetVersion(); + dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); + dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); + if (dwVersion < 0x80000000) + dwBuild = (DWORD)(HIWORD(dwVersion)); + /*gettime(&st); */ pos = strcspn (name,"."); @@ -138,21 +148,21 @@ int open_listing (char name[]) /* Print some useful data for the programmers sake */ /************************************************************/ - fprintf(LISTING,"Win32 (NT/95) dates, times, version-no's etc not yet ported.\n"); - fprintf(LISTING,"Please update LIST.C to remove this msg etc.\n"); - /* + /*fprintf(LISTING, "Win32 (NT/95) dates, times, version-no's etc not yet ported.\n"); + fprintf(LISTING,"Please update LIST.C to remove this msg etc.\n");*/ + fprintf (LISTING,"Copyright (c) Hugh Gleaves 2006\n"); check_print(1); - fprintf (LISTING,"SOURCE FILE: %s\n",path); - check_print(1); - fprintf (LISTING,"COMPILED ON: %02d-%02d-%02d ",sd.day,sd.month,(sd.year-1900)); - fprintf (LISTING,"AT: %02d:%02d:%02d\n",st.hour,st.minute,st.second); + /*fprintf(LISTING, "SOURCE FILE: %s\n", path); + check_print(1);*/ + fprintf (LISTING,"COMPILED ON: %02d-%02d-%02d ",st.wYear,st.wMonth,st.wDay); + fprintf (LISTING,"AT: %02d:%02d:%02d\n",st.wHour,st.wMinute,st.wSecond); check_print(1); fprintf (LISTING,"COMPILED BY: PL/I Release %d.%d alpha\n",RMAJ,RMIN); check_print(1); - fprintf (LISTING,"OS RELEASE: %d.%d\n",_osmajor,_osminor); + fprintf (LISTING,"OS RELEASE: %d.%d\n",dwMajorVersion,dwMinorVersion); check_print(1); - */ + /*********************************************************************/ /* Print a summary of any selected compiler options. */ /*********************************************************************/ @@ -588,7 +598,7 @@ static void print_symbol (Symbol_ptr v_ptr) posn += 6; break; } - case(FLOAT): + case(D_FLOAT): { assign (buffer,posn,"float "); posn += 6; diff --git a/Compiler Source/PASS1.C b/Compiler Source/PASS1.C index ab3c96b..a5d5916 100644 --- a/Compiler Source/PASS1.C +++ b/Compiler Source/PASS1.C @@ -2416,7 +2416,7 @@ PARSER case(FIXED): - case(FLOAT): + case(D_FLOAT): { /* Verify scale not already seen */ if ((sym_ptr->scale) != 0) { @@ -3302,7 +3302,7 @@ PARSER break; } case(FIXED): - case(FLOAT): + case(D_FLOAT): { /* Verify scale not already seen */ if ((d_ptr->scale) != 0) { @@ -7810,7 +7810,7 @@ PARSER break; } case(FIXED): - case(FLOAT): + case(D_FLOAT): { /* Verify scale not already seen */ if ((sym_ptr->scale) != 0) { diff --git a/Compiler Source/PASS2.C b/Compiler Source/PASS2.C index f741fb3..57e639d 100644 --- a/Compiler Source/PASS2.C +++ b/Compiler Source/PASS2.C @@ -3667,8 +3667,8 @@ chur r_scale = o_ptr->scale; } - if ((l_scale == FLOAT) || (r_scale == FLOAT)) - return(FLOAT); + if ((l_scale == D_FLOAT) || (r_scale == D_FLOAT)) + return(D_FLOAT); else return(FIXED); @@ -4109,9 +4109,9 @@ Any_ptr if ((s_base == DECIMAL) && (s_scale == FIXED)) { - if ((t_base == DECIMAL) && (t_scale == FLOAT)) + if ((t_base == DECIMAL) && (t_scale == D_FLOAT)) return(cv_float_dec(op)); - if ((t_base == BINARY) && (t_scale == FLOAT)) + if ((t_base == BINARY) && (t_scale == D_FLOAT)) return(cv_float_bin(op)); if ((t_base == BINARY) && (t_scale == FIXED)) return(cv_fixed_bin(op)); @@ -4119,27 +4119,27 @@ Any_ptr if ((s_base == BINARY) && (s_scale == FIXED)) { - if ((t_base == DECIMAL) && (t_scale == FLOAT)) + if ((t_base == DECIMAL) && (t_scale == D_FLOAT)) return(cv_float_dec(op)); - if ((t_base == BINARY) && (t_scale == FLOAT)) + if ((t_base == BINARY) && (t_scale == D_FLOAT)) return(cv_float_bin(op)); if ((t_base == DECIMAL) && (t_scale == FIXED)) return(cv_fixed_dec(op)); } - if ((s_base == DECIMAL) && (s_scale == FLOAT)) + if ((s_base == DECIMAL) && (s_scale == D_FLOAT)) { if ((t_base == DECIMAL) && (t_scale == FIXED)) return(cv_fixed_dec(op)); - if ((t_base == BINARY) && (t_scale == FLOAT)) + if ((t_base == BINARY) && (t_scale == D_FLOAT)) return(cv_float_bin(op)); if ((t_base == BINARY) && (t_scale == FIXED)) return(cv_fixed_bin(op)); } - if ((s_base == BINARY) && (s_scale == FLOAT)) + if ((s_base == BINARY) && (s_scale == D_FLOAT)) { - if ((t_base == DECIMAL) && (t_scale == FLOAT)) + if ((t_base == DECIMAL) && (t_scale == D_FLOAT)) return(cv_float_dec(op)); if ((t_base == BINARY) && (t_scale == FIXED)) return(cv_fixed_bin(op)); diff --git a/Compiler Source/PLI.C b/Compiler Source/PLI.C index 90d9362..3f89d7d 100644 --- a/Compiler Source/PLI.C +++ b/Compiler Source/PLI.C @@ -58,17 +58,19 @@ /* Statistics for each phase are maintained and printed in here too. */ /****************************************************************************/ +#include "windows.h" #include #include #include -#include +#ifndef X64 + #include + #include "intaface.h" +#endif #include #include #include "ctype.h" #include "platform.h" #include "token.h" -#include "intaface.h" -#include "windows.h" # define SOURCE_HELP "Enter the name of the source file, the 'pl1' suffix is optional." # define LIST_HELP "Select this option, if you require a listing file." @@ -191,10 +193,10 @@ char except_msg[32]; /***************************************************************************/ /* Win32 Exception handling support. */ /***************************************************************************/ - long filterer (LPEXCEPTION_POINTERS); + /***************************************************************************/ /* Entry point for start of compilation. */ /***************************************************************************/ @@ -206,7 +208,6 @@ void main (long argcount,char * argvector[]) short status; char obj_file [128] = ""; - __try { listing_reqd = 0; @@ -223,8 +224,8 @@ __try { /***********************************************************************/ strcpy(program_path,_pgmptr); - - status = AquireCmdLineArgs +#ifndef X64 + status = AquireCmdLineArgs ("PL/I 32 Optimizing Compiler",argcount,argvector, "posn(source_file),length(64),string,required",SOURCE_HELP,file, "switch(list),color(9)",LIST_HELP,&listing_reqd, @@ -258,6 +259,40 @@ __try { printf ("An error ocurred processing the command line arguments.\n"); exit(0); } +#else + /*Replace lost source library with normal parsing of parameters */ + /*First argument must be the filename, with or without extension */ + /*Giuliano Vannini 2022-02-04*/ + if (argcount < 2) + { + printf("Specificare il nome del file\n"); + exit(0); + } + for (int i = 1; i < argcount; i++) + { + if (i == 1) strcpy(file, argvector[i]); + if(strcmp("+list" , argvector[i]) == 0) listing_reqd =1; + if(strcmp("+mapcase" , argvector[i]) == 0) mapcase_reqd = 1; + if(strcmp("+optimize" , argvector[i]) == 0) optimize_reqd = 1; + if(strcmp("+ndp" , argvector[i]) == 0) ndp_reqd = 1; + if(strcmp("+beep" , argvector[i]) == 0) beep_reqd = 1; + if(strcmp("+code" , argvector[i]) == 0) code_reqd = 1; + if(strcmp("+semantic" , argvector[i]) == 0) semantic_reqd = 1; + if(strcmp("+nesting" , argvector[i]) == 0) nesting_reqd = 1; + if(strcmp("+error" , argvector[i]) == 0) error_reqd = 1; + if(strcmp("+bounds" , argvector[i]) == 0) bounds_reqd = 1; + if(strcmp("+table" , argvector[i]) == 0) table_reqd = 1; + if(strcmp("+system" , argvector[i]) == 0) system_reqd = 1; + if(strcmp("+unrefs" , argvector[i]) == 0) unrefs_reqd = 1; + if(strcmp("+dump_nodes" , argvector[i]) == 0) dump_reqd = 1; + if(strcmp("+trace_heap" , argvector[i]) == 0) trace_heap = 1; + if(strcmp("+trace_pass2", argvector[i]) == 0) trace_pass2 = 1; + if(strcmp("+trace_code" , argvector[i]) == 0) trace_code = 1; + if(strcmp("+debug" , argvector[i]) == 0) debug_reqd = 1; + if(strcmp("+halt" , argvector[i]) == 0) halt_reqd = 1; + } + +#endif if (nesting_reqd || system_reqd) /* nesting implies listing */ listing_reqd = 1; @@ -495,7 +530,6 @@ __except (filterer(GetExceptionInformation() )) exit(0); } - } /****************************************************************************/ diff --git a/Compiler Source/TOKENS.H b/Compiler Source/TOKENS.H index bfba075..edc14d8 100644 --- a/Compiler Source/TOKENS.H +++ b/Compiler Source/TOKENS.H @@ -42,7 +42,7 @@ # define BASED 12 /* based */ # define STATIC 13 /* static */ # define FIXED 14 /* fixed */ -# define FLOAT 15 /* float */ +# define D_FLOAT 15 /* float */ # define LPAR 16 /* ( */ # define RPAR 17 /* ) */ # define MINUS 18 /* - */ diff --git a/PLI.EXE b/PLI.EXE index 86022b0..3da3577 100644 Binary files a/PLI.EXE and b/PLI.EXE differ diff --git a/PLI2000.sln b/PLI2000.sln index 1246f80..14ac5e1 100644 --- a/PLI2000.sln +++ b/PLI2000.sln @@ -1,21 +1,30 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32106.194 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PLI2000", "PLI2000.vcxproj", "{336C83DC-1A57-467D-A823-9DC72DD6A4C4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Debug|Win32.ActiveCfg = Debug|Win32 {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Debug|Win32.Build.0 = Debug|Win32 + {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Debug|x64.ActiveCfg = Debug|x64 + {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Debug|x64.Build.0 = Debug|x64 {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Release|Win32.ActiveCfg = Release|Win32 {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Release|Win32.Build.0 = Release|Win32 + {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Release|x64.ActiveCfg = Release|x64 + {336C83DC-1A57-467D-A823-9DC72DD6A4C4}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {BA8D8308-98F7-41BD-8136-99F4B0E77C4F} + EndGlobalSection EndGlobal diff --git a/PLI2000.vcxproj b/PLI2000.vcxproj index f1d607b..4b28cde 100644 --- a/PLI2000.vcxproj +++ b/PLI2000.vcxproj @@ -5,10 +5,18 @@ Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {336C83DC-1A57-467D-A823-9DC72DD6A4C4} @@ -21,12 +29,24 @@ false MultiByte + + Application + v142 + false + MultiByte + Application v142 false MultiByte + + Application + v142 + false + MultiByte + @@ -34,10 +54,18 @@ + + + + + + + + <_ProjectFileVersion>12.0.30501.0 @@ -47,11 +75,17 @@ .\Debug\ false + + false + .\Release\ .\Release\ false + + false + .\Debug/PLI2000.tlb @@ -91,6 +125,46 @@ MachineX86 + + + .\Debug/PLI2000.tlb + + + + + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Default + + + .\Debug/PLI2000.pch + AssemblyAndMachineCode + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + odbc32.lib;odbccp32.lib;intaface.lib;%(AdditionalDependencies) + PLI.EXE + true + true + .\Debug/PLI.pdb + true + .\Debug/PLI.map + Console + + .\Release/PLI2000.tlb @@ -99,7 +173,7 @@ MaxSpeed OnlyExplicitInline - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_X86_;%(PreprocessorDefinitions) true MultiThreaded true @@ -124,6 +198,42 @@ MachineX86 + + + .\Release/PLI2000.tlb + + + + + MaxSpeed + OnlyExplicitInline + _AMD64_;X64;%(PreprocessorDefinitions) + true + MultiThreaded + true + + + .\Release/PLI2000.pch + .\Release/ + .\Release/ + .\Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + + + PLI.exe + true + .\Release/PLI.pdb + Console + + +