home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / AP / JED / JED097-1.TAR / jed / lib / compile.dat < prev    next >
Encoding:
Text File  |  1994-12-12  |  3.1 KB  |  133 lines

  1. This file should not be loaded.  In fact this line should generate an error
  2. if loaded.  This file contains compiler dependent routines for parsing error
  3. messages by compile.sl.  This file is simply a data base.  Find the function
  4. for your compiler and place the function on you jed.rc file.  
  5.  
  6. Currently supported compilers:
  7.  
  8.     bcc, Ultrix_cc, gcc, hp_cc, sun_acc
  9.  
  10. These functions all return 0 if the current line does not contain file
  11. ad line number information.  Otherwise they return 1 followed by line number 
  12. and filename.
  13. ------------------------------------------
  14. %@bcc
  15. . (
  16. .     [file]
  17. .     bol
  18. .     "Warning" looking_at "Error" looking_at or {0 return} !if
  19. .     "a-zA-z" skip_chars
  20. .     skip_white
  21. .     push_mark
  22. .     " " ffind {0 return} !if
  23. .     bufsubstr =file
  24. .     skip_white
  25. .     push_mark
  26. .     "0-9" skip_chars
  27. .     bufsubstr file 1
  28. . ) compile_is_this_line_error
  29. ------------------------------------------------
  30. %@Ultrix_cc compiler:
  31. % sample:  ccom: Error: t.c, line 14: LC_ALL undefined
  32. . (
  33. .    [file]
  34. .    bol
  35. .    {"Warning: " ffind}{"Error: " ffind} orelse {0 return} !if
  36. .    ": " ffind pop 2 go_right
  37. .    push_mark 
  38. .    ", line " ffind {0 pop_mark 0 return} !if
  39. .    bufsubstr =file
  40. .    7 go_right
  41. .    push_mark "0-9" skip_chars 
  42. .    bufsubstr file 1
  43. . ) compile_is_this_line_error    % Ultrix cc
  44. ----------------------------------------
  45. %@hp_cc compiler:
  46. % sample:  cc: "t.c", line 3: error 1588: "ddkldkjdldkj" undefined.
  47. define compile_is_this_line_error()
  48. {
  49.    variable file;
  50.    
  51.    bol();
  52.    !if (ffind("\"")) return(0);
  53.    go_right(1);
  54.    push_mark();
  55.    !if (ffind("\""))
  56.      {
  57.     pop_mark(0);
  58.     return(0);
  59.      }
  60.    
  61.    file = bufsubstr();
  62.    
  63.    !if (ffind("line ")) return(0);
  64.    go_right(5);
  65.    push_mark();
  66.    !if (ffind(": "))
  67.      {
  68.     pop_mark(0);
  69.     return(0);
  70.      }
  71.    return (bufsubstr(),file, 1);
  72. } % HP-UX cc
  73. ----------------------------------------
  74. %@gcc
  75. % sample: cmds.c:33: warning: initialization of non-const * pointer...
  76. %         cmds.c:1041 (cmds.o): Undefined symbol _Screen_Height referenced...
  77. define compile_is_this_line_error ()
  78. {
  79.    variable file, colon = ":", nums = "0-9";
  80.    bol ();
  81.    !if (ffind (colon)) return 0;
  82.  
  83.    go_right(1);
  84.    POINT; skip_chars (nums);
  85.    !if (POINT - ()) return 0;
  86.    if (looking_at(":\n")) return 0;
  87.    !if (looking_at(colon))
  88.      {
  89.     skip_white ();
  90.     !if (looking_at_char ('(')) return 0;
  91.      }
  92.    
  93.    bol (); push_mark(); 
  94.    ffind(colon); pop(); 
  95.    file = bufsubstr ();
  96.    go_right (1);
  97.    push_mark (); skip_chars (nums);
  98.    bufsubstr ();  file;  1;
  99. }
  100.  
  101. --------------------------------------------
  102. %@sun_acc
  103. % examples:
  104. %"filename.c", line 123: error: buffer undefined
  105. %"filename.c", line 123: warning: fin not used
  106. define compile_is_this_line_error ()
  107. {
  108.    variable file, line;
  109.    variable str = "\", line ";
  110.    bol ();
  111.    skip_white ();
  112.    !if (looking_at_char('"')) return 0;
  113.    !if (ffind(str)) return 0;
  114.    push_mark ();
  115.    bfind("\""); pop (); 
  116.    go_right(1);
  117.    file = bufsubstr ();
  118.    ffind(str); pop ();
  119.    go_right (7); skip_white ();
  120.    push_mark ();
  121.    skip_chars ("0-9");
  122.    line = bufsubstr ();
  123.    !if (looking_at(": error:")
  124.     or looking_at (": warning:")) return 0;
  125.    
  126.    line; file; 1;
  127. }
  128.  
  129.    
  130.    
  131.     
  132.  
  133.