home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Programming / vahunz / tschak / scan_javadoc.e < prev    next >
Encoding:
Text File  |  1999-08-16  |  2.0 KB  |  74 lines

  1. indexing
  2.    author: "Thomas Aglassinger <agi@giga.or.at>";
  3.    copyright: "Public domain.";
  4.    amiga_version: "$VER scan_javadoc 1.0 (13.8.99)";
  5.    description: "A little tool included with vahunz invoked by %
  6.                 %Vahunz-Tschak to create a java dignorary from Javadoc %
  7.                 %index files in HTML format.";
  8.    compiler: "Compiled with SmallEiffel -0.78";
  9.  
  10. class SCAN_JAVADOC
  11.  
  12. creation {ANY} 
  13.    make
  14.  
  15. feature {NONE} 
  16.    
  17.    identifier_of(line: STRING): STRING is 
  18.       -- Java identifier in a line matching the pattern
  19.       -- "<A HREF=...<B>identifier</B>..." or `Void' of none.
  20.       require 
  21.          line /= Void; 
  22.       local 
  23.          first_b: INTEGER;
  24.          last_b: INTEGER;
  25.          bracket: INTEGER;
  26.          period: INTEGER;
  27.       do  
  28.          if line.has_prefix("<DT><A HREF=%"") then 
  29.             first_b := line.index_of_string("<B>");
  30.             last_b := line.index_of_string("</B>");
  31.             Result := line.substring(first_b + 3,last_b - 1);
  32.             bracket := Result.index_of('(');
  33.             if bracket < Result.count + 1 then 
  34.                Result := Result.substring(1,bracket - 1);
  35.             end; 
  36.             period := Result.index_of('.');
  37.             if period < Result.count + 1 then 
  38.                Result := Result.substring(period + 1,Result.count);
  39.             end; 
  40.          end; 
  41.       end -- identifier_of
  42.    
  43.    stdin: expanded STD_INPUT;
  44.    
  45.    exceptions: expanded EXCEPTIONS;
  46.  
  47. feature {ANY} 
  48.    
  49.    make is 
  50.       -- Do it.
  51.       local 
  52.          name: STRING;
  53.       do  
  54.          from 
  55.          until 
  56.             stdin.end_of_input
  57.          loop 
  58.             stdin.read_line;
  59.             name := identifier_of(stdin.last_string);
  60.             if name /= Void then 
  61.                print("-");
  62.                print(name);
  63.                print("%N");
  64.             end; 
  65.          end; 
  66.       rescue 
  67.          if exceptions.is_signal then 
  68.             print("***Break%N");
  69.             exceptions.die(5);
  70.          end; 
  71.       end -- make
  72.  
  73. end -- class SCAN_JAVADOC
  74.