home *** CD-ROM | disk | FTP | other *** search
-
- procedure update_filename (ext : extension);
-
- begin
- if (ext <> '') then
- begin
- if (pos('.',filename) <> 0) then
- delete(filename,pos('.',filename),12);
- filename := filename + '.' + ext;
- end;
- for i := 1 to length(filename) do
- filename[i] := upcase(filename[i]);
- end;
-
-
-
- function exist (name: Dateiname) : boolean;
-
- var
- test : file;
-
- begin
- assign(test,name);
- (*$I-*)
- reset(test);
- (*$I+*)
- exist := (ioresult=0);
- end;
-
-
-
- procedure syntax_check (s : awtyp);
-
- var
- oende,
- pende,
- zende : boolean;
- operationstr,
- operandstr,
- zahlstr : awtyp;
-
- begin
- oende := false;
- pende := false;
- sende := false;
- zende := false;
- status := 0;
- operationstr := '';
- operandstr := '';
- zahlstr := '';
-
- for i := 1 to length(s) do
- begin
- case s[i] of
- 'A','M','T','Z',
- 'E','I' : if not pende then
- begin
- oende := true;
- operandstr := operandstr + s[i];
- end
- else
- zahlstr := zahlstr + s[i];
- 'L' : if (operationstr[1] in ['S','R']) then
- operationstr := operationstr + s[i]
- else
- if not pende then
- begin
- oende := true;
- operandstr := operandstr + s[i];
- end
- else
- zahlstr := zahlstr + s[i];
-
- '0'..'9' : begin
- pende := true;
- zahlstr := zahlstr + s[i];
- end;
- else
- if not oende then
- operationstr := operationstr + s[i]
- else
- if not pende then
- operandstr := operandstr + s[i]
- else
- zahlstr := zahlstr + s[i];
-
- end;
- end;
-
- if (length(operationstr) = 0) then
- status := -3;
-
- if (status = 0) then
- begin
- j := 0;
- for i := 1 to maxoperationen do
- if (operationstr = operationen[i]) then
- j := i;
- if (j = 0) then
- status := -4
- else
- status := 0;
- if (j = 3) then
- if (operandstr > '') then
- status := -5;
- if (j < 6) then
- sende := true;
- if (j > 9) then
- zende := true;
- if (j = 10) and (operandstr[1] = 'E') then
- begin
- operationstr := 'PE';
- operandstr := '';
- end;
- if (j = 12) then
- klammern := pred(klammern);
- if (j > 12) then
- klammern := succ(klammern);
-
- end;
-
- if (status = 0) then
- begin
- if zende and ((length(operandstr) > 0) or (length(zahlstr) > 0)) then
- status := -5;
- if not zende then
- if (length(operandstr) = 0) and (j <> 3) then
- status := -7
- else
- if (length(zahlstr) = 0) then
- status := -9;
- end;
-
- if (status = 0) and (j <> 3) and not zende then
- if (length(operandstr)=1) and (operandstr[1] in ['E','A','M','T','Z','L','I']) then
- status := 0
- else
- status := -6;
-
- if (status = 0) and not zende then
- begin
- status := -8;
- val(zahlstr,i,ii);
- if (ii = 0) then
- begin
- status := -10;
- if (j <> 3) then
- begin
- case operandstr[1] of
- 'E' : if (i <= maxe) then
- begin
- status := 0;
- if (maxopr[1] < i) then
- maxopr[1]:= i;
- end;
- 'A' : if (i <= maxa) then
- begin
- status := 0;
- if (maxopr[2] < i) then
- maxopr[2]:= i;
- end;
- 'M' : if (i <= maxm) then
- begin
- status := 0;
- if (maxopr[3] < i) then
- maxopr[3]:= i;
- end;
- 'T' : if (i <= maxt) then
- begin
- status := 0;
- if (maxopr[4] < i) then
- maxopr[4]:= i;
- end;
- 'Z' : if (i <= maxz) then
- begin
- status := 0;
- if (maxopr[5] < i) then
- maxopr[5]:= i;
- end;
- 'I' : if (i <= maxz) then
- begin
- status := 0;
- if (maxopr[6] < i) then
- maxopr[6]:= i;
- end;
- 'L' : if (i <= maxz) then
- begin
- status := 0;
- if (maxopr[7] < i) then
- maxopr[7]:= i;
- end;
- end;
- end
- else
- if (i <= maxaw) then
- status := 0;
- end;
- end;
-
- if (status = 0) then
- begin
- with awl[anzaw] do
- begin
- operation := operationstr;
- if zende then
- begin
- operand := '';
- kennzahl := -1;
- end
- else
- begin
- operand := operandstr;
- kennzahl := i;
- end;
- end;
- if (operationstr = 'PE') then
- status := 1;
- end;
- gotoxy (17, 4);
- write (' - ',operationstr,' ',operandstr,' ',zahlstr,' ');
- end;
-
-
-
- procedure fehlerbehandlung;
-
- begin
- gotoxy ( 2, 6);
- write ('Fehler entdeckt - ');
- writeln(fehlermeldung[abs(status)]);
-
- if (status < -2) then
- begin
- gotoxy ( 2, 8);
- write ('Neue Anweisung : ');
- readln (aw);
- if (aw > ' ') then
- begin
- status := 2;
- anzaw := pred(anzaw);
- korrektur := true;
- gotoxy ( 1, 6);
- clreol;
- gotoxy ( 1, 8);
- clreol;
- end;
- end;
- end;