Home Libraries Author Links

Abstract Data Type StmQreMtc
[Abstract Data Type StmRe]

Collaboration diagram for Abstract Data Type StmQreMtc:

Detailed Description

StmQreMtc is an abstract data type used to describe the match of a qualified regular expression qualifRe.

QreMtc.

An object of abstract data type StmQreMtc describes a successful match of a qualified regular expression qualifRe (see Regular Expression Syntax). A valid StmQreMtc object is passed as argument to qualified regular expression action functions defined by stmQreActDef() in order to describe the match. Invalid StmQreMtc objects have value NULL.

In connection with a StmQreMtc object some notation is used:

A valid StmQreMtc object describing a positive match contains references to valid StmReMtc objects describing the matches of its simpleRe's except of those fulfilling all the following conditions (see Regular Expression Syntax and StmReMtc):

A match of a valid StmQreMtc object's simpleRe fulfilling all the above conditions is called not further described, else further described by a StmReMtc object.

A valid StmQreMtc object describing an inverse match never contains references to further described simpleRe matches.

The StmQreMtc functions from stmQreMtcEnv() to stmQreMtcQualifReNr() are intended to be called from within regular expression or qualified regular expression action functions defined by means of stmReCreate() and stmQreActDef().


Files

file  StmQreMtcAdtDoc.h
 Documentation of the abstract structure data type type StmQreMtc.

StmQreMtc Representation

An object of abstract data type StmQreMtc is represented as a pointer to its implementation.

typedef struct StmQreMtcImpl_ StmQreMtcImpl_
 Type name of implementation structure.
typedef StmQreMtcImpl_StmQreMtc
 Pointer to implementation.
typedef const StmQreMtcImpl_ConstStmQreMtc
 Pointer to constant implementation.

Functions

void * stmQreMtcEnv (StmQreMtc qreMtc)
 Return a pointer to the global environment of a qualified regular expression match.
void * stmQreMtcData (StmQreMtc qreMtc)
 Return a pointer to the match data of a qualified regular expression match.
void stmQreMtcSetData (StmQreMtc qreMtc, void *data)
 Set a qualified regular expression match's match data.
const char * stmQreMtcStr (StmQreMtc qreMtc)
 Return the matching string held by a qualified regular expression match.
int stmQreMtcLen (StmQreMtc qreMtc)
 Return the length of the matching string held by a qualified regular expression match.
int stmQreMtcSimpleReMtcCount (StmQreMtc qreMtc)
 Return the simpleRe match count of a qualified regular expression match.
StmReMtc stmQreMtcNthSimpleReMtc (StmQreMtc qreMtc, unsigned nth)
 Return the StmReMtc object describing the nth match of the simpleRe of a qualified regular expression match.
const char * stmQreMtcNthSimpleReMtcStr (StmQreMtc qreMtc, unsigned nth)
 Return the matching string of the nth SimpleRe of a qualified regular expression match.
int stmQreMtcNthSimpleReMtcLen (StmQreMtc qreMtc, unsigned nth)
 Return the length of the matching string of the nth simpleRe of a qualified regular expression match.
void * stmQreMtcNthSimpleReMtcData (StmQreMtc qreMtc, unsigned nth)
 Return a pointer to the match data of the StmReMtc object describing the match of the nth simpleRe of a qualified regular expression match.
StmReMtc stmQreMtcSuperReMtc (StmQreMtc qreMtc)
 Return the StmReMtc object describing the match of the superior matching term of a qualified regular expression match.
void * stmQreMtcSuperReMtcData (StmQreMtc qreMtc)
 Return a pointer to the match data of the StmReMtc object describing the match of the superior matching term of a qualified regular expression match.
StmReMtc stmQreMtcNthSuperReMtc (StmQreMtc qreMtc, unsigned nth)
 Return the StmReMtc object describing the match of the nth superior matching term of a qualified regular expression match.
