[BACK]Return to symbol_table_io.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials

Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Polynomials/symbol_table_io.adb, Revision 1.1.1.1

1.1       maekawa     1: package body Symbol_Table_io is
                      2:
                      3:   procedure get ( sb : in out symbol ) is
                      4:   begin
                      5:     Symbol_Table_io.get(Standard_Input,sb);
                      6:   end get;
                      7:
                      8:   procedure get ( sb : in out symbol; delimiter : in character ) is
                      9:   begin
                     10:     Symbol_Table_io.get(Standard_Input,sb,delimiter);
                     11:   end get;
                     12:
                     13:   procedure get ( ch : in out character; sb : in out symbol ) is
                     14:   begin
                     15:     Symbol_Table_io.get(Standard_Input,ch,sb);
                     16:   end get;
                     17:
                     18:   procedure get ( ch : in out character; sb : in out symbol;
                     19:                   delimiter : in character ) is
                     20:   begin
                     21:     Symbol_Table_io.get(Standard_Input,ch,sb,delimiter);
                     22:   end get;
                     23:
                     24:   procedure get ( file : in file_type; sb : in out symbol ) is
                     25:
                     26:     ch : character;
                     27:
                     28:   begin
                     29:     text_io.get(file,ch);
                     30:     Symbol_Table_io.get(file,ch,sb);
                     31:   end get;
                     32:
                     33:   procedure get ( file : in file_type; sb : in out symbol;
                     34:                   delimiter : in character ) is
                     35:
                     36:     ch : character;
                     37:
                     38:   begin
                     39:     text_io.get(file,ch);
                     40:     Symbol_Table_io.get(file,ch,sb,delimiter);
                     41:   end get;
                     42:
                     43:   procedure get ( file : in file_type; ch : in out character;
                     44:                   sb : in out symbol ) is
                     45:
                     46:     cnt : natural;
                     47:
                     48:   begin
                     49:     if ch = ' '
                     50:      then while ch = ' ' loop
                     51:             text_io.get(file,ch);
                     52:           end loop;
                     53:           if ch /= ' '
                     54:            then sb(sb'first) := ch; cnt := 2;
                     55:           end if;
                     56:      else sb(sb'first) := ch; cnt := 2;
                     57:     end if;
                     58:     if not End_of_Line(file)
                     59:      then
                     60:        for i in sb'first+1..sb'last loop
                     61:          text_io.get(file,ch); cnt := i;
                     62:          exit when ch = ' ';
                     63:          sb(i) := ch; cnt := i+1;
                     64:          exit when End_of_Line(file);
                     65:        end loop;
                     66:     end if;
                     67:     sb(cnt..sb'last) := (cnt..sb'last => ' ');
                     68:   end get;
                     69:
                     70:   procedure get ( file : in file_type; ch : in out character;
                     71:                   sb : in out symbol; delimiter : in character ) is
                     72:
                     73:     cnt : natural;
                     74:
                     75:   begin
                     76:     if ch = ' '
                     77:      then while ch = ' ' loop
                     78:             text_io.get(file,ch);
                     79:           end loop;
                     80:           if ch /= ' '
                     81:            then sb(sb'first) := ch; cnt := 2;
                     82:           end if;
                     83:      else sb(sb'first) := ch; cnt := 2;
                     84:     end if;
                     85:     if not End_of_Line(file)
                     86:      then
                     87:        for i in sb'first+1..sb'last loop
                     88:          text_io.get(file,ch); cnt := i;
                     89:          exit when ch = ' ' or else ch = delimiter;
                     90:          sb(i) := ch; cnt := i+1;
                     91:          exit when End_of_Line(file);
                     92:        end loop;
                     93:     end if;
                     94:     sb(cnt..sb'last) := (cnt..sb'last => ' ');
                     95:   end get;
                     96:
                     97:   procedure put ( sb : in symbol ) is
                     98:   begin
                     99:     for i in sb'range loop
                    100:       exit when sb(i) = ' ';
                    101:       text_io.put(sb(i));
                    102:     end loop;
                    103:   end put;
                    104:
                    105:   procedure put ( file : in file_type; sb : in symbol ) is
                    106:   begin
                    107:     for i in sb'range loop
                    108:       exit when sb(i) = ' ';
                    109:       text_io.put(file,sb(i));
                    110:     end loop;
                    111:   end put;
                    112:
                    113: end Symbol_Table_io;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>