4.2. Error Parsers

This feature implements nmake specific Eclipse error parsers for Eclipse CDT. These recognize diagnostic messages generated by nmake in the build output and create an Eclipse problem marker for each message found. Each problem marker has a description, creation time, severity, file name, file path, and line number. Severity can be one of Error, Warning, Info, or Ignore. File name, path, line number, and description can be derived from the message text.

Problem markers are displayed in the Eclipse Problems View, where problem severity is indicated by an icon, and the view can be sorted and filtered by various criteria. Problem markers associated with a file / line number are displayed in the left margin of editors with the right margin displaying an overview of all problems in the file. Matching lines in the console build log are highlighted as indicating a problem. Also, files in the Project Explorer are marked with an error icon if they contain 1 or more problems, and folders containing files with problems are also marked, all the way up to the project root. Clicking on a problem in the problem view or a highlighted line in the console build log brings up an editor positioned at the problem location.

The provided error parsers classify nmake error dianostic messages into 5 types and provide a recognizer for each type. A typical diagnostic message looks like

make: "Makefile", line 17: warning: file does not end with newline

This message would be recognized by the nmake error parsers as a type 1 diagnostic, with file set to Makefile, line set to 17, and severity set to Warning. Type 2 diagnostics are similar to type 1 but indicate an error, types 3 and 4 indicate warnings and errors, respectively, with file and line unspecified. Type 5 diagnostics indicate are generated by the nmake license manager. Diagnostics without a specified file / line number are associated with the project as a whole rather than on a specific resource within the project.

In certain cases, error and warning diagnostics do not indicate the correct file and line number. Specifically, run time nmake messages orginating when inside a .MAKE block may provide the target name in the file position, and the line number of the block disregarding commands and white space. These cases are currently treated like a message without a file name / line number (the CDT error parser framework treats the errors as such when the provided file name does not correspond to an existing file).

In addition to defining nmake specific error parsers, the nmake specific build definitions (see Section 4.1, “nmake Build Definitions”) have been modified so that the nmake error parser is automatically enabled when the nmake build definitions are selected. The CDT pushd/popd current directory detector is also prepended to the list of error parsers in the build definition. This enables interpretation of GNU style recurse messages, allowing error markers created from problems in recursive builds to be associated with files in the correct project subdirectory (nmake can be configured to output GNU style recurse messages by setting recurse_begin_message=gnu). The gmake error parser is also added in case somewhere along the line a gmake or make style error message needs to be interpreted in an nmake based build.