Home Libraries Author Links

Abstract Data Type StmReMtc
[Abstract Data Type StmRe]

Collaboration diagram for Abstract Data Type StmReMtc:

Detailed Description

StmReMtc is an abstract data type used to describe the match of a regular expression reStr.

ReMtc.

An object of abstract data type StmReMtc describes a successful match of a regular expression reStr (see Regular Expression Syntax). A valid StmReMtc object is passed as argument to the regular expression's action function defined by stmReCreate() in order to describe the match. Invalid StmReMtc objects have value NULL.

In connection with a StmReMtc object some notation is used:

A valid StmReMtc object contains references to valid StmQreMtc objects describing the matches of its qualifRe factors except of those fulfilling all the following conditions (see Regular Expression Syntax and StmQreMtc):

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

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


Files

file  StmReMtcAdtDoc.h
 Documentation of the abstract structure data type type StmReMtc.

StmReMtc Representation

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

typedef struct StmReMtcImpl_ StmReMtcImpl_
 Type name of implementation structure.
typedef StmReMtcImpl_StmReMtc
 Pointer to implementation.
typedef const StmReMtcImpl_ConstStmReMtc
 Pointer to constant implementation.

Functions

const char * stmReMtcReName (StmReMtc reMtc)
 Return the name of a match's regular expression.
StmBool stmReMtcReNested (StmReMtc reMtc)
 Return if a match's regular expression is unnamed.
const char * stmReMtcReContextName (StmReMtc reMtc)
 Return the context name of a match's regular expression.
const char * stmReMtcReStr (StmReMtc reMtc)
 Return a pointer to the string representation of a match's regular expression.
int stmReMtcReStrLen (StmReMtc reMtc)
 Return the length of the string representation of a match's regular expression.
void * stmReMtcEnv (StmReMtc reMtc)
 Return a pointer to the global environment of a regular expression match.
void * stmReMtcData (StmReMtc reMtc)
 Return a pointer to the match data of a regular expression match.
void stmReMtcSetData (StmReMtc reMtc, void *data)
 Set a regular expression match's match data address.
const char * stmReMtcStr (StmReMtc reMtc)
 Return the matching string held by a regular expression match.
int stmReMtcLen (StmReMtc reMtc)
 Return the length of the matching string held by a regular expression match.
int stmReMtcQreMtcCount (StmReMtc reMtc)
 Return the qualifRe count of a regular expression match.
StmQreMtc stmReMtcNthQreMtc (StmReMtc reMtc, unsigned nth)
 Return the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.
const char * stmReMtcNthQreMtcStr (StmReMtc reMtc, unsigned nth)
 Return the matching string of the nth qualifRe factor of a regular expression match.
int stmReMtcNthQreMtcLen (StmReMtc reMtc, unsigned nth)
 Return the length of the matching string of the nth qualifRe factor of a regular expression match.
void * stmReMtcNthQreMtcData (StmReMtc reMtc, unsigned nth)
 Return a pointer to the match data of the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.
int stmReMtcNthSimpleReMtcCount (StmReMtc reMtc, unsigned nth)
 Return the simpleRe match count of the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.
