The C/C++ Development plugin provides support for launching arbitrary commands and parsing the output in user-defined ways. The intent is to "wrap" command line tools, so that any command output that contains references to files can be parsed to give the user the ability to click on pieces of output and get taken to the appropriate file location in the Source View. Any output from a command issued from the Command View will appear in the Output View. Lines that are not successfully parsed will just appear as regular lines of text. If a line is parsed, it will appear as an object that the user can double-click on to get to the Source Location. A perfect example, and probably one of the most common uses for this function is grep,
the powerful searching tool. If grep is installed on your system, you would use it in
the following way in a typical Windows shell:
So in this example, grep found 2 matches of "cout" in the file payroll.cpp (on lines 14 and 15).The -Hn options tell grep to include the file names and line numbers in the output. Since the output format of most command-line tools is predicatable, it is not hard to parse the output to grab the filename and line number. If you launched the same grep command as above in the Command View, the Output View would like this: ![]() This section and " formats.htm " ( see link below ) need to be re-written because of changes to how command output has changed. Both lines of output were parsed to get the file information, so that if you Double-Clicked on either of the lines, the Source View would open payroll.cpp and move to the appropriate line. A file called patterns.dat located in the <...>/eclipse/plugins/com.ibm.cpp.core directory contains the formats that the system will use while trying to parse command output. This file can be changed by the user at runtime, to control how the parsing is done.For details on how to change patterns.dat go to Formats. The default patterns.dat that comes with this installation contains a format that could
parse the grep output above: See Formats for information on format syntax and usage. |