Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Compiler Source/DECLARE.C
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/******************************************************************/
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion Compiler Source/DT.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
38 changes: 24 additions & 14 deletions Compiler Source/LIST.C
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include <dos.h>
/* #include <dir.h> */
#include "options.h"
#include <sysinfoapi.h>

/***************************************************************************/
/* 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 */
Expand Down Expand Up @@ -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. */
Expand All @@ -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,".");

Expand All @@ -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. */
/*********************************************************************/
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions Compiler Source/PASS1.C
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ PARSER


case(FIXED):
case(FLOAT):
case(D_FLOAT):
{ /* Verify scale not already seen */
if ((sym_ptr->scale) != 0)
{
Expand Down Expand Up @@ -3302,7 +3302,7 @@ PARSER
break;
}
case(FIXED):
case(FLOAT):
case(D_FLOAT):
{ /* Verify scale not already seen */
if ((d_ptr->scale) != 0)
{
Expand Down Expand Up @@ -7810,7 +7810,7 @@ PARSER
break;
}
case(FIXED):
case(FLOAT):
case(D_FLOAT):
{ /* Verify scale not already seen */
if ((sym_ptr->scale) != 0)
{
Expand Down
20 changes: 10 additions & 10 deletions Compiler Source/PASS2.C
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -4109,37 +4109,37 @@ 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));
}

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));
Expand Down
50 changes: 42 additions & 8 deletions Compiler Source/PLI.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,19 @@
/* Statistics for each phase are maintained and printed in here too. */
/****************************************************************************/

#include "windows.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
#ifndef X64
#include <dos.h>
#include "intaface.h"
#endif
#include <time.h>
#include <stdio.h>
#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."
Expand Down Expand Up @@ -191,10 +193,10 @@ char except_msg[32];
/***************************************************************************/
/* Win32 Exception handling support. */
/***************************************************************************/

long filterer (LPEXCEPTION_POINTERS);



/***************************************************************************/
/* Entry point for start of compilation. */
/***************************************************************************/
Expand All @@ -206,7 +208,6 @@ void main (long argcount,char * argvector[])
short status;
char obj_file [128] = "";


__try {

listing_reqd = 0;
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -495,7 +530,6 @@ __except (filterer(GetExceptionInformation() ))
exit(0);
}


}

/****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion Compiler Source/TOKENS.H
Original file line number Diff line number Diff line change
Expand Up @@ -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 /* - */
Expand Down
Binary file modified PLI.EXE
Binary file not shown.
13 changes: 11 additions & 2 deletions PLI2000.sln
Original file line number Diff line number Diff line change
@@ -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
Loading