Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
Macros | Functions
rule-attributes.c File Reference

Determines each rule's recursive attributes – left, nested, right and cyclic – and non-recursive attributes – empty and finite. More...

#include "../api/api.h"
#include "../api/apip.h"
#include "../api/attributes.h"
Include dependency graph for rule-attributes.c:

Go to the source code of this file.

Macros

#define TRACE_RULE_OPEN(x, n)
 
#define TRACE_RULE_CLOSE(x, n, a)
 
#define TRACE_OPCODE_OPEN(x, o)
 
#define TRACE_PRINT_ATTRS(x, t)
 
#define TRACE_OPCODE_CLOSE(x, o, a)
 

Functions

void vRuleAttributes (attrs_ctx *spAtt)
 Computes the attributes of each rule in the grammar. More...
 

Detailed Description

Determines each rule's recursive attributes – left, nested, right and cyclic – and non-recursive attributes – empty and finite.

Definition in file rule-attributes.c.

Macro Definition Documentation

◆ TRACE_OPCODE_CLOSE

#define TRACE_OPCODE_CLOSE (   x,
  o,
 
)

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

◆ TRACE_OPCODE_OPEN

#define TRACE_OPCODE_OPEN (   x,
 
)

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

◆ TRACE_PRINT_ATTRS

#define TRACE_PRINT_ATTRS (   x,
 
)

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

◆ TRACE_RULE_CLOSE

#define TRACE_RULE_CLOSE (   x,
  n,
 
)

Displays the rule name when it is opened.

Parameters
x- the attribute component context handle
n- the rule name
a- pointer to the computed attributes structure

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

◆ TRACE_RULE_OPEN

#define TRACE_RULE_OPEN (   x,
 
)

Displays the rule name when it is opened.

Parameters
x- the attribute component context handle
n- the rule name

TRACE_ATTRIBUTES Uncomment, or otherwise define this macro to turn on tracing of the attributes computations. Displays the Single-Expansion Parse Tree for each rule.

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

Function Documentation

◆ 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.

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