void * stmQreMtcNthSuperReMtcData (StmQreMtc qreMtc, unsigned nth)
 Return a pointer to the match data of the StmReMtc object describing the match of the nth superior matching term of a qualified regular expression match.
int stmQreMtcQualifReNr (StmQreMtc qreMtc)
 Return the qualifRe number of a qualified regular expression match.


Typedef Documentation

typedef struct StmQreMtcImpl_ StmQreMtcImpl_

Type name of implementation structure.

Definition at line 60 of file StmQreMtcAdtDoc.h.

typedef StmQreMtcImpl_* StmQreMtc

Pointer to implementation.

Examples:
cuglify.c, and matchtst.c.

Definition at line 63 of file StmQreMtcAdtDoc.h.

typedef const StmQreMtcImpl_* ConstStmQreMtc

Pointer to constant implementation.

Definition at line 66 of file StmQreMtcAdtDoc.h.


Function Documentation

void* stmQreMtcEnv ( StmQreMtc  qreMtc  ) 

Return a pointer to the global environment of a qualified regular expression match.

The function stmQreMtcEnv returns a pointer to the global environment of the qualified regular expression of a valid StmQreMtc object qreMtc. If qreMtc is invalid (NULL), NULL is returned.

Examples:
cuglify.c, and matchtst.c.

Referenced by bout(), chkif(), cmode(), cnlout(), commout(), decif(), errout(), incif(), incLineNumber(), newfile(), newlnr(), out(), pnlout(), pout(), and setclbeg().

void* stmQreMtcData ( StmQreMtc  qreMtc  ) 

Return a pointer to the match data of a qualified regular expression match.

The function stmQreMtcData returns a pointer to the match data of the qualified regular expression of a valid StmQreMtc object qreMtc. If qreMtc is invalid (NULL), NULL is returned.

void stmQreMtcSetData ( StmQreMtc  qreMtc,
void *  data 
)

Set a qualified regular expression match's match data.

The function stmQreMtcSetData defines the memory pointed to by data as the match data of a valid StmQreMtc object qreMtc. If qreMtc is invalid (NULL), no action is performed.

const char* stmQreMtcStr ( StmQreMtc  qreMtc  ) 

Return the matching string held by a qualified regular expression match.

The function stmQreMtcStr returns a pointer to the first character of the matching string of a valid StmQreMtc object qreMtc. If qreMtc is invalid (NULL), NULL is returned.

Examples:
cuglify.c, and matchtst.c.

Referenced by bout(), chkif(), cmode(), cnlout(), commout(), decif(), errout(), incif(), newfile(), newlnr(), out(), pnlout(), pout(), and setclbeg().

int stmQreMtcLen ( StmQreMtc  qreMtc  ) 

Return the length of the matching string held by a qualified regular expression match.

The function stmQreMtcStrLen returns the length of the matching string of a valid StmQreMtc object qreMtc. If qreMtc is invalid (NULL), -1 is returned.

Examples:
cuglify.c, and matchtst.c.

Referenced by bout(), chkif(), cmode(), cnlout(), commout(), decif(), errout(), incif(), newfile(), newlnr(), out(), pnlout(), pout(), and setclbeg().

int stmQreMtcSimpleReMtcCount ( StmQreMtc  qreMtc  ) 

Return the simpleRe match count of a qualified regular expression match.

The function stmQreMtcSimpleReMtcCount returns the simpleRe match count (the effective repetition factor q, see Regular Expression Syntax) of a valid qreMtc object. If qreMtc is invalid (NULL), -1 is returned.

Examples:
cuglify.c, and matchtst.c.

Referenced by bout(), incLineNumber(), and out().

StmReMtc stmQreMtcNthSimpleReMtc ( StmQreMtc  qreMtc,
unsigned  nth 
)

Return the StmReMtc object describing the nth match of the simpleRe of a qualified regular expression match.

