home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / prog / arexx / cygcc.lha / ReadErrors < prev    next >
Encoding:
Text File  |  1990-08-24  |  1.5 KB  |  76 lines

  1. /********************CYGCC***************/
  2. options results
  3. arg err_file,file_type
  4. nl='0A'X
  5. flag_char='9B'X
  6. esc_char='1B'X
  7. if ~FindWind('Compiler_Window') then do
  8. 'okay1 unable to find Compiler_Window'
  9. exit
  10. end
  11. if~open(infile,err_file,'READ') then do
  12. 'OKAY1 unable to open file:'err_file
  13. exit
  14. end
  15. line_count=0
  16. err_count=0
  17. column=0
  18. instring=readln(infile)
  19. do until eof(infile)
  20. line_count=line_count+1
  21. if line_count>2 then
  22. if file_type='LINK' then
  23. call ReadLinkError()
  24. else do
  25. flag_pos=index(instring,flag_char)
  26. if flag_pos>0 then
  27. call ProcessFlagLine()
  28. else
  29. call ProcessOtherLine()
  30. end
  31. instring=readln(infile)
  32. end
  33.  
  34. cl_res=close(infile)
  35. address command 'delete' err_file
  36. return err_count
  37.  
  38. ReadLinkError:
  39. if index(instring,esc_char)>0,
  40. | index(upper(instring),'ERROR')>0 then
  41. err_count=err_count+1
  42. if instring~='' then
  43. 'Text' instring||nl
  44. return
  45.  
  46. ProcessFlagLine:
  47. if index(instring,'Stack Overflow')>0 then do
  48. 'Text System  <<<STACK OVERFLOW>>>*'||nl
  49. err_count=err_count+1
  50. end;else do
  51. column=flag_pos
  52. end
  53. return
  54.  
  55. ProcessOtherLine:
  56. if column>0 then do
  57. parse var instring fname line_num severity . message
  58. 'Text' left(severity,9) '<<<'||message'>>>',
  59. fname line_num column||nl
  60. if severity ~='Warning' then err_count=err_count+1
  61. column=0
  62. end ; else do
  63. parse var instring firstword  .
  64. if firstword='Module' then
  65. 'Text' instring||nl
  66. else do
  67. err_count=err_count+1
  68. if firstword='CXERR:' then
  69. 'Text Internal <<<Error number:',
  70. line_num'>>> * '||nl
  71. else
  72. 'Text Operation <<<' instring '>>>*'||nl
  73. end 
  74. end
  75. return
  76.