StmReMtc stmReMtcNthMthSimpleReMtc (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return the StmReMtc object describing the mth simpleRe match of the nth qualifRe factor of a regular expression match.
const char * stmReMtcNthMthSimpleReMtcStr (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return the matching string of the mth simpleRe match of the nth qualifRe factor of a regular expression match.
int stmReMtcNthMthSimpleReMtcLen (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return the length of the matching string of the mth simpleRe match of the nth qualifRe factor of a regular expression match.
void * stmReMtcNthMthSimpleReMtcData (StmReMtc reMtc, unsigned nth, unsigned mth)
 Return a pointer to the match data of the StmReMtc object describing the match of the mth simpleRe of the nth qualifRe factor of a regular expression match.
int stmReMtcMtermNr (StmReMtc reMtc)
 Return the matching term number of a regular expression match.
StmQreMtc stmReMtcSuperQreMtc (StmReMtc reMtc)
 Return the StmQreMtc object describing the match of the superior qualified regular expression of a regular expression match.
void * stmReMtcSuperQreMtcData (StmReMtc reMtc)
 Return a pointer to the match data of the StmQreMtc object describing the match of the superior qualified regular expression of a regular expression match.
StmReMtc stmReMtcNthSuperReMtc (StmReMtc reMtc, unsigned nth)
 Return the StmReMtc object describing the match of the nth superior matching term of a regular expression match.
void * stmReMtcNthSuperReMtcData (StmReMtc reMtc, unsigned nth)
 Return a pointer to the match data of the StmReMtc object describing the match of the nth superior matching term of a regular expression match.
int stmReMtcSimpleReMtcNr (StmReMtc reMtc)
 Return the simpleRe match number of a regular expression match.


Typedef Documentation

typedef struct StmReMtcImpl_ StmReMtcImpl_

Type name of implementation structure.

Definition at line 60 of file StmReMtcAdtDoc.h.

typedef StmReMtcImpl_* StmReMtc

Pointer to implementation.

Examples:
matchtst.c.

Definition at line 63 of file StmReMtcAdtDoc.h.

typedef const StmReMtcImpl_* ConstStmReMtc

Pointer to constant implementation.

Definition at line 66 of file StmReMtcAdtDoc.h.


Function Documentation

const char* stmReMtcReName ( StmReMtc  reMtc  ) 

Return the name of a match's regular expression.

The function stmReMtcReName returns the name of the regular expression of a valid StmReMtc object reMtc, if that regular expression is named (defined by stmReCreate()), else the empty string. If reMtc is invalid (NULL), NULL is returned.

StmBool stmReMtcReNested ( StmReMtc  reMtc  ) 

Return if a match's regular expression is unnamed.

The function stmReMtcReNested returns StmTrue, if the regular expression of a valid StmReMtc object reMtc is unnamed (not defined by stmReCreate()) and hence nested directly or indirectly in another named regular expression, else StmFalse. If reMtc is invalid (NULL), StmFalse is returned.

const char* stmReMtcReContextName ( StmReMtc  reMtc  ) 

Return the context name of a match's regular expression.

The function stmReMtcReContextName returns the name of the context regular expression of a valid StmReMtc object reMtc. This is the name of the regular expression of reMtc, if that regular expression is named (defined by stmReCreate()), else the name of its nearest superior named regular expression. If reMtc is invalid (NULL), NULL is returned.

const char* stmReMtcReStr ( StmReMtc  reMtc  ) 

Return a pointer to the string representation of a match's regular expression.

The function stmReMtcReStr returns a pointer to the first character of the string representing the regular expression of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), NULL is returned.

int stmReMtcReStrLen ( StmReMtc  reMtc  ) 

Return the length of the string representation of a match's regular expression.

The function stmReMtcReStrLen returns the length of the string representing the regular expression of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), -1 is returned.

void* stmReMtcEnv ( StmReMtc  reMtc  ) 

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

The function stmReMtcEnv returns a pointer to the global environment of the regular expression of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), NULL is returned.

void* stmReMtcData ( StmReMtc  reMtc  ) 

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

The function stmReMtcData returns a pointer to the match data of the regular expression of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), NULL is returned.

void stmReMtcSetData ( StmReMtc  reMtc,
void *  data 
)

Set a regular expression match's match data address.

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

const char* stmReMtcStr ( StmReMtc  reMtc  ) 

Return the matching string held by a regular expression match.

The function stmReMtcStr returns a pointer to the first character of the matching string of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), NULL is returned.

Examples:
matchtst.c.

Referenced by printIdent().

int stmReMtcLen ( StmReMtc  reMtc  ) 

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

The function stmReMtcStrLen returns the length of the matching string of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), -1 is returned.

Examples:
matchtst.c.

Referenced by printIdent().

int stmReMtcQreMtcCount ( StmReMtc  reMtc  ) 

Return the qualifRe count of a regular expression match.

The function stmReMtcQreMtcCount returns qualifRe count of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), -1 is returned.

StmQreMtc stmReMtcNthQreMtc ( StmReMtc  reMtc,
unsigned  nth 
)

Return the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.

