Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Data Structures | Macros | Functions
attributes.h File Reference

Header file for the attributes functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  attrs_ctx
 The API will construct an attributes object. This is the attribute object's context. More...
 

Macros

#define BOOL_UNDEFINED   ((abool)-1)
 

Functions

void vAttrsDtor (void *vpCtx)
 The API object destructor. More...
 
void vRuleDependencies (attrs_ctx *spAtt)
 Compute each rule's dependencies on the other rules, and possibly on itself if the rule is recursive. More...
 
void vRuleAttributes (attrs_ctx *spAtt)
 Computes the attributes of each rule in the grammar. More...
 
void vAttrsByName (api_attr *spAttrs, aint uiCount, FILE *spStream)
 Display the attributes sorted by rule name. More...
 
void vAttrsByIndex (api_attr *spAttrs, aint uiCount, FILE *spStream)
 Display the attributes sorted by rule index. More...
 
void vAttrsByType (api_attr *spAttrs, aint uiCount, FILE *spStream)
 Display the attributes sorted by attribute type. More...
 
const char * cpType (aint uiId)
 Convert an attribute type ID to an ASCII string. More...
 

Detailed Description

Header file for the attributes functions.

Definition in file attributes.h.

Macro Definition Documentation

◆ BOOL_UNDEFINED

#define BOOL_UNDEFINED   ((abool)-1)

Definition at line 36 of file attributes.h.

Function Documentation

◆ cpType()

const char* cpType ( aint  uiId)

Convert an attribute type ID to an ASCII string.

Parameters
uiIdAn attribute type ID (ID_ATTR_N, ID_ATTR_R or ID_ATTR_MF)

Definition at line 484 of file attributes.c.

◆ vAttrsByIndex()

void vAttrsByIndex ( api_attr spAttrs,
aint  uiCount,
FILE *  spStream 
)

Display the attributes sorted by rule index.

Parameters
spAttPointer to an attributes context returned from spAttrsCtor(). This function is only called internally, hence the context pointer is already cast correctly.
spStreamAn open stream to display to.

Definition at line 379 of file attributes.c.

◆ vAttrsByName()

void vAttrsByName ( api_attr spAttrs,
aint  uiCount,
FILE *  spStream 
)

Display the attributes sorted by rule name.

Parameters
spAttPointer to an attributes context returned from spAttrsCtor(). This function is only called internally, hence the context pointer is already cast correctly.
spStreamAn open stream to display to.

Definition at line 358 of file attributes.c.

◆ vAttrsByType()

void vAttrsByType ( api_attr spAttrs,
aint  uiCount,
FILE *  spStream 
)

Display the attributes sorted by attribute type.

Parameters
spAttPointer to an attributes context returned from spAttrsCtor(). This function is only called internally, hence the context pointer is already cast correctly.
spStreamAn open stream to display to.

Definition at line 337 of file attributes.c.

◆ vAttrsDtor()

void vAttrsDtor ( void *  vpCtx)

The API object destructor.

Since this is a "sub-object" which shares the memory context with its parent API object this destructor simply frees all memory associated with it and clears the context. The API destructor will also free all memory associated with this object.

Parameters
vpCtxPointer to an attributes context returned from spAttrsCtor(). NULL is silently ignored. However if non-NULL it must be a valid attributes context pointer.

Definition at line 184 of file attributes.c.

◆ vRuleAttributes()

void vRuleAttributes ( attrs_ctx spAtt)

Computes the attributes of each rule in the grammar.

Attributes:

  • left recursive
  • nested recursive (matched parentheses would be an example.)
  • right recursive
  • cyclic (a rule refers only to itself)
  • empty - the rule is allowed to match empty strings
  • infinite - the rule matches only infinite strings.
Parameters
spAttContext pointer to the attributes object.

Definition at line 112 of file rule-attributes.c.

◆ vRuleDependencies()

void vRuleDependencies ( attrs_ctx spAtt)

Compute each rule's dependencies on the other rules, and possibly on itself if the rule is recursive.

Parameters
spAttPointer to the attribute context.

Definition at line 58 of file rule-dependencies.c.

APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.