-static char *sccsid = "@(#)input.c 1.8 (Berkeley) 83/06/14";
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley. The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)input.c 5.3 (Berkeley) %G%";
+#endif /* not lint */
+
#include <stdio.h>
#include <ctype.h>
#include "error.h"
Errorclass pi();
Errorclass ri();
Errorclass troff();
+Errorclass mod2();
/*
* Eat all of the lines in the input file, attempting to categorize
* them by their various flavors
* of 0 based.
*/
wordv -= 1;
- if ( 0
- || (( errorclass = onelong() ) != C_UNKNOWN)
+ if ( wordc > 0 &&
+ ((( errorclass = onelong() ) != C_UNKNOWN)
|| (( errorclass = cpp() ) != C_UNKNOWN)
|| (( errorclass = pccccom() ) != C_UNKNOWN)
|| (( errorclass = richieccom() ) != C_UNKNOWN)
|| (( errorclass = f77() ) != C_UNKNOWN)
|| ((errorclass = pi() ) != C_UNKNOWN)
|| (( errorclass = ri() )!= C_UNKNOWN)
- || (( errorclass = troff() )!= C_UNKNOWN)
+ || (( errorclass = mod2() )!= C_UNKNOWN)
+ || (( errorclass = troff() )!= C_UNKNOWN))
) ;
else
errorclass = catchall();
* c) Random noise
*/
wordc = 0;
- if (strcmp(wordv[2], "Stop.") == 0){
+ if (strcmp(wordv[1], "Stop.") == 0){
language = INMAKE; return(C_SYNC);
}
if (strcmp(wordv[1], "Assembler:") == 0){
clob_last(wordv[3], '\0'); /* drop : on line number */
wordv[2] = wordv[1]; /* overwrite "line" */
wordv++; /*compensate*/
+ wordc--;
currentfilename = wordv[1];
language = INCC;
return(C_TRUE);
char *F77_fatal[3] = {"Compiler", "error", "line"};
char *F77_error[3] = {"Error", "on", "line"};
char *F77_warning[3] = {"Warning", "on", "line"};
+char *F77_no_ass[3] = {"Error.","No","assembly."};
f77()
{
char **nwordv;
* Compiler error line %d of %s: %s
* Error on line %d of %s: %s
* Warning on line %d of %s: %s
+ * Error. No assembly.
*/
+ if (wordc == 3 && wordvcmp(wordv+1, 3, F77_no_ass) == 0) {
+ wordc = 0;
+ return(C_SYNC);
+ }
if (wordc < 6)
return(C_UNKNOWN);
if ( (lastchar(wordv[6]) == ':')
}
return(C_UNKNOWN);
}
+Errorclass mod2()
+{
+ /*
+ * for decwrl modula2 compiler (powell)
+ */
+ if ( ( (strcmp(wordv[1], "!!!") == 0) /* early version */
+ ||(strcmp(wordv[1], "File") == 0)) /* later version */
+ && (lastchar(wordv[2]) == ',') /* file name */
+ && (strcmp(wordv[3], "line") == 0)
+ && (isdigit(firstchar(wordv[4]))) /* line number */
+ && (lastchar(wordv[4]) == ':') /* line number */
+ ){
+ clob_last(wordv[2], '\0'); /* drop last , on file name */
+ clob_last(wordv[4], '\0'); /* drop last : on line number */
+ wordv[3] = wordv[2]; /* file name on top of "line" */
+ wordv += 2;
+ wordc -= 2;
+ currentfilename = wordv[1];
+ language = INMOD2;
+ return(C_TRUE);
+ }
+ return(C_UNKNOWN);
+}