home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Archive Magazine 1995
/
ARCHIVE95.iso
/
discs
/
shareware
/
share_46
/
fre
/
!Help
< prev
next >
Wrap
Text File
|
1992-05-19
|
5KB
|
179 lines
Documentation on FRe v0.20 by Cy Booker 19-May-1992
Program and documentation are Copyright ⌐ Cy Booker, 1992.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Permission is granted to you to (ab)use this program to your hearts
contents provided:
1) No part of this software is used in/to develop a program for sale
without written permission from me
2) All files be included in any distribution
FRe - the code
re - documentation on regular expressions
re_formal - formal definition of a regular expression
!Help - this file
CAssembler - support module
_fre - example shell Obey file
What is FRe ?
=============
It stands for "Find Regular Expression(s)", so given a regular
expression (RE) and a list of files, it finds the files that contain
that RE.
What's the point ?
==================
OK, get your imagination into overdrive: you, yes YOU, are developing /
maintaining a fantastic program - the source code is split up into 20+
files over X directories. You haven't attacked this program for a
while. You see a reference to a variable "foo" and you want to find out
what other parts of the program refer to this variable. How do you do
it? You have to load in each file separately to your favourite source
editor (or set up a macro) and do a search... what a drag. This
program automates the searching.
Syntax
======
FRe [-Re] <regex> [[-Files] <files>] [[-Verbosity] <n>] [Options]
Options:
Verbosity <n> 0-3, 0=> no output, 3=>list all lines (2)
All parse all files as Text (OFF)
Basic pre-process Basic tokenised files (OFF)
Help display this information
HourGlass <n> 0 off, 1 on, 2 percentage each file (1)
ICase ignore case of all letters during match (OFF)
ISpace translate all whitespaces to " " (OFF)
Not success is a line NOT matching the <regex> (OFF)
Recurse go into sub-directories (OFF)
Scan show files as being parsed (OFF)
Via <files> the name of file(s) containing more file names to check
<files> is a comma separated list of wildcarded file names
Note that by default only parse Text and Basic files
Also note that when scanning a Basic file, the character "`" is
automatically included as a symbol character.
Via files
=========
These are just plain Text files where each line is a <files> (a comma
separated list of wildcarded filenames). Comments are lines starting
with "-", "#", or ";".
For example:-
# This is a via line for the wimp$app
#
- Source
<Wimp$App>.c.*
<Wimp$App>.h.*
- Docs
<Wimp$App>.docs, <Wimp$App>.doc.*, <Wimp$App>.!Help
- System
<Wimp$App>.!Run, <Wimp$App>.!Run
#
# End of file
Examples
========
Find the sequence "printf" in all text files in the current directory
FRe printf *
Display all lines that contain the word "the", capitalised or not in
the two files $.!Help and foo.bar
FRe \<(T|t)he\> $.!Help,foo.bar 3
or,
FRe -Re \<(T|t)he\> -Files "$.!Help, foo.bar" -Verbosity 3
List files that contain at least one matching re
FRe "Frank Zappa" -Verbosity 1 -Via filelist -Scan
The -Scan shows each file as it is being processed, which is handy for
interactive work. However, if you are re-directing the output to a
file, it is not recommended!
Find references to the procedure "_hello" in a basic file "world".
FRe \½PROC_hello\╗ world -Basic
or,
FRe \xF2_hello\╗ world
The former works because each tokenised basic line gets expanded
before matching starts. The later works because the token for PROC is
252, or &F2.
Bad
===
o Well, since it is an application you can't run it from another
application that doesnt spawn child processes (ie basic).
o It requires the CAssembler module to be resident at time of
execution.
o Using the -Basic switch makes basic file parsing very slow.
o The expansion of Basic tokens only works for BasicV v1.04 English.
Good
====
o It handles Basic files properly
o Can expand tokenised basic files
o It is fast
o Handles wildcard filenames
o Handles lists of filenames
o Recurses into sub-directories
o Takes up very little application space
o The "symbol" matching in the RE's
o It returns with the number of matching files
Updates
=======
23-Apr-1992 First release
19-May-1992 Second release, uses less memory at run-time: Improved Obey file
Credits
=======
The regular expression parsing was based on (somewhat inconsistent) code
that is Copyright the Free Software Foundation, 1985. And so if anyone
wants the source code to my version / the original then send us a
disc...
Author
======
Cy Booker
86 Church View
Main Road
Crockenhill
Swanley
Kent
BR8 8JW
United Kingdom