1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<!--Time-stamp: <2005-12-19 12:05:13 poser> -->
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META NAME="Author" CONTENT="Bill Poser">
<TITLE>Redet Reference Manual: Choice of Programs</TITLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFE2C0" VLINK="#0000EE" LINK="#AA0066" ALINK="#FF0000">
<H2><a name="choice">Choice of Programs</a></H2>
<P>
Regular expressions are not executed directly unless Tcl, the language in which
Redet is written, is chosen as the regular expression engine. Instead,
another program is called to execute the regular expression.
This guarantees that the regular expression
notation supported by the chosen program will be used. The program executed is
selected via the <u>Program</u> menu.
</p>
<br>
<br>
<div align="center">
<img src="Images/ProgramMenu.jpg" width="85%" alt="Display with Program Menu Posted" border="2">
</div>
<br clear="all">
<P>
The main search tools, editors, shells and programming languages with built-in regular expression
support are included. Naturally, only those programs installed on the machine and found
in the user's search path will be executed. If you are using <i>redet</i> to construct
a regular expression for use with a particular program, naturally you will select the
program that you intend to use. If, on the other hand, you are using <i>redet</i> as a
search tool, you will find that some choices of program are much better than others.
In general you should choose a program that supports all of the features that you wish
to use, uses a familiar notation for them, and executes quickly. You will therefore
want to avoid shells, since these execute slowly, and other large programs, such
as <i>emacs</i>. A full-featured program specifically intended for searching, such
as <i>egrep</i>, will generally be the best choice.
</p>
<p>
<i>Redet</i> has a built-in default program, which will be used in the absence
of any action by the user to choose another program. The user may select another
program at any time via the <i>Program</i> menu. An alternative initial program
may be specified in the user's initialization file or on the command line.
Specification of the program on the command line takes precedence over
specification in the initialization file.
</p>
<p>
If the initial program (whether the default or specified in the init file or on the
command line) is not available, <i>tcl</i> is selected. This guarantees that a useful regular
expression environment will be available and ensures that various things dependent on there
being a selected program will work properly.
</p>
<P>
When a new program is selected, the label of the menu button that causes execution of the regular
expression is changed to indicate the selected program. Notice how the third menu button
is now labeled <u>Execute-Python</u> instead of the <u>Execute-Egrep</u>, reflecting
the fact that the program has been changed from the default of <u>egrep</u>
to <u>python</u>.
</p>
<br>
<br>
<div align="center">
<img src="Images/ExecuteChange.jpg" width="80%" alt="Display Showing Changed Execute Button Label" border="2">
</div>
<br clear="all">
<P>
Many regular expression searching programs consider a regular expression to match the
entire input string or line if it matches anywhere in the string or line. In this case,
we may think of the regular expression as implicitly surrounded by "match anything" wildcards.
Failure to remember which programs behave which way is a common cause of errors.
Redet therefore tests for this property and marks it on the program name
in the <i>Execute-...</i> button. (Details are discussed <a href="info.html#embedding">below</a>.)
</p>
<br>
<center><a href="regexps.html">Next</a></center>
<br>
<center><a href="Manual.html">Back to Table of Contents</a></center>
</body>
</html>
|