10.02.2013 Views

SlickEdit User Guide

SlickEdit User Guide

SlickEdit User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUILDING AND COMPILING<br />

Exclusions<br />

Some of the error parsing expressions may match lines that you do not want recognized as errors. To<br />

eliminate these “false positive” matches, define a new expression in the Exclusions category. The default<br />

configuration file contains an expression to match the “Total Time” build output line that is generated by<br />

<strong>SlickEdit</strong>®'s internal build system, vsbuild. Any new exclusion expressions you write should be very strict<br />

to prevent real error lines from being skipped. You do not have to define match groups in the exclusion<br />

expressions since they will not be used to extract file name and line number information.<br />

Editing Expressions<br />

To edit an existing expression, double-click the expression in the expression listing, or highlight the<br />

expression and click the small Edit button to the right of the listing. This launches the same dialog that is<br />

used to create a new expression.<br />

Error Expression Groups<br />

In order to navigate to the file that caused the build error or warning, the regular expression needs to be<br />

able to identify the file name, and optionally the line and column number, as well as the error message.<br />

This is accomplished by using four Tagged Expressions, also known as match groups. The following table<br />

documents the match groups used to identify specific portions of an error message.<br />

Group Number Group Syntax Purpose<br />

0 {#0:p} Retrieves the file name or file path.<br />

1 {#1:i} Retrieves the error line number.<br />

2 {#2:i} Retrieves the error column.<br />

3 {#3} Retrieves the error message text.<br />

The expression for Group #3 can match any portion of the error message you like. The sample expression<br />

{#3?+}$ is just matching all remaining characters up to the end of the line. The groups can occur in any<br />

order in your expression. For example, if the build tool output places the file name, line, and column after<br />

the error message, like the following hypothetical example:<br />

Error E509: Bad format: found in /usr/tmp/file.x, line 23, column 13<br />

then your expression might look something like the following:<br />

^Error {#3?+} found in {#0:p},:bline:b{#1:i},:bcolumn:b{#2:i}$<br />

Sample: Creating a New Error Parsing Expression<br />

The steps below demonstrate creating a new regular expression to support error output from a Lint tool.<br />

Below are some samples of the tool’s output.<br />

Sample 1:<br />

file.cpp (5) : Warning 200: Possible dereferencing of null pointer<br />

Sample 2:<br />

includes\file.h (17) : Warning 003: Macro not parenthesized<br />

1. Create a new expression category, and name it “Lint”.<br />

2. Highlight the newly created Lint category. The Expressions listing is empty.<br />

182 <strong>SlickEdit</strong>® <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!