programa, komentaras program pss2pas; { Programa pritaiko lietuviÕko transliatoriaus programÐ Turbo Paskalio kompilia toriui } var f, { duomenÖ byla } t : text; { rezultatÖ byla } { simboliÖ keit imo masyvas } mas : array[ chr( 0 )..chr( 255 ) ] of string[ 4 ]; c : char; st : s tring[ 4 ]; const Rim_2_775 : array[ 128..255 ] of byte = ( ); procedure versti; var b : ( programa, komentaras, eilute ); st, rez : string; i : integer; begin b := prog rama; st := Paramstr( 1 ); st[ length( st ) - 1 ] := 'a'; { *.pss -> *.pas } Assign( t, st ); Rewrite( t ); while not eof( f ) do begin readln( f, st ); rez := ''; i := 1; while i <= length( st ) do begin if st[ i ] = '{' then begin if b = programa then b := komentaras; rez := rez + '{' end else if st[ i ] = '}' then begin if b = komentaras th en b := programa; rez := rez + '}' end else i f st[ i ] = '''' then begin if b = programa then b := eilut e else if b = eilute then b := programa; rez := re z + '''' end else if b = programa then rez := rez + mas[ st[ i ] ] { keisti } else rez := rez + st[ i ]; { nekeisti } inc( i ) end; writeln( t, rez ) end; Close( f ); Close( t ) end;begin if Paramcou nt = 0 then begin writeln( 'Reikalingi parametrai.' ); writeln( 'Naudojimas:' ); writeln( 'pss2pas ' ); writeln( 'Antrasis parametras yr a neb×tinas.' ) end else begin {$I-} Assign( f, ParamStr( 1 ) ); Reset( f ); {$I+} if IOresult <> 0 then writeln( 'NeÔmanoma nu skaityti nurodytos PSS bylos' ) else begin for c := chr( 0 ) to chr( 2 55 ) do mas[ c ] := c; mas[ '_' ] := 'b_'; if Paramcount >= 2 then begin {$I-} Assign( t, ParamStr( 2 ) ); Reset( t ); {$I+} if IOResult <> 0 then begin write( 'NeÔmanoma nuskaityti nurodytos'); writeln( ' LNT byl os'); exit end else while not eof( t ) do begin readln( t, c, st ); mas[ c ] := st; end; Close( t ); end else begin {BalticRIM} mas[ 'À ' ] := 'A_'; mas[ 'à' ] := 'a_'; mas[ 'È' ] := 'C_'; mas[ 'è' ] := 'c_'; mas[ 'Æ' ] := 'E_'; mas[ 'æ' ] := 'e_'; mas[ ' Ë' ] := 'E__';mas[ 'ë' ] := 'e__'; mas[ 'Á' ] := 'I_'; mas[ 'á' ] := 'i_' ; mas[ 'Ð' ] := 'S_'; mas[ 'ð' ] := 's_'; mas[ 'Ø' ] := 'U_'; mas[ 'ø' ] := 'u_'; mas[ 'Û' ] := 'U__';mas[ 'û' ] := 'u_ _'; mas[ 'Þ' ] := 'Z_'; mas[ 'þ' ] := 'z_'; end; versti; end endend.