home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / clarion / brfcla2.zip / CLAINITL.INC < prev    next >
Text File  |  1989-06-07  |  4KB  |  93 lines

  1. ;;* Macros to provide support for Clarion Compiler and error detection
  2. ;;*   when compiling from within BRIEF. SEE ALSO CCOMPILE.M for further
  3. ;;*   information on installation.
  4. ;;* Written by: 
  5. ;;*            Kevin Baradet 
  6. ;;*            Strategic Power Systems, Inc.
  7. ;;*            1717 Central Ave.
  8. ;;*            Albany, NY 12205-4725
  9. ;;*            (518) 452-7773  voice
  10. ;;*
  11. ;;*  Revision History:
  12. ;;*  =================
  13. ;;*       1-June-1989    Incept Date        Kevin Baradet
  14. ;;*
  15. ;;*  Installation
  16. ;;*  ============
  17. ;;* 1) Load the replacement CCOMPILE macro to provide Clarion support
  18. ;;*    Copy the following line into your initials macro above the (return)
  19. ;;*    macro :
  20. ;;*        (autoload "ccompile" "compile_it" "cc")
  21. ;;*    
  22. ;;* 2) Copy the following include directive at the end of your initials 
  23. ;;*    source code file:
  24. ;;*    #include "clainitl.inc"
  25. ;;* 3) Recompile your initals macro
  26.  
  27. ;;* Setup tabs for CLARION Language files
  28.  
  29. (macro .cla
  30.     (
  31.         (tabs 9 17)
  32.     )
  33. )
  34.  
  35. ;;* Clarion .MDL files
  36. (macro .mdl       
  37.     (
  38.         (tabs 9 17)
  39.     )
  40. )
  41.  
  42.  
  43. ;;***************************************************************************
  44. ;;*** Clarion specifc error_info macro follows:
  45. ;;***************************************************************************
  46.  
  47. (macro .cla_error_info                 ;;* Locates and parses CLARION CCMP
  48.    (                                   ;;*   error file msgs for (errorfix)
  49.    (string errtext)                    ;;* Declare string vars/parms
  50.    (int scol ecol errline errcol)      ;;* Declare numeric vars/parms
  51.    (save_position)                     ;;* Save current pos onto stack
  52.    (= errtext (read))                  ;;* Read the whole error line
  53.    (= scol (+ (index errtext "@") 1))  ;;* Where error line number starts
  54.    (= ecol (index errtext "/"))        ;;* Line number ends here
  55.                                        ;;* Extract substring containing
  56.                                        ;;*  line number and convert to an int
  57.    (= errline (atoi(substr errtext scol (- ecol scol)))) 
  58.    (= scol (+ ecol 1))                 ;;* Error column number starts here
  59.    (= ecol (index errtext ":"))        ;;*   and end here
  60.                                        ;;* Extract substring containing
  61.                                        ;;*   col number and convert to an int
  62.    (= errcol (atoi(substr errtext scol (- ecol scol))))
  63.    (move_abs NULL (+ ecol 1))          ;;* Skip over terminating colon
  64.    (search_fwd "[~ \\t]")              ;;* Search for start of error message
  65.    (inq_position NULL scol)            ;;* Save starting pos of error message
  66.    (= errtext (substr errtext scol))   ;;* Extract substring containing message
  67.  
  68.    ;(message "L%dC%d %s" errline errcol errtext) ;;* Diagnostic
  69.    (restore_position)                      ;;* Restore cursor to entry pos
  70.                                            ;;* Return Parms to (errorfix)
  71.    (put_parm 1 errline)                    ;;*   Line # of error as Parm 1
  72.    (put_parm 2 errcol)                     ;;*   Col # of error as Parm 2
  73.    (put_parm 3 errtext)                    ;;*   Text of error msg as Parm 3
  74.    (returns 2)                             ;;* For now, return a 'Type 2'
  75.                                            ;;*   error to caller 
  76.    )
  77. )
  78.  
  79. ;;****************************************************************************
  80. ;;** Clarion .CLA file next error macro for ERRORFIX.M
  81. ;;****************************************************************************
  82. (macro .cla_next_error                     ;;* Called by ERRORFIX.M
  83.     (returns (search_fwd "<[EW] \\c" 1 1))  ;;* Error file line start w/
  84. )                                          ;;*   an 'E' or 'W'
  85.  
  86. ;;****************************************************************************
  87. ;;** Clarion .CLA file previous error macro for ERRORFIX.M
  88. ;;****************************************************************************
  89. (macro .cla_prev_error                     ;;* Called by ERRORFIX.M
  90.     (returns (search_back "<[EW] \\c" 1 1))
  91. )
  92. ;;* Include File Ends                    
  93.