procedure nextch; (*read next character; process line end*)
writeln(' program incomplete');
begin writeln; errpos := 0
begin ll := ll+1; read(ch); write(ch); line[ll] := ch
writeln; ll := ll+1; read(line[ll])
cc := cc+1; ch := line[cc];
procedure insymbol; (*reads next symbol*)
begin nextch; sign := 1; s := 0;
if ch = '+' then nextch else
if ch = '-' then begin nextch; sign := -1 end ;
while ch in ['0'..'9'] do
begin s := 10*s + ord(ch) - ord('0'); nextch
var s: integer; d,t: real;
begin if k+e > emax then error(21) else
if k+e < emin then rnum := 0 else
begin s := abs(e); t := 1.0; d := 10.0;
begin s := s div 2; d := sqr(d)
if e >= 0 then rnum := rnum*t else rnum := rnum/t
1: while (ch = ' ') or (ch = TAB) do nextch;
begin (*identifier or wordsymbol*) k := 0; id := ' ';
begin k := k+1; id[k] := ch
until not (ch in ['a'..'z','0'..'9']);
i := 1; j := nkw; (*binary search*)
if id <= key[k] then j := k-1;
if id >= key[k] then i := k+1
if i-1 > j then sy := ksy[k] else sy := ident
begin (*number*) k := 0; inum := 0; sy := intcon;
repeat inum := inum*10 + ord(ch) - ord('0');
until not (ch in ['0'..'9']);
if (k > kmax) or (inum > nmax) then
begin error(21); inum := 0; k := 0
if ch = '.' then ch := ':' else
begin sy := realcon; rnum := inum; e := 0;
while ch in ['0'..'9'] do
rnum := 10.0*rnum + (ord(ch)-ord('0')); nextch
if ch = 'e' then readscale;
if e <> 0 then adjustscale
begin sy := realcon; rnum := inum; e := 0;
readscale; if e <> 0 then adjustscale
begin sy := becomes; nextch
if ch = '=' then begin sy := leq; nextch end else
if ch = '>' then begin sy := neq; nextch end else sy := lss
if ch = '=' then begin sy := geq; nextch end else sy := gtr
begin sy := colon; nextch
begin nextch; if ch <> '''' then goto 3
if sx+k = smax then fatal(7);
stab[sx+k] := ch; k := k+1;
begin (*end of line*) k := 0;
begin sy := charcon; inum := ord(stab[sx])
begin error(38); sy := charcon; inum := 0
begin sy := string; inum := sx; sleng := k; sx := sx+k
if ch <> '*' then sy := lparent else
begin (*comment*) nextch;
while ch <> '*' do nextch;
'+', '-', '*', '/', ')', '=', ',', '[', ']', '#', '&', ';' :
begin sy := sps[ch]; nextch
'$', '\', '!', '?', '@', '_', '"', '^' :
begin error(24); nextch; goto 1