[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDGREPPE Separation ] [ Next=PDGREPPE Replace Symbols > ]

Intelligence Services

PDGREPPE Definitions

There are 2 varieties of Definitions (DEF's), Simple and Macro.

Simple Definitions:

 @<d>		insert definition <d> from pattern definition file here

A Definition name (DNAME) begins with the @ character
followed by a non-digit character in a standard variable range

	[a-zA-Z_]

and possible trailing characters in the standard variable
range of

	[0-9A-Za-z].

(The option -jv<d> can be used to change characters possible in
a variable name, but the first digit of a variable name must NOT
be a digit 0-9.)

A DNAME can be like @cat, @dog, @TOTAL, @Minus, @Tarantula,
@Under_Score, @a999, etc, but NOT @666.

DNAME's and Definition Patterns (DPAT's) are placed into a text
file You create.  The basic form of a DEF is

	<DNAME>		<DPAT>

in the text file.  (The "<" and ">" are omitted.)

Full Syntax and other information about DEF's is given in the
PDL (Pattern Definition Language) Section that follows.

A definition name can be up to 256 bytes long and must occur on
just one line.  They are case sensitive: upper and lower case
letters must match in a pattern and in the PDFILE.

Patterns can be continued onto the next line by using a
backslash "\" at the end of a line.

Lines can be comments by using a semicolon ";" to start a line.
They also can be continued to the next line by a backslash.

You can use the "-jF<d>" option to put plenty large definitions
or variable names in a pattern within a Command Line File.

Definition files can be any size supported by your system.

DNAME's are used by PDGREPPE for retrieval of pattern
definitions from definition files (PDFILE's).

PDFILE's contain pairs of definition names and actual definitions.

Example:


	pdgreppe -1 -Hjc "@Consonant+" file_id.diz


..."@Consonant+" finds some consonant spans "+" because a
definition line

	Consonant		[\C]

is in ere.def

and "+" after [\C] means one or more of previous.

Macro Parameter Definitions:

 @@<d>(<P>)	same but use <P> for Parameter in definition Macro

Macro Definitions have names similar to Simple Definition names but
have two '@' characters at the front.

In these, a simple text substitution is made in the Definition file with
the parameter <P>.

The format for a definition in the Definition file is

<DefinitionName><Space(s)><UniqueParameterName><Space(s)><Definition>

Example:

A macro defined in a Definition file is

	MakeMy Day ThisIsDay

Here, "MakeMy" is the definition name, "Day" is the parameter
for substitution placement, and "ThisIsDay" is the full
definition, that includes one occurrence of "Day".

So if a user has a pattern

	@@MakeMy(Monday)

the resulting pattern will become

	ThisIsMonday

because "Monday" is substituted wherever

	"Day"

occurs in the full definition of the Definition file

	"ThisIsDay"

This simple one parameter macro capability has been added to
help create search items more easily.

An Example:

To find up to the First occurrence of something, a pattern like
this might be used

	{{Something}!.}*

which means wherever there is NOT "!" {Something} found, advance
by one character "." for zero or more times "*".

So an easier way to make a Magic expressions is to use
MACRO's like

	AdvanceUpTo	PARAM	{{PARAM}!.}+


	pdgreppe -1 -Hjc "@@AdvanceUpTo(E)" file_id.diz


...that finds some characters up to the first possible occurrence
of a Capital "E".

Easier than having to type in a pattern like

	{{E}!.}+

Another example:


	pdgreppe -1 -Hjc "@@AdvanceUpTo(\u+)" file_id.diz


...that finds some series of characters up to a Capitalised
sequence but not the sequence itself.

IMPORTANT:

When using PDL @Definitions any NUMBERED marked group reference

	%<n> or #<n>

must be in the current pattern definition.


See the PDL (Pattern Definition Language) Information section.


[ < < < Home ] [ < < Reference Start ] [ < Reference Contents ]
[ < Previous=PDGREPPE Separation ] [ Next=PDGREPPE Replace Symbols > ]

Intelligence Services

© Intelligence Services 1987 - 2008   GPO Box 9,   ADELAIDE SA 5001,   AUSTRALIA
EMAIL   :   intlsvs@gmail.com