File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials / symbol_table_io.adb (download)
Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:27 2000 UTC (23 years, 10 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD Changes since 1.1: +0 -0
lines
Import the second public release of PHCpack.
OKed by Jan Verschelde.
|
package body Symbol_Table_io is
procedure get ( sb : in out symbol ) is
begin
Symbol_Table_io.get(Standard_Input,sb);
end get;
procedure get ( sb : in out symbol; delimiter : in character ) is
begin
Symbol_Table_io.get(Standard_Input,sb,delimiter);
end get;
procedure get ( ch : in out character; sb : in out symbol ) is
begin
Symbol_Table_io.get(Standard_Input,ch,sb);
end get;
procedure get ( ch : in out character; sb : in out symbol;
delimiter : in character ) is
begin
Symbol_Table_io.get(Standard_Input,ch,sb,delimiter);
end get;
procedure get ( file : in file_type; sb : in out symbol ) is
ch : character;
begin
text_io.get(file,ch);
Symbol_Table_io.get(file,ch,sb);
end get;
procedure get ( file : in file_type; sb : in out symbol;
delimiter : in character ) is
ch : character;
begin
text_io.get(file,ch);
Symbol_Table_io.get(file,ch,sb,delimiter);
end get;
procedure get ( file : in file_type; ch : in out character;
sb : in out symbol ) is
cnt : natural;
begin
if ch = ' '
then while ch = ' ' loop
text_io.get(file,ch);
end loop;
if ch /= ' '
then sb(sb'first) := ch; cnt := 2;
end if;
else sb(sb'first) := ch; cnt := 2;
end if;
if not End_of_Line(file)
then
for i in sb'first+1..sb'last loop
text_io.get(file,ch); cnt := i;
exit when ch = ' ';
sb(i) := ch; cnt := i+1;
exit when End_of_Line(file);
end loop;
end if;
sb(cnt..sb'last) := (cnt..sb'last => ' ');
end get;
procedure get ( file : in file_type; ch : in out character;
sb : in out symbol; delimiter : in character ) is
cnt : natural;
begin
if ch = ' '
then while ch = ' ' loop
text_io.get(file,ch);
end loop;
if ch /= ' '
then sb(sb'first) := ch; cnt := 2;
end if;
else sb(sb'first) := ch; cnt := 2;
end if;
if not End_of_Line(file)
then
for i in sb'first+1..sb'last loop
text_io.get(file,ch); cnt := i;
exit when ch = ' ' or else ch = delimiter;
sb(i) := ch; cnt := i+1;
exit when End_of_Line(file);
end loop;
end if;
sb(cnt..sb'last) := (cnt..sb'last => ' ');
end get;
procedure put ( sb : in symbol ) is
begin
for i in sb'range loop
exit when sb(i) = ' ';
text_io.put(sb(i));
end loop;
end put;
procedure put ( file : in file_type; sb : in symbol ) is
begin
for i in sb'range loop
exit when sb(i) = ' ';
text_io.put(file,sb(i));
end loop;
end put;
end Symbol_Table_io;