If the nth (zero based) match of the simpleRe of a valid StmQreMtc object qreMtc exists and is further described by a StmReMtc object, the function stmQreMtcNthSimpleReMtc returns that StmReMtc object, else NULL. If qreMtc is invalid (NULL), NULL is returned.

const char* stmQreMtcNthSimpleReMtcStr ( StmQreMtc  qreMtc,
unsigned  nth 
)

Return the matching string of the nth SimpleRe of a qualified regular expression match.

If the nth (zero based) simpleRe of a valid StmQreMtc object qreMtc exists (not depending on the fact whether its match is further desrcibed by a StmReMtc object or not), the function stmQreMtcNthSimpleReMtcStr returns a pointer to the first character of the matching string of that simpleRe, else NULL. If qreMtc is invalid (NULL), NULL is returned.

int stmQreMtcNthSimpleReMtcLen ( StmQreMtc  qreMtc,
unsigned  nth 
)

Return the length of the matching string of the nth simpleRe of a qualified regular expression match.

If the nth (zero based) simpleRe of a valid StmQreMtc object qreMtc exists (not depending on the fact whether its match is further desrcibed by a StmReMtc object or not), the function stmQreMtcNthSimpleReMtcLen returns the length of the matching string of that simpleRe, else -1. If qreMtc is invalid (NULL), -1 is returned.

void* stmQreMtcNthSimpleReMtcData ( StmQreMtc  qreMtc,
unsigned  nth 
)

Return a pointer to the match data of the StmReMtc object describing the match of the nth simpleRe of a qualified regular expression match.

If the nth (zero based) simpleRe of a valid StmQreMtc object qreMtc exists and if its match is further desrcibed by a StmReMtc object the function stmQreMtcNthSimpleReMtcData returns a pointer to the match data of the StmReMtc object of that simpleRe, else NULL. If qreMtc is invalid (NULL), NULL is returned.

StmReMtc stmQreMtcSuperReMtc ( StmQreMtc  qreMtc  ) 

Return the StmReMtc object describing the match of the superior matching term of a qualified regular expression match.

If the superior matching term of a valid StmQreMtc object qreMtc is defined, the function stmQreMtcSuperReMtc returns the StmReMtc object describing that term's match, else NULL. If qreMtc is invalid (NULL), NULL is returned.

void* stmQreMtcSuperReMtcData ( StmQreMtc  qreMtc  ) 

Return a pointer to the match data of the StmReMtc object describing the match of the superior matching term of a qualified regular expression match.

If the superior matching term of a valid StmQreMtc object qreMtc is defined, the function stmQreMtcSuperReMtcData returns a pointer to the match data of that term's match, else NULL. If qreMtc is invalid (NULL), NULL is returned.

StmReMtc stmQreMtcNthSuperReMtc ( StmQreMtc  qreMtc,
unsigned  nth 
)

Return the StmReMtc object describing the match of the nth superior matching term of a qualified regular expression match.

If the nth superior matching term of a valid StmQreMtc object qreMtc is defined, the function stmQreMtcNthSuperReMtc returns the StmReMtc object describing that term's match, else NULL. If qreMtc is invalid (NULL), NULL is returned.

void* stmQreMtcNthSuperReMtcData ( StmQreMtc  qreMtc,
unsigned  nth 
)

Return a pointer to the match data of the StmReMtc object describing the match of the nth superior matching term of a qualified regular expression match.

If the nth superior matching term of a valid StmQreMtc object qreMtc is defined, the function stmQreMtcNthSuperReMtcData returns a pointer to the match data of that term's match, else NULL. If qreMtc is invalid (NULL), NULL is returned.

int stmQreMtcQualifReNr ( StmQreMtc  qreMtc  ) 

Return the qualifRe number of a qualified regular expression match.

The function stmQreMtcQualifReNr returns the qualifRe number of a valid StmQreMtc object qreMtc. If qreMtc is invalid (NULL), -1 is returned.


© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).