improved parser, fixed convertation

This commit is contained in:
ALEXks
2024-02-25 11:16:56 +03:00
parent deaeb4a670
commit 4386eb7041
13 changed files with 259 additions and 152 deletions

View File

@@ -80,6 +80,7 @@ extern int iacross;
extern "C" int out_free_form;
extern "C" int out_upper_case;
extern "C" int out_line_unlimit;
extern "C" int out_line_length;
extern "C" PTR_SYMB last_file_symbol;
Options options;
@@ -280,6 +281,11 @@ int main(int argc, char *argv[])
out_upper_case = 1;
else if (!strcmp(argv[0], "-noLimitLine"))
out_line_unlimit = 1;
else if (!strcmp(argv[0], "-uniForm"))
{
out_free_form = 1;
out_line_length = 72;
}
else if (!strcmp(argv[0], "-noRemote"))
options.setOn(NO_REMOTE);
else if (!strcmp(argv[0], "-lgstd"))
@@ -365,6 +371,11 @@ int main(int argc, char *argv[])
(void)fprintf(stderr, "Warning: -Ohost option is set to -Opl2 mode\n");
options.setOn(O_HOST);
}
if(out_free_form == 1 && out_line_length == 72 && out_line_unlimit == 1)
{
(void)fprintf(stderr, "Warning: -noLimitLine and -uniForm options are incompatible; -noLimitLine option is ignored\n");
out_line_unlimit = 0;
}
if (v_print)
(void)fprintf(stderr, "<<<<< Translating >>>>>\n");
@@ -392,7 +403,7 @@ int main(int argc, char *argv[])
// for call of function 'tpoint'
//added one symbol to input-file name
//printf("%s",fin_name); //!!! debug
if(a_mode && project.numberOfFiles()>1)
if(a_mode || project.numberOfFiles()>1)
fout_name = doOutFileName(file->filename()); //project.fileName(id);
else if (fout_name && source_name && !strcmp(source_name, fout_name))
{
@@ -582,6 +593,7 @@ void initialize()
out_free_form = 0;
out_upper_case = 0;
out_line_unlimit = 0;
out_line_length = 132;
default_integer_size = 4;
default_real_size = 4;
unparse_functions = 0; //set to 1 by option -byFunUnparse