15.07.2013 Views

jgrasp handbook

jgrasp handbook

jgrasp handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DRAFT, February 18, 2003, Page 112<br />

CSD window, and the icon will not appear on the toolbar. If a run command is empty, that command will<br />

not appear on the "Run" menu of the CSD Window, and the icon will not appear on the toolbar.<br />

A variety of execution-time variables may be applied to commands and directories. Also, two static<br />

variables, %V1 and %V2, can be specified at the bottom of the page.<br />

Environment variables can also be modified.<br />

Whitespace separates arguments in commands. Use double quotes to specify an argument containing<br />

whitespace. Use %' (percent-single quote) to include a double quote in a quoted argument. Any variable<br />

can also be used in a quoted argument, and %% (percent-percent) must be used to include a percent<br />

symbol.<br />

"Command" specifies the command. All variables may be used.<br />

"Directory" specifies the working directory for the command. If left blank, the directory containing the file<br />

will be used. %PATH, %base, and for Java, %PACKAGE_PATH variables may be used here.<br />

"Error Format" specifies the error format for the command. The format string begins with a list of target<br />

flags, followed by a dash. The rest of the string is a Perl5 regular expression. See the perlre man page<br />

for a description of this format.<br />

The target flags are:<br />

f = filename<br />

c = class<br />

1 = start line<br />

2 = start column<br />

3 = end line<br />

4 = end column<br />

For click-to-error to work, the numbers of target flags must be equal to the number of matching groups in<br />

the regular expression. If a filename or class is matched and the corresponding file exists, a click will<br />

open the file. If the start line is matched, that line will be highlighted. If the start and end lines and<br />

columns are matched, that piece of text will be matched. If a filename and class are matched, the<br />

filename will be tried first. If the same target type matches multiple times, the last match is used.<br />

Unmatched groups are ignored, so you can use or'ed expressions and repeated target flags to match<br />

multiple possible formats. No error message is reported if the format is bad, or the number of target flags<br />

does not match the number of groups. On the control panel "Tools" menu, there is a testing tool for<br />

pattern matches.<br />

As an example, "f1-(\S(?:\s*\S)*):(\d+):.*" will match the file and line number of a GNU-style error<br />

message. The regular expression reads as: a matching group containing (a non-whitespace character<br />

followed by any number of non-matching groups consisting of any number of whitespace characters<br />

followed by one non-whitespace character); followed by a colon; followed by a matching group consisting<br />

of one or more digits; followed by a colon; followed by anything. In other words,<br />

"filename:line_number:other_text", where filename must begin and end with non-whitespace characters<br />

and be at least one character long, and line_number consists of one or more digits.<br />

"Environment" allows environment variables to be changed. Variables are set one-per-line, using the<br />

following format:<br />

Replace: VAR=VALUE<br />

Prepend: VAR+=VALUE<br />

Append: VAR=+VALUE

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

Saved successfully!

Ooh no, something went wrong!