If the nth (zero based) qualifRe factor of a valid StmReMtc object reMtc exists and its match is further desrcibed by a StmQreMtc object, the function stmReMtcNthQreMtc returns that StmQreMtc object, else NULL. If reMtc is invalid (NULL), NULL is returned.

const char* stmReMtcNthQreMtcStr ( StmReMtc  reMtc,
unsigned  nth 
)

Return the matching string of the nth qualifRe factor of a regular expression match.

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

int stmReMtcNthQreMtcLen ( StmReMtc  reMtc,
unsigned  nth 
)

Return the length of the matching string of the nth qualifRe factor of a regular expression match.

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

void* stmReMtcNthQreMtcData ( StmReMtc  reMtc,
unsigned  nth 
)

Return a pointer to the match data of the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.

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

int stmReMtcNthSimpleReMtcCount ( StmReMtc  reMtc,
unsigned  nth 
)

Return the simpleRe match count of the StmQreMtc object describing the match of the nth qualifRe factor of a regular expression match.

If the nth (zero based) qualifRe factor of a valid StmReMtc object reMtc exists (not depending on the fact whether its match is further desrcibed by a StmQreMtc object or not) the function stmReMtcNthSimpleReMtcCount returns the simpleRe match count (the effective repetition factor q, see Regular Expression Syntax) of the match of that qualifRe factor, else -1. If reMtc is invalid (NULL), -1 is returned.

StmReMtc stmReMtcNthMthSimpleReMtc ( StmReMtc  reMtc,
unsigned  nth,
unsigned  mth 
)

Return the StmReMtc object describing the mth simpleRe match of the nth qualifRe factor of a regular expression match.

If the mth (zero based) simpleRe match of the of the nth (zero based) qualifRe factor of a valid StmReMtc object reMtc exists and is further described by a StmReMtc object, the function stmReMtcNthMthSimpleReMtc returns that StmReMtc object, else NULL. If reMtc is invalid (NULL), NULL is returned.

const char* stmReMtcNthMthSimpleReMtcStr ( StmReMtc  reMtc,
unsigned  nth,
unsigned  mth 
)

Return the matching string of the mth simpleRe match of the nth qualifRe factor of a regular expression match.

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

int stmReMtcNthMthSimpleReMtcLen ( StmReMtc  reMtc,
unsigned  nth,
unsigned  mth 
)

Return the length of the matching string of the mth simpleRe match of the nth qualifRe factor of a regular expression match.

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

void* stmReMtcNthMthSimpleReMtcData ( StmReMtc  reMtc,
unsigned  nth,
unsigned  mth 
)

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

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

int stmReMtcMtermNr ( StmReMtc  reMtc  ) 

Return the matching term number of a regular expression match.

The function stmReMtcMtermNr returns the matching term number of a valid StmReMtc object reMtc. If reMtc is invalid (NULL), -1 is returned.

StmQreMtc stmReMtcSuperQreMtc ( StmReMtc  reMtc  ) 

Return the StmQreMtc object describing the match of the superior qualified regular expression of a regular expression match.

If the superior qualified regular expression qualifRe of a valid StmReMtc object reMtc is defined, the function stmReMtcSuperQreMtc returns the StmQreMtc object describing that qualifRe's match, else NULL. If reMtc is invalid (NULL), NULL is returned.

void* stmReMtcSuperQreMtcData ( StmReMtc  reMtc  ) 

Return a pointer to the match data of the StmQreMtc object describing the match of the superior qualified regular expression of a regular expression match.

If the superior qualified regular expression qualifRe of a valid StmReMtc object reMtc is defined, the function stmReMtcSuperQreMtcData returns a pointer to the match data of that qualifRe's match, else NULL. If reMtc is invalid (NULL), NULL is returned.

StmReMtc stmReMtcNthSuperReMtc ( StmReMtc  reMtc,
unsigned  nth 
)

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

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

void* stmReMtcNthSuperReMtcData ( StmReMtc  reMtc,
unsigned  nth 
)

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

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

int stmReMtcSimpleReMtcNr ( StmReMtc  reMtc  ) 

Return the simpleRe match number of a regular expression match.

The function stmReMtcSimpleReMtcNr returns the simpleRe match number of a valid StmReMtc reMtc object. If reMtc 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).