home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDGE1_704.DMS / in.adf / ExtraStuff / Edge_SasC.lha / rexx / hn_readerr.edge < prev    next >
Encoding:
Text File  |  1993-10-23  |  2.4 KB  |  93 lines

  1. /* Edge macro: hn_readerr
  2. **
  3. ** $VER: hn_readerr.edge 1.6 (Saturday 23-Oct-93 13:22:24)
  4. **
  5. ** Usage:    hn_readerr [<errorfile>|PROJECT|COMPILE|LINK],[<filename>],[0|1|LINK]
  6. **           <errorfile> : input from errorfile
  7. **           PROJECT     : read errors from current build-errorfile
  8. **           COMPILE     : read errors from current compile-errorfile
  9. **           <filename>  : source-filename
  10. **           LINK        : Supress requesters if all is OK..
  11. **           Default     : COMPILE,<currentfile>,0
  12. **
  13. ** Synopsis: Read errors to current file
  14. **           Select errorfile and parser according to current filename
  15. **           and arguments.
  16. **
  17. ** Author:   Henrik Nordström
  18. **           Ängsvägen 1
  19. **           S 756 45 Uppsala
  20. */
  21.  
  22. options results
  23.  
  24. parse arg mode,filename,linkflag
  25.  
  26. parse source . . . rexxfile .
  27. st=lastpos('/',rexxfile)
  28. if st=0 then st=lastpos(':',rexxfile)
  29. rexxdir=left(rexxfile,st)
  30.  
  31. 'clearerr'
  32.  
  33. /*FS:Init*/
  34. mode=upper(mode)
  35. linkflag=upper(linkflag)
  36.  
  37. if mode="" then mode="COMPILE"
  38. if mode='LINKONLY' then mode='LINK' /* simplify checking a bit...*/
  39.  
  40. if linkflag="" then 
  41.    if mode='LINK' then linkflag=1
  42.    else linkflag=0
  43. if linkflag='LINK' then linkflag=1
  44.  
  45. if filename="" then do
  46.   'getenvvar _fe_name'
  47.   filename = result
  48. end
  49. parse var filename name '.' type
  50. type=upper(type)
  51.  
  52. select
  53.  when mode='PROJECT' then do
  54.    'getenvvar _fe_user9'
  55.    parse var result dir ',' name ',' arguments
  56.    if name=="" then do /* Get name from last component in path */
  57.      name=strip(dir,'T','/');st=lastpos('/',name)
  58.      if st==0 then st=lastpos(':',name)
  59.      name=substr(name,st+1)
  60.      end
  61.    errorname='t:build_'||name
  62.    end
  63.  when mode='COMPILE' | mode='LINK' then do
  64.    errorname='t:cm_'||name
  65.    end
  66.  otherwise errorname=mode
  67. end
  68. /*FE:Init*/
  69.  
  70. /*FS:Translate 'Equal' modes */
  71. select
  72.  when type='C' then type='C'
  73.  when type='ASM' then type='ASM'
  74.  when type='S' then type='ASM'
  75.  when type='A' then type='ASM'
  76.  otherwise type=type
  77. end
  78. /*FE:Translate...*/
  79.  
  80. /*FS:Call errorparser */
  81. if exists(rexxdir'hn_readerr_'type'.edge') then do
  82.    interpret call ''''rexxdir'hn_readerr_'type'.edge''('''errorname''','''filename''','''linkflag''')'
  83.    compilefail=RESULT
  84. end
  85. else do
  86.    'adderr 1 0 "can''t parse errors: No errorparser found for filetype **.'type'"'
  87.    'requestnotify "can''t parse errors:*nNo errorparser found for filetype **.'type'"'
  88.    compilefail=RC+5
  89. end
  90. /*FE:Call...*/
  91.  
  92. return compilefail
  93.