home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / ME494-6.ZIP / SRC / LANGUAGE.SRC < prev    next >
Encoding:
Text File  |  1990-06-13  |  36.0 KB  |  1,518 lines

  1. $MACRO_FILE LANGUAGE;
  2. {******************************************************************************
  3.                                                      MULTI-EDIT MACRO FILE LANGUAGE
  4. COMPILE - Compile a program
  5. CMPERROR - Finds compiler errors then moves cursor to line in the source
  6. TEMPLATE - Calls the appropriate template macro for the language type
  7. MATCH - Calls the appropriate matching macro for the language type
  8.  
  9.                              (C) Copyright 1989 by American Cybernetics, Inc.
  10. ******************************************************************************}
  11.  
  12. $MACRO COMPILE;
  13. {******************************************************************************
  14.                                                                 MULTI_EDIT MACRO
  15.  
  16. Name: COMPILE
  17.  
  18. Description:  Compiles a program based on the setup for the filename extension
  19.                             of the current file.
  20.  
  21.                              (C) Copyright 1989 by American Cybernetics, Inc.
  22.  
  23. We would like to acknowledge the contributions of our user base which are too
  24. numerous to mention here.
  25. ******************************************************************************}
  26.  
  27.     Def_Str(TStr,Tstr2,Red_Str[40],Comp_Str,trailer[30],Ext[3],E_F_Name[20]);
  28.     { note comp_str above added for ALSYS }
  29.     Def_Int( meerr_id,
  30.                     jx,T_Swap_Mode,T_Swap_Mem,Clear_Screen_Stat,Compiler_Prompt,
  31.                     Save_All,Reload_File,Dont_Process,Temp_Id,jx2
  32.                     );
  33.  
  34.     { Since PLM does not put the file name on the primary file we need to save
  35.         away the name of the primary file in case we find an error in an include file
  36.         we will know when we press the next error key what file to go back to if
  37.         the error is back in the primary file }
  38.  
  39. {Get the compiler/program interface data for this extension}
  40.     Refresh := false;
  41.     temp_id := window_id;
  42.     meerr_id := 0;
  43.     T_Swap_Mode := Swap_Mode;
  44.     T_Swap_Mem := Swap_Mem;
  45.     Ext := Get_Extension(File_Name);
  46.     TStr := '';
  47.     RM('USERIN^SETCONFIG /DB=MECONFIG.DB/T=' + Ext + '.PGM');
  48.     IF return_int THEN
  49.         Tstr := Ext;
  50.         jx := 1;
  51.     ELSE
  52. {
  53. If we can't find a compiler for this extension, Check to see if there might be
  54. a default compiler setup, and if so, see if this extension was intended to
  55. fall under the default setup.
  56. }
  57.         RM('USERIN^SETCONFIG /DB=MECONFIG.DB/T=DEFAULT.PGM');
  58.         IF (RETURN_INT) THEN
  59.             IF (Ext = '') THEN
  60.                 Goto NO_EXTENSION;
  61.             END;
  62.  
  63.             RM('USERIN^DB /F=MECONFIG.DB/DPT=EXT.DB/GLO=PGM/RR=1/FV=' + Ext);
  64.             IF (Return_Int = -1) THEN
  65. NO_EXTENSION:
  66.                 Jx := 1;
  67.                 TStr := 'DEFAULT';
  68.             ELSE
  69.                 TStr := '';
  70.                 Jx := 0;
  71.             END;
  72.         END;
  73.     END;
  74.  
  75.     Switch_Win_Id( temp_id );
  76.  
  77.     IF (Get_Extension(Global_Str('Last_Compiled_Window')) <>    Caps(Ext)) THEN
  78.         Set_Global_Int('DB#' + Ext + '.PGM',1);
  79.     END;
  80.     Set_Global_Str('Last_Compiled_Window',Caps(file_name));
  81.  
  82.     Clear_Screen_Stat := False;
  83.     Compiler_Prompt := False;
  84.     Save_All := False;
  85.     Red_Str := ' > ' + user_id + 'MEERR.TMP';
  86.  
  87.     IF (Jx = 0) THEN
  88.         Compiler_Prompt := True;
  89.         Tstr := '';
  90.         Goto COMP_PROMPT;
  91.     END;
  92.  
  93.     RM('USERIN^DB /2TOP=1/F=MECONFIG.DB/HPT=DEFAULT.PGM/DPT=' + TStr +
  94.             '.PGM/GLO=PGM/NOALPHA=1/LO=2/LT=(.' + TStr +
  95.         ')─SELECT A PROGRAM/DT=COMPILER-PROGRAM SETUP/H=FE_PROGRAM/ENC=1');
  96.  
  97.     Jx := Return_Int;
  98.  
  99.     IF (Jx = -1) THEN
  100.         Compiler_Prompt := True;
  101.         Tstr := '';
  102.         Goto COMP_PROMPT;
  103.  
  104.     END;
  105.  
  106.     IF (Jx = 0) THEN
  107.         Make_Message('Compiler/program aborted.');
  108.         Goto EXIT;
  109.     END;
  110.  
  111. ONLY_ONE:
  112.     TStr2 := Global_Str('PGM');
  113. {We must parse out the compiler command line before we capitalize TSTR2 because
  114. some compliers command line options are case sensitive.}
  115.     TStr := Parse_Str('CL=',Tstr2);
  116.     TStr2 := Caps(Tstr2);
  117.     Jx := Parse_Int('SM=',TStr2);
  118.     IF (Jx > 1) THEN
  119.         Swap_Mode := Jx - 2;
  120. {Set swap memory in paragraphs}
  121.         Swap_Mem := (parse_int('MEM=',tstr2) * 1024) / 16;
  122.     END;
  123.  
  124.     Clear_Screen_Stat := Parse_INT('CS=',TSTR2);
  125. {This will set COMPILER_PROMPT true if the parameter extists or if the command
  126. line is null}
  127.     Compiler_Prompt := (Parse_Int('CP=',TSTR2)) or (Tstr = '');
  128.     Save_All := Parse_int('SA=',TSTR2);
  129.     Reload_File := Parse_int('RF=',TSTR2);
  130.     Dont_Process := Parse_int('DP=',TSTR2);
  131.     TStr2 := Parse_Str('PT=',TStr2);
  132.     Set_Global_Str('LAST_COMP',TStr2);
  133.     {THE LINE BELOW IS USED FOR ALSYS ADA,DATAFLEX,CLARION, & MICROSOFT C5.X }
  134.         Comp_Str := Caps(Global_Str('LAST_COMP'));
  135.  
  136.  
  137. { now see if he has a command line }
  138.     IF (Tstr = '') THEN
  139. { no command line but we still have set the compiler setup flags }
  140. { that the user put into file extension compiler/program fields  }
  141.         Goto COMP_PROMPT;
  142.     END;
  143.  
  144. {If it exists then setup}
  145.     If TStr <> '' THEN
  146.  
  147. CHECK_RED:
  148.         JX := XPOS('<NR>',Caps(TStr),1);
  149.         IF jx <> 0 THEN
  150.             Red_Str := '';
  151.             TStr := Str_Del(Tstr,jx,4);
  152.             Goto CHECK_RED;
  153.         END;
  154.  
  155. {parse the compiler command to insert filename, path and extensions}
  156.         return_str := tstr;
  157. {
  158. Make_Message('[' + TSTR + ']');
  159. }
  160.         RM('XlateCmdLine /F=' + file_name);
  161.  
  162.         tstr := return_str;
  163.  
  164.         If (Tstr2 = 'STONYBROOK MODULA-2') then
  165.             del_file( truncate_path(truncate_extension(file_name)) + '.ERR');
  166.         END;
  167.  
  168. { Special processing for PLM-86 }
  169. { Since we use a lot of compiler defaults I tack them on at the end of
  170.     the command line }
  171. { Someday I am going to make a menu to choose the options from which will
  172.     build the command line for the user }
  173. { setting the command line prompt to yes will allow the user to enter
  174.     his own command line for now }
  175.  
  176. COMP_PROMPT:
  177.     IF ((TStr2 = 'INTEL PLM-86') or (TStr2 = 'INTEL IC-86')) and (TStr = '') then
  178.         IF (TStr2 = 'INTEL PLM-86') then
  179.             TStr := 'PLM86 ' + file_name + ' ';
  180.         ELSE
  181.             TStr := 'IC86 ' + file_name + ' ';
  182.         END;
  183.         return_str := tstr;
  184.         rm('QUERYBOX /P=COMMAND LINE: /T=LA OT(3) NOLI DB PR(CON:) added to invocation line for you.'
  185.                 + '/W=73/ML=120' );
  186.         tstr := return_str;
  187.         jx := return_int;
  188.         if jx = 0 then
  189.             TStr := '';
  190.         END;
  191.         kill_box;
  192.         if tstr <> '' then
  193.             tstr := tstr + ' LA OT(3) NOLI DB PR(CON:)';
  194.             Compiler_Prompt := False;
  195.         ELSE
  196.             Make_Message('Compile line null.  Compile aborted.');
  197.             Goto EXIT;
  198.         END;
  199.     END;
  200. {Now I see if command line exists}
  201. {If it exists then setup}
  202.         IF (Compiler_Prompt) THEN
  203.             Return_Str := Tstr;
  204.             RM('userin^QUERYBOX /H=CP/C=1/L=2/W=74/ML=128/T=ENTER COMPILER/PROGRAM COMMAND');
  205.             IF (Return_Int = False) THEN
  206.                 Make_Message('Compiler/program aborted.');
  207.                 Goto EXIT;
  208.             END;
  209.             Tstr := Return_Str;
  210.         END;
  211.  
  212.  
  213. {Get rid of meerr.tmp if it exists in memory}
  214.         {Now find the error window}
  215.         jx := 0;
  216.         While (jx < window_count) and (Caps(Truncate_Path(File_Name)) <> (user_id + 'MEERR.TMP')) do
  217.             jx := jx + 1;
  218.             Switch_Window(jx);
  219.         END;
  220.         if caps(truncate_path(file_name)) = (user_id + 'MEERR.TMP') then
  221.             erase_window;
  222.             meerr_id := window_id;
  223.         end;
  224.         if switch_win_id(temp_id) then
  225.         end;
  226.         refresh := TRUE;
  227.         new_screen;
  228.         refresh := FALSE;
  229.  
  230. {Check the disk to see if MEERR.TMP is read only on disk and warn the user}
  231.         E_F_Name := User_Id + 'MEERR.TMP';
  232.         Jx := File_attr(E_F_Name);
  233.         IF (Error_Level = 0) THEN
  234.             IF (Jx and 1) THEN
  235.                 RM('MEERROR^Beeps /C=1');
  236.                 RM('userin^XMENU /H=CP/B=1/X=1/Y=2/L=FILE: ' + E_F_Name +
  237.                 ' IS MARKED READ ONLY/M=Reset-read-only-attribute(CP)Abort()');
  238.                 IF (Return_Int = 1) THEN
  239. {Turn off read only flag if user wants to, otherwise abort compile}
  240.                     Set_File_Attr(E_F_Name,Jx and $FFFE);
  241.                 ELSE
  242.                     Make_Message('Compiler/program aborted.');
  243.                     Goto EXIT;
  244.                 END;
  245.             END;
  246.         ELSE
  247.             Error_Level := 0;
  248.         END;
  249.  
  250.         {Save off source file only or all files if Save_All flag is set}
  251.         IF (Save_All) THEN
  252.             Make_Message('Saving files...');
  253.             jx := 0;
  254.         ELSE
  255.             Make_Message('Saving source file...');
  256.             jx := CUR_Window - 1;
  257.         END;
  258.         While (jx < Window_Count) DO
  259.             jx := jx + 1;
  260.             Switch_Window(jx);
  261.             IF (File_Changed <> 0) and (CAPS(FILE_NAME) <> '?NO-FILE?') THEN
  262.                 SAVE_FILE;
  263.                 IF Error_Level <> 0 THEN
  264.                     Refresh := True;
  265.                     Redraw;
  266.                     Make_Message('Incorrect file name or error saving file.');
  267.                     RM('MEERROR^Beeps /C=1');
  268.                     Goto exit;
  269.                 END;
  270.             END;
  271.             IF (Save_All = False) THEN
  272.                 Jx := Window_Count;
  273.             End;
  274.         END;
  275.  
  276.         if switch_win_id(temp_id) then
  277.         end;
  278.         Refresh := True; { to get rid of the * }
  279.         Redraw;
  280.         working;  {Turn on the working sign}
  281.         Refresh := False;   {Turn screen off}
  282.  
  283.         gotoxy(1, message_row );
  284.  
  285.         Refresh := False;   {Turn screen offf}
  286.  
  287. {****** 10-11-89 07:20pm ******** }
  288.             { Special processing for Microsoft C5.X }
  289.             { This depends on the switch /FsMeerr.tmp in the CL command line }
  290.             If Comp_Str = 'MICROSOFT C5.X' THEN
  291.                 Red_Str := ' > NUL';
  292.              end;
  293.              { END OF MICROSOFT C5.X}
  294.             { Special processing for CLARION }
  295.             { THE FOLOWING BAT FILE MUST BE USED FOR COMPILE }
  296.             { ERASE MEERR.TMP
  297.              ERASE *.ERR
  298.              ccmp %1.cla yes /b
  299.              IF NOT EXIST *.ERR GOTO EXIT
  300.              FOR %%F IN (*.ERR) DO TYPE %%F >> MEERR.TMP
  301.             :EXIT }
  302.              {ALSO SET RED_STR TO BLANK FOR DATAFLEX }
  303.             If (Comp_Str = 'CLARION') or (comp_str = 'DATAFLEX') THEN
  304.                 Red_Str := '';
  305.              end;
  306.              { END OF CLARION}
  307.  
  308.              if comp_str = 'DATAFLEX' THEN
  309.                     TRAILER := '';
  310.                 ELSE
  311.                     TRAILER := '|13EXIT|13';
  312.              END;
  313. {********************}
  314.  
  315.         MAKE_MESSAGE( COPY(TSTR,1,78) );
  316.         WORKING;
  317.         Refresh := False;
  318.             {Compile the program}
  319.         If (Clear_Screen_Stat) THEN
  320.             Rest_Dos_Screen;
  321.             Shell_To_Dos(TStr + Red_Str,true);
  322.             Save_Dos_Screen;
  323.             Refresh := True;
  324.             New_Screen;
  325.         ELSE
  326.             Shell_To_Dos(TStr + Red_Str,true);
  327.         END;
  328.  
  329.  
  330.         Refresh := False;   {Turn screen offf}
  331.         jx := error_level;  {Get the returned error}
  332.         Set_Global_Str('LAST_COMP',TStr2);
  333.  
  334.         IF jx <> 0 THEN
  335.             Make_message('Unable to run compiler.');
  336.             goto exit;
  337.         END;
  338.  
  339. {reload file if that flag is set}
  340.         IF (Reload_File) THEN
  341.             LOAD_FILE(File_Name);
  342.             RM('EXTSETUP');
  343.         END;
  344.         IF (Dont_Process) THEN
  345.             Goto EXIT;
  346.         END;
  347.         If (TSTR2 = 'STONYBROOK MODULA-2') then
  348. {For stonybrook, use the error file which is automatically created.}
  349.  
  350.             Shell_to_Dos('COPY ' + truncate_path(truncate_extension(file_name)) + '.ERR ' + user_id + 'MEERR.TMP > NUL',True);
  351.         END;
  352.  
  353.  
  354.         IF NOT(switch_win_id( meerr_id )) THEN
  355.             Switch_Window(Window_Count);
  356.             Create_Window;
  357.             size_window( 1, max_window_row - 6, 60, max_window_row - 1 );
  358.             c_color := m_s_color;
  359.             t_color := m_t_color;
  360.             b_color := m_b_color;
  361.             eof_color := m_s_color;
  362.             s_color := m_s_color;
  363.             h_color := m_h_color;
  364.             RM('WINDOW^SetWindowNames');
  365.         end;
  366.  
  367.         {Load in the error file}
  368.  
  369.         Load_File(user_id + 'MEERR.TMP');
  370.         meerr_id := window_id;
  371.  
  372. { SPECIAL PROCESSING FOR DATAFLEX }
  373. {THIS CODE ASSUMES THE USE OF THE FOLLOWING BATCH FILE:
  374. ERASE MEERR.TMP
  375. DFCOMP %1.%2 -CFQ
  376. COPY %1.PRN MEERR.TMP
  377. IF ERRORLEVEL 1 GOTO EXIT
  378. :DOIT
  379. FLEX %1
  380. :EXIT
  381. }
  382. {note that the filename and extension must be given as 2 seperate parms }
  383.         SET_GLOBAL_INT('FLEX',0);
  384.         {I need to know in cmperror if I have the first or subsequent call }
  385.         IF COMP_STR = 'DATAFLEX'  THEN
  386.             EOF;
  387.             JX := SEARCH_BWD('ERRORS: 0',0);
  388.             TOF;
  389.             IF JX = 1 THEN
  390.             delete_window;
  391.             if switch_win_id( temp_id ) then
  392.             end;
  393.             MAKE_MESSAGE('NO ERRORS');
  394.             GOTO EXIT;
  395.             END;
  396.         END;
  397.         { END OF DATAFLEX }
  398.  
  399.  
  400.  
  401.     {SPECIAL PROCESSING FOR ALSYS }
  402.         {Note that entire scheme for doing this compile relies on the
  403.         fact that DOS will not copy a zero length file.  Thus the bat file
  404.         adacomp.bat :
  405. ERASE MEERR.TMP
  406. ada comp %1.ADA
  407. COPY %1.LST MEERR.TMP
  408. EXIT
  409.         will produce a zero lenth .lst file and MEERR.TMP will not exist if
  410.         there are no errors }
  411.         IF ((COMP_STR = 'ALSYS') AND (ERROR_LEVEL <> 0)) THEN
  412.             delete_window;
  413.             if switch_win_id(temp_id) then
  414.             end;
  415.             MAKE_MESSAGE('NO ERRORS');
  416.             GOTO EXIT;
  417.         END;
  418.         { end of alsys }
  419.         { FOR CLARION    - MEERR.TMP WILL NOT EXIST ON A GOOD COMPILE }
  420.         IF ((COMP_STR = 'CLARION') AND (ERROR_LEVEL <> 0)) THEN
  421.             delete_window;
  422.             if switch_win_id(temp_id) then
  423.             end;
  424.             MAKE_MESSAGE('NO ERRORS');
  425.             Error_Level := 0;
  426.             GOTO EXIT;
  427.         END;
  428.         { end of CLARION }
  429.  
  430.  
  431.      {Special processing for Intermetrics C   ADDED 02-14-90 10:42am
  432.           If no errors are found meerr.tmp will not exist}
  433.  
  434.         IF ((COMP_STR = 'INTERMETRICS C') AND (ERROR_LEVEL <> 0)) THEN
  435.              delete_window;
  436.              if switch_win_id(temp_id) then
  437.              end;
  438.              MAKE_MESSAGE('NO ERRORS FOUND');
  439.              Error_Level := 0;
  440.              GOTO EXIT;
  441.         END;
  442.         {End of intermetrics C}
  443.  
  444.  
  445.     {Special processing for the MULTI_EDIT macro language compiler}
  446.         IF Tstr2 = 'MULTI_EDIT' THEN
  447.             {If no errors then load the macro file}
  448.  
  449.             Ignore_Case := true;
  450.             IF ((Search_Fwd('ERROR',0) = False) and
  451.                     (Search_Fwd('OUTPUT-FILE',0) = true)) THEN
  452.                 goto_col(c_col + 12);
  453.                 while cur_char = ' ' do
  454.                     right;
  455.                 end;
  456.                 If cur_char = '=' then
  457.                     right;
  458.                 end;
  459.                 TStr2 := Remove_Space(Get_Word(''));
  460.                 tof;
  461.  
  462.                 Load_Macro_File(TStr2);
  463.                 if switch_win_id(temp_id) then
  464.                 end;
  465.                 Refresh := true;
  466.                 Redraw;
  467.                 Make_Message('No errors.  Macro file = ' + tstr2);
  468.                 Goto EXIT;
  469.             ELSE
  470.                 Tof;
  471.             END;
  472.         END;
  473.         TOF;
  474.         if switch_win_id(temp_id) then
  475.         end;
  476.             {Run the find error macro}
  477.         RM( 'CMPERROR' );
  478.     ELSE
  479.         GOTO COMP_PROMPT;
  480.     END;
  481. exit:
  482.     Swap_Mode := T_Swap_Mode;
  483.     Swap_Mem := T_Swap_Mem;
  484.     temp_id := window_id;
  485.     working;
  486.     Set_Virtual_Display;
  487.     refresh := true;
  488.     switch_win_id( meerr_id );
  489.     redraw;
  490.     switch_win_id( temp_id );
  491.     redraw;
  492.     Update_Virtual_Display;
  493.     Reset_Virtual_Display;
  494. END_MACRO;
  495.  
  496.  
  497. $MACRO CMPERROR TRANS;
  498. {******************************************************************************
  499.                                                                 MULTI_EDIT MACRO
  500.  
  501. Name: CMPERROR
  502.  
  503. Description:  Finds the next error in the MEERR.TMP window generated by the
  504.     last compile.
  505.  
  506.                              (C) Copyright 1989 by American Cybernetics, Inc.
  507. ******************************************************************************}
  508.  
  509.     Def_Str(m_str[128],file_str[128],comp_str[128],e_word,l_str[128],svword[128], nxt[128],t_str);  {note: last 3 for alsys }
  510.     Def_Int(Temp_window,jx,ec,el,tc,tl,ofs_stat,vret,scol,DCNT);
  511.      {note: last 3 for alsys}
  512.  
  513.     Refresh := False;
  514.     Temp_Window := Cur_Window;
  515.     Error_Level := 0;
  516.     Ofs_Stat := 0;  {This variable decides whether or not ec is an absolute colum
  517.                                         position, or an offset from the first word}
  518.  
  519.     { I have changed this macro quite a bit to handle intel languages }
  520.     { instead of one section which the error is found in the are a couple
  521.         based on compiler type }
  522.  
  523.         {Find the error window}
  524.     jx := 0;
  525.     While (jx < window_count) and (Caps(Truncate_Path(File_Name)) <> (user_id + 'MEERR.TMP')) do
  526.         jx := jx + 1;
  527.         Switch_Window(cur_window + 1);
  528.     END;
  529.         {If not found then exit}
  530.     If Caps(Truncate_Path(File_Name) ) <> (user_id + 'MEERR.TMP') then
  531.         Make_Message('No error file loaded.');
  532.         goto exit;
  533.     END;
  534.  
  535.     Ignore_Case := True;
  536.     Reg_Exp_Stat := True;
  537.     m_str := '';
  538.     ec := 1; el := 1;
  539.  
  540.     {Get the compiler type for the last compile}
  541.     Comp_Str := Caps(Global_Str('LAST_COMP'));
  542.  
  543.   If (Comp_Str = 'LAHEY FORTRAN') then
  544.         File_Str := Global_Str('last_compiled_window'); { in main file }
  545.     IF (Search_fwd ('{FATAL}||{WARNING}||{ABORT}',0)) THEN
  546.       up;
  547.       goto_col(1);
  548.       if (Search_fwd('^',1)) then
  549.         ec := c_col - 12;
  550.         jx := search_bwd(':',0);
  551.         first_word;
  552.         word_right;
  553.         jx := val (el,get_word(':'));
  554.         jx := Search_fwd ('{FATAL}||{WARNING}||{ABORT}',0);
  555.       else
  556.         down;
  557.         ec := 0;
  558.         first_word;
  559.         jx := search_fwd('(',0);
  560.         right;
  561.         e_word := get_word(')');
  562.         if (search_fwd('line',1)) then
  563.           word_right;
  564.           jx := val(el,get_word(' .&'));
  565.           jx := Search_bwd ('{FATAL}||{WARNING}||{ABORT}',0);
  566.         end;
  567.       end;
  568.       goto display_error;
  569.     END;
  570.     goto no_more_errors;
  571.   end;
  572.  
  573. {SPECIAL PROCESSING FOR DATAFLEX}
  574.     IF (COMP_STR = 'DATAFLEX') THEN
  575.     {NOTE THAT THE LINE NUMBERS GIVEN IN THE DATAFLEX ERROR FILE ARE
  576.     MEANINGLESS!!!  THEY REFER TO THE SOURCE FILE WITH MACRO EXPANSIONS.
  577.     SO WE CAN'T USE THE NUMBERS TO SHOW THE ERRORS.}
  578. {
  579. The DATAFLEX users group says that we must search for a bel ^G character before
  580. the word ERROR:.
  581. }
  582.         File_Str := Global_Str('last_compiled_window'); { in main file }
  583.         IF SEARCH_FWD('%ERROR:',0) THEN
  584.             MARK_POS;
  585.             M_STR := GET_LINE;
  586.             VRET := 0;
  587. RELOOK:
  588.             UP;
  589.             FIRST_WORD;
  590.             SVWORD := GET_WORD(':');
  591.             IF SVWORD = 'ERROR:' THEN
  592.                 VRET := 1;
  593.                 GOTO RELOOK;      {WE JUST SHOWED THIS MESSAGE }
  594.             END;
  595.             L_STR := GET_LINE;
  596.             SCOL := XPOS('>',L_STR,1);
  597.             L_STR := STR_DEL(L_STR,1,SCOL);
  598. DEBLANK:
  599.             SVWORD := COPY(L_STR,1,1);
  600.             IF SVWORD = ' ' THEN
  601.                 L_STR := STR_DEL(L_STR,1,1);
  602.                 GOTO DEBLANK;
  603.             END;
  604.             GOTO_MARK;
  605.             EOL;
  606.             GOTO DISPLAY_ERROR_FLEX;
  607.             END;
  608.             GOTO NO_MORE_ERRORS;
  609.         END;
  610. {end DATAFLEX }
  611.  
  612.     {SPECIAL PROCESSING FOR ALSYS ADA VERSION 4.X}
  613.     IF (COMP_STR = 'ALSYS 4') THEN
  614.         File_Str := Global_Str('last_compiled_window'); { in main file }
  615.         IF SEARCH_FWD('[0-9]   *@*',0) THEN
  616.         L_STR := GET_LINE;
  617.         L_STR := COPY(L_STR,1,2);
  618.         NXT := REMOVE_SPACE(L_STR);
  619.         DCNT := 0;
  620.             UP;
  621.             UP;
  622. RETRY4:
  623.             L_STR := GET_LINE;
  624.             L_STR := COPY(L_STR,1,9);
  625.             M_STR :=  REMOVE_SPACE(L_STR);
  626.             VRET := VAL(EL,M_STR);
  627.             IF VRET <> 0 THEN
  628.                  UP;
  629.                  DCNT := DCNT + 1;
  630.                  GOTO RETRY4;
  631.             END;
  632.             DOWN;
  633.             scol := 0;
  634.             If search_fwd(nxt,1) then
  635.                 up;
  636.                 svword := get_word(' :=()-+;');
  637.                 down;
  638.             scol := 1;
  639.             end;
  640.             DOWN;
  641.             WHILE DCNT > 0 DO
  642.                 DOWN;
  643.                 DCNT := DCNT - 1;
  644.             END;
  645.             M_STR := GET_LINE;
  646.             GOTO_COL(80);
  647.             GOTO DISPLAY_ERROR_ADA;
  648.             END;
  649.             GOTO NO_MORE_ERRORS;
  650.         END;
  651.     { end alsys 4.x }
  652.  
  653.  
  654.     {SPECIAL PROCESSING FOR ALSYS ADA }
  655.     IF (COMP_STR = 'ALSYS') THEN
  656.         File_Str := Global_Str('last_compiled_window'); { in main file }
  657.         IF SEARCH_FWD('[0-9] : *@*',0) THEN
  658.         DCNT := 0;
  659.             UP;
  660.             UP;
  661.             UP;
  662. RETRY:
  663.             L_STR := GET_LINE;
  664.             L_STR := COPY(L_STR,1,7);
  665.             M_STR :=  REMOVE_SPACE(L_STR);
  666.             VRET := VAL(EL,M_STR);
  667.             IF VRET <> 0 THEN
  668.                  UP;
  669.                  DCNT := DCNT + 1;
  670.                  GOTO RETRY;
  671.             END;
  672.             DOWN;
  673.             scol := 0;
  674.             If search_fwd('^',1) then
  675.                 up;
  676.                 svword := get_word(' :=()-+;');
  677.                 down;
  678.             scol := 1;
  679.             end;
  680.             DOWN;
  681.             DOWN;
  682.             WHILE DCNT > 0 DO
  683.                 DOWN;
  684.                 DCNT := DCNT - 1;
  685.             END;
  686.             M_STR := GET_LINE;
  687.             GOTO_COL(80);
  688.             GOTO DISPLAY_ERROR_ADA;
  689.             END;
  690.             GOTO NO_MORE_ERRORS;
  691.         END;
  692.     { end alsys }
  693.  
  694.              {SPECIAL PROCESSING FOR MICROSOFT C5.X }
  695.     IF (COMP_STR = 'MICROSOFT C5.X') THEN
  696.              SCOL := 0 ;  {USED AS A SWITCH IN ERROR DISPLAY }
  697.     File_Str := Global_Str('last_compiled_window'); { in main file }
  698.              IF (SEARCH_FWD('%@*@*@*@*@*',0)) THEN
  699.                      M_STR := GET_WORD('(');
  700.                      RIGHT;
  701.                      M_STR := GET_WORD(')');
  702.                      VRET := VAL(EL,M_STR);
  703.                      M_STR := GET_WORD(':');
  704.                      RIGHT;
  705.                      M_STR := GET_WORD('~');  {TO END OF LINE }
  706.                      GOTO DISPLAY_ERROR_ADA;
  707.                      END;
  708.                      GOTO NO_MORE_ERRORS;
  709.                      END;
  710.                      {END MICROSOFT C5.X }
  711.  
  712.             {SPECIAL PROCESSING FOR CLARION }
  713.     if (comp_str = 'CLARION') THEN
  714.     File_Str := Global_Str('last_compiled_window'); { in main file }
  715.         {WE SEE IF WE HAVE FINISHED }
  716.         IF AT_EOF = 1 THEN
  717.             GOTO NO_MORE_ERRORS;
  718.         END;
  719.         { NEXT WE SEE IF THIS IS A NEW FILE }
  720.         IF SEARCH_FWD('Compiled',1) then
  721.             DOWN;
  722.             VRET := SEARCH_FWD('IN',1);
  723.             RIGHT;
  724.             RIGHT;
  725.             RIGHT;
  726.             M_STR := GET_WORD('.'); { THIS IS THE FILE THAT PRODUCED ERRORS }
  727.             L_STR := CAPS(GET_PATH(FILE_STR));
  728.             File_Str := L_STR+ M_STR + '.CLA';
  729.             DOWN;
  730.             FIRST_WORD;
  731.          END;
  732.          { NOW WE ARE AT AN ERROR LINE }
  733.         M_STR := GET_WORD('@');
  734.         RIGHT;
  735.         M_STR := GET_WORD('/');
  736.         VRET := VAL(EL,M_STR);
  737.         RIGHT;
  738.         M_STR := GET_WORD(':');
  739.         VRET := VAL(EC,M_STR);
  740.         RIGHT;
  741.         M_STR := GET_WORD('~');  {TO END OF LINE}
  742.         DOWN;
  743.         FIRST_WORD;   {PREPARE FOR NEXT ERROR }
  744.         GOTO DISPLAY_ERROR_ADA;
  745.     END;
  746.     {END CLARION}
  747.  
  748.  
  749.     If (Comp_Str = 'TURBO ASSEMBLER') then
  750.         If (Search_Fwd('@*{@*Error@*}||{Warning}@*', 0)) THEN
  751.             m_str := Get_Word(' ');
  752.             right;
  753.             file_str := Get_Word('(');
  754.             right;
  755.             m_str := get_word(')');
  756.             jx := val( el, m_str );
  757.             right;
  758.             right;
  759.             m_str := get_word('');
  760.             goto display_error;
  761.         end;
  762.  
  763.         Goto No_More_Errors;
  764.     end;
  765.  
  766.     If (Comp_Str = 'CLIPPER') or (Comp_Str = 'FOXBASE') then
  767.         If (Search_Fwd('%{error in }*line [0-9]+:',0)) THEN
  768.             M_Str := Get_Word( '0123456789' );
  769.             M_Str := Remove_Space( Get_Word(':') );
  770.             If (Val(El,M_Str) > 0) then
  771.                 Goto Error_Exit;
  772.             END;
  773.             jx := c_line;
  774.             ec := 1;
  775.             down;
  776.             goto_col(1);
  777.             if Caps(get_word(' ')) <> 'LINE' then
  778.                 down;
  779.                 IF (Search_Fwd('^',1)) THEN
  780.                     ec := C_Col;
  781.                 END;
  782.             END;
  783.             goto_line(jx);
  784.             file_str := '';
  785.             IF (Search_Bwd('%COMPILING ',0)) THEN
  786.                 Word_Right;
  787.                 File_Str := Remove_Space(Get_Word(''));
  788.             END;
  789.             goto_line(jx);
  790.             eol;
  791.             Goto Display_Error;
  792.         END;
  793.         GOTO NO_MORE_ERRORS;
  794.     END;
  795.  
  796.     If (Comp_Str = 'STONYBROOK MODULA-2') then
  797.         File_Str := Global_Str('last_compiled_window'); { in main file }
  798.         word_right;
  799.         goto_col(1);
  800.         M_Str := get_word(' ');
  801.         If (Val(El,M_Str) > 0) then
  802.             goto try_stonybrook_21;
  803.         END;
  804.         right;
  805.         M_Str := get_word(' ');
  806.         If (Val(Ec,M_Str) > 0) then
  807.             Goto NO_MORE_ERRORS;
  808.         END;
  809.         Goto DISPLAY_ERROR;
  810. try_stonybrook_21:
  811.         goto_col(1);
  812.         forward_till( '(' );
  813.         right;
  814.         M_Str := get_word(')');
  815.         If (Val(El,M_Str) > 0) then
  816.             Goto NO_MORE_ERRORS;
  817.         END;
  818.         forward_till('(');
  819.         right;
  820.         M_Str := get_word(')');
  821.         If (Val(Ec,M_Str) > 0) then
  822.             Goto NO_MORE_ERRORS;
  823.         END;
  824.         Goto DISPLAY_ERROR;
  825.     END;
  826.  
  827.     If (Comp_Str = 'LOGITECH MODULA-2') then
  828.         File_Str := Global_Str('last_compiled_window'); { in main file }
  829.         Tc := C_Col;
  830.         Tl := C_Line;
  831.         Tof;
  832.         If Search_Fwd('---- error',0) then
  833.             Goto_Col(Tc);
  834.             Goto_Line(Tl);
  835. M2_LOGI_AGAIN:
  836.             If Search_Fwd('^',0) then
  837.                 Tc := C_Col;
  838.                 Tl := C_Line;
  839.                 Ec := Tc - 6;
  840.                 Goto_Col(2);
  841.                 M_Str := Get_Word(' ');
  842.                 If Xpos('*****',M_Str,1) <> 0 then
  843.                     Goto_Col(2);
  844.                     While (Cur_Char = '*') do;
  845.                         Up;
  846.                     END;
  847.                     Left;
  848.                     While (Cur_Char = ' ') do
  849.                         Right;
  850.                     END;
  851.                     M_Str := Get_Word(' ');
  852.                     Jx := Val(El,M_Str);
  853.                     If Jx <> 0 then
  854.                         Goto ERROR_EXIT;
  855.                     END;
  856.                     Goto_Line(Tl);
  857.                     Goto_Col(Tc);
  858.                     Right;
  859.                     Right;
  860.                     M_Str := Get_Word(', ');
  861.                     If Search_Fwd(M_Str,0) then
  862.                         M_Str := Get_Line;
  863.                     ELSE
  864.                         Goto ERROR_EXIT;
  865.                     END;
  866.                     Goto_Line(Tl);
  867.                     Eol;
  868.                     Goto DISPLAY_ERROR;
  869.                 ELSE
  870.                     Down;
  871.                     Goto_Col(1);
  872.                     Goto M2_LOGI_AGAIN;
  873.                 END;
  874.             ELSE
  875.                 GOTO NO_MORE_ERRORS;
  876.             END;
  877.         ELSE
  878.             Ignore_Case := False;
  879.             If Search_Fwd('{----}||{===>}',0) then
  880.                 Ignore_Case := True;
  881.                 M_Str := '';
  882.                 Tof;
  883.                 Goto DISPLAY_ER3;
  884.             ELSE
  885.                 Ignore_Case := True;
  886.                 Goto NO_ERRORS;
  887.             END;
  888.         END;
  889.     END;
  890.  
  891.     If (Comp_Str = 'JPI MODULA-2') then
  892.         Tc := C_Col;
  893.         Tl := C_Line;
  894.         Goto_Col(1);
  895.         If Search_Fwd('No Errors',0) then
  896.             Goto_Line(Tl);
  897.             Goto_Col(Tc);
  898.             Goto NO_ERRORS;
  899.         ELSE
  900.             Goto_Line(Tl);
  901.             Goto_Col(Tc);
  902. M2_JPI_AGAIN:
  903.             If Search_Fwd('(',0) then
  904.                 If C_Col <> 1 then
  905.                     Right;
  906.                     Goto M2_JPI_AGAIN;
  907.                 END;
  908.                 Right;
  909.                 File_Str := Get_Word(' ');
  910.                 While Cur_Char = ' ' do
  911.                     Right;
  912.                 END;
  913.                 M_Str := Get_Word(',');
  914.                 If Val(El,M_Str) <> 0 then
  915.                     Goto ERROR_EXIT;
  916.                 END;
  917.                 Right;
  918.                 M_Str := Get_Word(')');
  919.                 If Val(Ec,M_Str) <> 0 then
  920.                     Goto ERROR_EXIT;
  921.                 END;
  922.                 Goto DISPLAY_ERROR;
  923.             ELSE
  924.                 Goto NO_MORE_ERRORS;
  925.             END;
  926.         END;
  927.     END;
  928.  
  929.         {Special processing for MICROSOFT PASCAL 3.3}
  930.     IF (COMP_STR = 'MS PASCAL 3.3') THEN
  931.         IF Search_Fwd('@^',0) THEN
  932.             ec := c_col - 16;
  933.             IF ec < 1 then
  934.                 ec := 1;
  935.             end;
  936.             goto_col(7);
  937.             word_right;
  938.             m_str := remove_space( get_word(' '));
  939.             IF Val(EL,M_Str) <> 0 THEN
  940.                 Goto Error_Exit;
  941.             END;
  942.             m_str := get_word('');
  943.             Goto Display_Er2;
  944.         END;
  945.         GOTO NO_ERRORS;
  946.     END;
  947.  
  948.     IF (COMP_STR = 'POWER C') THEN
  949.         If Search_FWD( 'ERROR IN FILE:',0) THEN
  950.             M_Str := Get_Word(':');
  951.             right;
  952.             File_Str := Get_Word('');
  953.             up;
  954.             up;
  955.             goto_col(1);
  956.             M_Str := Get_Word('||');
  957.             M_Str := REMOVE_SPACE( M_Str );
  958.             IF Val(EL,M_Str) <> 0 THEN
  959.                 GOTO error_exit;
  960.             END;
  961.             down;
  962.             goto_col(1);
  963.             IF Search_Fwd('^', 1) THEN
  964.                 ec := C_Col - 6;
  965.             end;
  966.             down;
  967.             down;
  968.             goto display_error;
  969.         END;
  970.     END;
  971.  
  972.     IF (COMP_STR = 'POWER C 1.2.0') THEN
  973.         If Search_FWD( '%@*@*@*@*@*@*@*@*@*@*@*@*@*@*@*@*',0) THEN
  974.             Up;
  975.             File_Str := Get_Word('(');
  976.             Right;
  977.             M_Str := Get_Word(')');
  978.             IF Val(EL,M_Str) <> 0 THEN
  979.                 GOTO error_exit;
  980.             END;
  981.             Down;
  982.             Down;
  983.             ec := 1;
  984.             goto display_error;
  985.         END;
  986.     END;
  987.  
  988.     IF (COMP_STR = 'JANUS ADA') THEN
  989.         If Search_FWD( '%In File ',0) THEN
  990.             Goto_Col(9);
  991.             File_Str := Get_Word(' ');
  992.             Word_Right;
  993.             Word_Right;
  994.             Word_Right;
  995.             M_Str := Get_Word('');
  996.             IF Val(EL,M_Str) <> 0 THEN
  997.                 GOTO error_exit;
  998.             END;
  999.             Down;
  1000.             Down;
  1001.             Down;
  1002.             Down;
  1003.             Down;
  1004.             ec := 1;
  1005.             goto display_error;
  1006.         END;
  1007.     END;
  1008.  
  1009.  
  1010.     If (Comp_Str = 'ZORTECH C++') then
  1011.         if search_fwd('%"?+", line [0-9]', 0 ) then
  1012.             goto_col(1);
  1013.             right;
  1014.             file_str := Caps(get_word('"'));
  1015.             m_str := get_word('0123456789');
  1016.             m_str := remove_space( get_word(' ') );
  1017.             IF Val(EL,M_Str) <> 0 THEN
  1018.                 GOTO error_exit;
  1019.             END;
  1020.             up;
  1021.             goto_col(1);
  1022.             if search_fwd('^',1) then
  1023.                 ec := c_col;
  1024.             end;
  1025.             down;
  1026.             eol;
  1027.             goto display_error;
  1028.         end;
  1029.     end;
  1030.  
  1031.     If (COMP_STR = 'INTEL PLM-86') or
  1032.          (COMP_STR = 'INTEL ASM-86') or
  1033.          (COMP_STR = 'INTEL IC-86') THEN
  1034.  
  1035.         If Search_FWD('FATAL ',0) then
  1036.             RM('MEERROR^Beeps /C=2');
  1037.             Make_Message('FATAL COMPILER ERROR');
  1038.             goto Exit2;
  1039.         END;
  1040.  
  1041.         If Search_FWD('I/O ERROR',0) then
  1042.             RM('MEERROR^Beeps /C=2');
  1043.             Make_Message('COMPILER I/O ERROR');
  1044.             goto Exit2;
  1045.         END;
  1046.  
  1047.         IF SEARCH_FWD('{@*@*@* ERROR}||{@*@*@* WARNING}',0) THEN
  1048.             goto_col(1);
  1049.             IF (Comp_Str = 'INTEL PLM-86') then
  1050.                 IF Search_Fwd('{(}',1) then
  1051.                     Right;
  1052.                     M_Str := Get_Word(',');
  1053.                     if POS(')',M_Str) = 0 then
  1054.                         File_str := M_Str;   { error is in an include file }
  1055.                         if Search_Fwd('{LINE }',1) = 0 then
  1056.                             goto error_no_line;
  1057.                         end;
  1058.                     else
  1059.                         if Search_Bwd('{LINE }',1) = 0 then
  1060.                             goto error_no_line;
  1061.                         end;
  1062.                         File_Str := Global_Str('last_compiled_window'); { in main file }
  1063.                     end;
  1064.                     Word_Right;
  1065.                     M_Str := Get_Word(')');
  1066.                     IF Val(EL,M_Str) <> 0 THEN
  1067.                         goto error_exit;
  1068.                     END;
  1069.                 ELSE
  1070.                     goto error_no_line;
  1071.                 END;
  1072.             END;
  1073.  
  1074.             IF (Comp_Str = 'INTEL ASM-86') then
  1075.                 File_Str := Global_Str('Last_Compiled_Window');
  1076.                 IF Search_Fwd('{IN }',1) then
  1077.                     Word_Right;
  1078.                     M_Str := Get_Word(',');
  1079.                     IF Val(EL,M_Str) <> 0 THEN
  1080.                         GOTO error_exit;
  1081.                     END;
  1082.                 ELSE
  1083.                     GOTO error_no_line;
  1084.                 END;
  1085.             END;
  1086.  
  1087.             IF (Comp_Str = 'INTEL IC-86') then
  1088.                 IF Search_Fwd('{LINE }',1) then
  1089.                     Word_Right;
  1090.                     M_Str := Get_Word(' ');
  1091.                     IF Val(EL,M_Str) <> 0 THEN
  1092.                         goto error_exit;
  1093.                     END;
  1094.                     Word_Right;
  1095.                     Word_Right;
  1096.                     File_Str := Get_Word(' ');
  1097.                     File_Str := Str_Del(File_Str, Length(File_Str), 1);
  1098.                 ELSE
  1099.                     goto error_no_line;
  1100.                 END;
  1101.             END;
  1102.  
  1103.             { it drops down to here when a true error }
  1104.             GOTO DISPLAY_ERROR;
  1105.  
  1106.         END;
  1107.  
  1108.         Goto DISPLAY_LINE;
  1109.  
  1110.     END;
  1111.  
  1112.     IF (Comp_Str = 'REALIA COBOL') THEN
  1113.         IF (Search_Fwd('%????? E||W',0)) THEN
  1114.             IF (Cur_Char = ' ') THEN
  1115.                 Word_Right;
  1116.             END;
  1117.             IF Val(EL,Get_Word(' ')) <> 0 THEN
  1118.                 goto error_exit;
  1119.             END;
  1120.             Goto_Col(7);
  1121.             IF (Cur_Char = 'E') THEN
  1122.                 M_Str := 'ERROR: ';
  1123.             ELSE
  1124.                 M_Str := 'WARNING: ';
  1125.             END;
  1126.             Goto_Col(9);
  1127.             M_Str := M_Str + Remove_Space(Get_Word(''));
  1128.             Goto DISPLAY_ERROR;
  1129.         ELSE
  1130.             IF (C_Line = 1) THEN
  1131.                 Goto NO_ERRORS;
  1132.             ELSE
  1133.                 Goto NO_MORE_ERRORS;
  1134.             END;
  1135.         END;
  1136.     END;
  1137.  
  1138.  
  1139.       {Intermetrics support added 02-14-90 10:42am}
  1140.  
  1141.         IF (COMP_STR = 'INTERMETRICS C') THEN
  1142.          if (AT_EOF = 1) then
  1143.                     goto no_more_errors;
  1144.          else
  1145.            GOTO_COL(2);
  1146.          search_fwd(':',1);
  1147.            right;
  1148.            File_Str := Caps(Get_Word(':'));
  1149.              right;
  1150.              M_Str := Caps(Get_Word(':'));
  1151.  
  1152.              IF Val(EL,M_Str) <> 0 THEN
  1153.               Goto Error_Exit;
  1154.              end;
  1155.  
  1156.              word_right;
  1157.            t_Str := Get_Word('');
  1158.              m_str := file_str + ' ' + '(' + str(el) + ')' + ' ' + t_str;
  1159.              down;
  1160.              goto_col(1);   {for eof check to be reliable you must be at beg of line}
  1161.              Switch_Window(Temp_Window);
  1162.              goto_line(el);
  1163.              goto display_er3;
  1164.          END;
  1165.         END;
  1166.  
  1167.         { all other compilers }
  1168.         {Search for error or warning messages}
  1169. DO_AGAIN:
  1170.     If Search_FWD('{ERROR[~S]}||{WARNING[~S]}||{NOT ENOUGH MEMORY}||{ABORTED}||{TOO BIG}',0) THEN
  1171.         tc := c_col;
  1172.         Goto_Col(1);
  1173.  
  1174.         IF Search_FWD('[0-9] Warning Errors',1) THEN
  1175.             EOL;
  1176.             GOTO Do_AGAIN;
  1177.         END;
  1178.  
  1179.         Goto_Col(1);
  1180.         IF Caps(GET_WORD(' :(')) = 'LINK' THEN
  1181.             Goto_Col(1);
  1182.             M_Str := Get_Word('');
  1183.             Goto DISPLAY_ER3;
  1184.         END;
  1185.         Goto_Col(1);
  1186.  
  1187.  
  1188.         IF (Comp_Str = 'ARCHIMEDES C') THEN
  1189.  
  1190.             IF (Cur_Char = '"') THEN                  { must be a C compiler error    }
  1191.                 RIGHT ;
  1192.                 File_Str := CAPS (REMOVE_SPACE (GET_WORD ('"'))) ;
  1193.  
  1194.                 RIGHT ;
  1195.                 RIGHT ;
  1196.                 M_Str := REMOVE_SPACE (GET_WORD (' ')) ;
  1197.  
  1198.             ELSE                                      { must be an assembler error    }
  1199.                 Return_Int := SEARCH_FWD ('in ',1) ;
  1200.                 RIGHT ;
  1201.                 RIGHT ;
  1202.                 M_Str := REMOVE_SPACE (GET_WORD (':/')) ;
  1203.                 File_Str := GLOBAL_STR ('Last_Compiled_Window') ;
  1204.  
  1205.                 IF (Cur_Char = '/') THEN
  1206.                     RIGHT ;
  1207.                     M_Str := REMOVE_SPACE (GET_WORD (' ')) ;
  1208.  
  1209.                     File_Str := GET_WORD ('"') ;
  1210.                     RIGHT ;
  1211.                     File_Str := CAPS (REMOVE_SPACE (GET_WORD ('"'))) ;
  1212.                 END ;
  1213.  
  1214.             END ;
  1215.  
  1216.             IF (VAL (El,M_Str) <> 0) THEN
  1217.                 GOTO ERROR_EXIT ;
  1218.             END ;
  1219.  
  1220.         END ;
  1221.  
  1222.         IF (COMP_STR = 'LATTICE C 3.0') THEN
  1223.             File_Str := Caps(Remove_Space(Get_Word(' ')));
  1224.             Right;
  1225.             M_Str := Remove_Space(Get_Word(' '));
  1226.             IF Val(EL,M_Str) <> 0 THEN
  1227.                 Goto Error_Exit;
  1228.             END;
  1229.         END;
  1230.  
  1231.         IF (COMP_STR = 'AZTEC C') THEN
  1232.             goto_col(tC);
  1233.             If Search_BWD(':',1) THEN
  1234.                 left;
  1235.                 If Search_BWD(':',1) THEN
  1236.                     EC := C_Col;
  1237.                     If Search_BWD('/',1) THEN
  1238.                         File_Str := Copy(Get_Line,1,C_Col - 1) + '\' +
  1239.                                 Copy(Get_Line, C_Col + 1, ec - c_col - 1);
  1240.                     ELSE
  1241.                         File_Str := Copy(Get_Line,1,EC - 1);
  1242.                     END;
  1243.                     goto_col(EC);
  1244.                     right;
  1245.                     m_str := get_word(':');
  1246.                     IF Val(EL,M_Str) <> 0 THEN
  1247.                         Goto Error_Exit;
  1248.                     END;
  1249.                     Up;
  1250.                     goto_col(1);
  1251.                     if search_fwd('^',1) then
  1252.                         ec := c_col;
  1253.                     end;
  1254.                     down;
  1255.                     goto display_error;
  1256.                 END;
  1257.             END;
  1258.         END;
  1259.  
  1260.         IF (COMP_STR = 'TURBO C') THEN
  1261.             File_Str := Get_Word(' ');
  1262.             Right;
  1263.             File_Str := Caps(Remove_Space(Get_Word(' ')));
  1264.             Right;
  1265.             M_Str := Remove_Space(Get_Word(':'));
  1266.             IF Val(EL,M_Str) <> 0 THEN
  1267.                 Goto Error_Exit;
  1268.             END;
  1269.         END;
  1270.  
  1271.         IF (COMP_STR = 'RBASE_5') THEN
  1272.             Goto_Col(1);
  1273.             File_Str := Caps(Remove_Space(Get_Word(' ')));
  1274.             Right; Right;
  1275.             M_Str := Remove_Space(Get_Word(')'));
  1276.             Down;
  1277.             IF Val(EL,M_Str) <> 0 THEN
  1278.                 Goto Error_Exit;
  1279.             END;
  1280.         END;
  1281.  
  1282.  
  1283.  
  1284.         IF (COMP_STR = 'MICROSOFT') or
  1285.              (COMP_STR = 'MULTI_EDIT') or
  1286.              (COMP_STR = 'TURBO PASCAL 5.0') or
  1287.              (Comp_Str = 'TURBO PASCAL 4.0') THEN
  1288.             File_Str := Caps(Remove_Space(Get_Word(' (,')));
  1289.  
  1290.             Right;
  1291.             M_Str := Remove_Space(Get_Word(',)'));
  1292.             IF (File_Str = 'ERROR') THEN
  1293.                 IF (Caps(Copy(M_Str,1,7)) = 'OPENING') THEN
  1294.                     Tof;
  1295.                     M_Str := 'Error opening file.';
  1296.                     Goto DISPLAY_ER3;
  1297.                 END;
  1298.             END;
  1299.             IF Val(EL,M_Str) <> 0 THEN
  1300.                 Goto Error_Exit;
  1301.             END;
  1302.             if cur_char = ',' THEN
  1303.                 right;
  1304.                 M_Str := Remove_Space(Get_Word(')'));
  1305.                 IF Val(EC,M_Str) <> 0 THEN
  1306.                     Goto Error_Exit;
  1307.                 END;
  1308.             END;
  1309.             if (COMP_STR = 'TURBO PASCAL 5.0') or
  1310.                  (COMP_STR = 'TURBO PASCAL 4.0') then
  1311.                 down;
  1312.                 first_word;
  1313.                 ec := c_col;
  1314.                 ofs_stat := 1;
  1315.                 down;
  1316.                 while (Cur_Char <> '^') and NOT(At_EOL) do
  1317.                     right;
  1318.                 end;
  1319.                 if (Cur_Char = '^') then
  1320.                     EC := C_Col - ec;
  1321.                 END;
  1322.                 UP;
  1323.                 UP;
  1324.             END;
  1325.         END;
  1326.  
  1327.  
  1328.     { if a compiler drops through to here no errors so display top line }
  1329.     { this works for PLM-86, ASM-86, TURBO PASCAL 4.0, TURBO C and maybe others }
  1330. {
  1331.     Goto DISPLAY_LINE;
  1332. }
  1333.  
  1334.    DISPLAY_ERROR:
  1335.         If Comp_Str <> 'LOGITECH MODULA-2' then
  1336.            goto_Col(1);
  1337.            M_Str := Get_Word('');
  1338.         END;
  1339.  
  1340.  CALL FIND_FILE_WINDOW;
  1341.  
  1342.  DISPLAY_ER2:
  1343.         While C_Row < ((Win_Y2 - Win_Y1) / 2) do
  1344.             down;
  1345.         end;
  1346.  
  1347.         goto_line(el - (format_stat <> 0));
  1348.  
  1349.         If ofs_stat then
  1350.             first_word;
  1351.             ec := c_col + ec;
  1352.         else
  1353.             COMP_STR := GET_LINE;
  1354.             JX := 1;
  1355.                 {we need to figure out the actual column number with tab expansion
  1356.                 included}
  1357.             CRUNCH_TABS( COMP_STR, JX );
  1358.             EXPAND_TABS( COMP_STR, EC );
  1359.         end;
  1360.         goto_col(ec);
  1361.  
  1362.  DISPLAY_ER3:
  1363.         Make_Message(M_Str);
  1364.         RM('MEERROR^Beeps /C=1');
  1365.         GOTO Exit2;
  1366.     END;
  1367.  
  1368.  
  1369. DISPLAY_LINE:
  1370.      EOF;
  1371.      Left;
  1372.      M_Str := Get_Line;
  1373.      Make_Message(M_Str);
  1374.      goto exit;
  1375.  
  1376. {FOR DATAFLEX}
  1377.  DISPLAY_ERROR_FLEX:
  1378.             CALL FIND_FILE_WINDOW;
  1379.             MAKE_MESSAGE(M_STR);
  1380.             DCNT := GLOBAL_INT('FLEX');
  1381.             IF DCNT = 0 THEN
  1382.                 TOF;
  1383.                 SET_GLOBAL_INT('FLEX',1);  {MUST KNOW IF FIRST ERROR OR LATER }
  1384.             END;
  1385.             IF VRET = 0 THEN
  1386.                 JX := SEARCH_FWD(L_STR,0);
  1387.             END;
  1388.             DCNT := C_LINE;
  1389.             GOTO EXIT2;
  1390.  { end DATAFLEX}
  1391.  
  1392.  
  1393. { for alsys}
  1394.  DISPLAY_ERROR_ADA:
  1395.             CALL FIND_FILE_WINDOW;
  1396.             IF VRET = 0 THEN
  1397.                 GOTO_LINE(EL);
  1398.                 IF SCOL = 1 THEN
  1399.                     FIRST_WORD;
  1400.                 reg_exp_stat := false;
  1401.                 SCOL := SEARCH_FWD(SVWORD,1);
  1402.                 reg_exp_stat := true;
  1403.                 END;
  1404.             END;
  1405.             MAKE_MESSAGE(M_STR);
  1406.             GOTO EXIT2;
  1407.  { end alsys}
  1408.  
  1409.  
  1410. NO_MORE_ERRORS:
  1411.     MAKE_MESSAGE('No more errors.');
  1412.     GOTO EXIT;
  1413.  
  1414. NO_ERRORS:
  1415.     Make_Message('No Errors.');
  1416.     goto exit;
  1417.  
  1418. ERROR_EXIT:
  1419.     Make_message('Problem parsing error file.');
  1420.     GOTO Exit2;
  1421.  
  1422. ERROR_NO_LINE:
  1423.     Make_message('Error.');
  1424.     RM('MEERROR^Beeps /C=1');
  1425.     GOTO Exit2;
  1426.  
  1427. EXIT:
  1428.     Switch_Window(Temp_Window);
  1429.  
  1430. EXIT2:
  1431.     Refresh := true;
  1432.     redraw;
  1433. GOTO FINAL_EXIT;
  1434. { ========================================================================}
  1435. FIND_FILE_WINDOW:
  1436.         jx := 0;
  1437.         While (jx <= window_count) and (Caps(Truncate_Path(File_Name)) <> Truncate_Path(File_Str)) do
  1438.             jx := jx + 1;
  1439.             Switch_Window(jx);
  1440.         END;
  1441.         If (jx >= Window_Count) and (Caps(Truncate_Path(File_Name)) <> Truncate_Path(File_Str)) then
  1442.             Switch_Window(Window_Count);
  1443.             Create_Window;
  1444.             Load_File(file_str);
  1445.             RM('WINDOW^SetWindowNames');
  1446.             RM('EXTSETUP');
  1447.         END;
  1448.         window_attr := 0;
  1449. RET;
  1450. FINAL_EXIT:
  1451. END_MACRO;
  1452.  
  1453.  
  1454. $MACRO TEMPLATE;
  1455. {******************************************************************************
  1456.                                                                 MULTI_EDIT MACRO
  1457.  
  1458. Name:  TEMPLATE
  1459.  
  1460. Description:  Calls the appropriate template macro for the filename extension
  1461.     of the current file.  The macro name is determined by the first three
  1462.     characters of the language type followed by '_IND'.  For example, the
  1463.     pascal macro would be 'PAS_IND', the C macro would be 'C_IND'
  1464.  
  1465.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1466. ******************************************************************************}
  1467.  
  1468.     Def_Str(TStr);
  1469.     Def_Int(jx);
  1470.  
  1471.     Push_Undo;
  1472.     TStr := Global_Str('.' + Get_Extension(File_Name));
  1473.     IF TStr <> '' THEN
  1474.         TStr := Parse_Str('LS=',TStr);
  1475.         IF Tstr <> '' THEN
  1476.             RM( Tstr + '^' + Copy(TStr,1,3)+'TEMP' );
  1477.             IF Error_Level <> 0 THEN
  1478.                 GOTO No_Support;
  1479.             END;
  1480.             GOTO Exit;
  1481.         END;
  1482.     END;
  1483. NO_Support:
  1484.     Make_Message('NOT Supported for this file extension.');
  1485. EXIT:
  1486.     Pop_Undo;
  1487. END_MACRO;
  1488.  
  1489. $MACRO MATCH;
  1490. {******************************************************************************
  1491.                                                                 MULTI_EDIT MACRO
  1492.  
  1493. Name:  MATCH
  1494.  
  1495. Description:  Calls the appropriate matching macro for the filename extension
  1496.     of the current file.  The macro name is determined by the first three
  1497.     characters of the language type followed by 'MTCH'.  For example, the
  1498.     pascal matching macro would be named 'PASMTCH', the C macro would be 'CMTCH'
  1499.  
  1500.                              (C) Copyright 1989 by American Cybernetics, Inc.
  1501. ******************************************************************************}
  1502.     Def_Str(TStr);
  1503.     Def_Int(jx);
  1504.     TStr := Global_Str('.' + Get_Extension(File_Name));
  1505.     IF TStr <> '' THEN
  1506.         TStr := Parse_Str('LS=',TStr);
  1507.         IF Tstr <> '' THEN
  1508.             RM( TStr + '^' + Copy(TStr,1,3)+'MTCH' );
  1509.             IF Error_Level <> 0 THEN
  1510.                 GOTO No_Support;
  1511.             END;
  1512.             GOTO Exit;
  1513.         END;
  1514.     END;
  1515. NO_Support:
  1516.     Make_Message('NOT Supported for this file extension.');
  1517. EXIT:
  1518. END_MACRO;