Предмет:
Тип роботи:
Курсова робота
К-сть сторінок:
82
Мова:
Українська
Str(Errors,S);
WriteOutput('');
WriteOutput(' Errors :'+S);
end;
end;
end.
Params1.pas
unit params1;
{$I SWITCHES.INC}
interface
uses dos,globals,util;
procedure syntax_exit(msg:string);
procedure parse_params;
implementation
procedure syntax_exit(msg:string);
var
junk : char;
begin
{$I-}
WriteError(msg);
if textrec(output).handle<>1 then
begin
Close(output);
Assign(output,'CON');
Rewrite(output);
end;
{ writeln('Use /Tpath[;path] to set the Turbo directory for ',tpl_name);
writeln(' and referenced units.');
writeln('E.G. To see all but the relocation records in the system unit, use');
writeln(' INTRFC /AR /T\bp\bin;\bp\units SYSTEM ');
writeln('The default is just the names in the interface section.');}
readln;
halt(1);
end;
procedure toggle(o:option);
begin
if o in active_options then
active_options := active_options - [o]
else
active_options := active_options + [o];
end;
procedure parse_params;
var
p : string;
i : integer;
path : dirstr;
name : namestr;
begin
{i := 1;
unitname := '';
uses_path := '';
for i := 1 to paramcount do
begin
p := paramstr(i);
if p[1] <> '/' then
begin
if unitname='' then
begin
unitname := upper(p);
fsplit(unitname,path,name,unit_ext);
unitname := path+name;
if unit_ext='' then
unit_ext:='.TPU';
if unit_ext='.TPU' then
tpl_name:='TURBO.TPL'
else if unit_ext='.TPP' then
tpl_name:='TPP.TPL'
else if unit_ext='.TPW' then
tpl_name:='TPW.TPL'
else
HaltError('Invalid extension (TPU,TPP,TPW)');
end
else
begin}
{$I-}
{Close(output);}
unitname:='g:\U152.tpu';
fsplit(unitname,path,name,unit_ext);
unitname := path+name;
tpl_name:='TURBO.TPL';
active_options := [do_header..do_locals];
p:='g:\zu.dat';
Assign(output,p);
Rewrite(output);
if IOResult<>0 then
HaltError('Cannot write to file '+P);
{$I+}
{end;
end
else
begin
p := copy(p,2,255);} { strip off the / }
{while length(p) > 0 do
begin
case upcase(p[1]) of
'A' : active_options := [do_header..do_locals];
'B' : toggle(do_code);
'C' : toggle(do_const_blocks);
'D' : toggle(do_code_blocks);
'E' : toggle(do_entry_pts);
'G' : toggle(do_const);
'H' : toggle(do_header);
'I' : toggle(do_implementation);
'L' : toggle(do_locals);
'M' : toggle(do_src_lines);
'N' : toggle(do_name_list);
'O' : toggle(do_vmt);
'R' : toggle(do_reloc);
'S' : toggle(do_src_files);
'U' : toggle(do_unit_blocks);
'V' : toggle(do_var_blocks);
'W' : toggle(do_dll_blocks);
'Z' : toggle(do_browser);
'T' : begin
uses_path := upper(copy(p,2,255));
p := '';
end;
else
syntax_exit('Unrecognized option '+paramstr(i)+'.');
end;
p := copy(p,2,255);
end;
end;
end;
if unitname = '' then
syntax_exit('Unit name not specified.');}
end;
end.
Util.pas
unit nametype;
{$I SWITCHES.INC}
{ Unit of