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

Header file for the semantic translation functions. More...

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

Go to the source code of this file.

Data Structures

struct  semantic_udt
 Generalized UDT for first-pass semantic processing. More...
 
struct  semantic_op
 Generalized opcode for first-pass semantic processing. More...
 
struct  semantic_rule
 Generalized rule for first-pass semantic processing. More...
 
struct  semantic_data
 User data passed to the AST translator for use by the AST callback functions. More...
 

Macros

#define RULENAME_MAX   256
 

Functions

void vSabnfGrammarAstCallbacks (void *vpParserCtx)
 Set the callback functions for the AST translation of the semantic phase parse to opcodes. More...
 
aint uiFindRule (semantic_rule *spRules, aint uiRuleCount, const char *cpName, aint uiNameLength)
 Find the index of the named rule in the rule list. More...
 
aint uiFindUdt (semantic_udt *spUdts, aint uiUdtCount, const char *cpName, aint uiNameLength)
 

Detailed Description

Header file for the semantic translation functions.

Definition in file semantics.h.

Macro Definition Documentation

◆ RULENAME_MAX

#define RULENAME_MAX   256

< Rule and UDT names have a maximum size of 255 characters (plus a null term.)

Definition at line 37 of file semantics.h.

Function Documentation

◆ uiFindRule()

aint uiFindRule ( semantic_rule spRules,
aint  uiRuleCount,
const char *  cpName,
aint  uiNameLength 
)

Find the index of the named rule in the rule list.

Does a simple linear search.

Parameters
[in]spRules- the array of rules
[in]uiRuleCount- the number of rules
[in]cpName- pointer to the name to look for (not a null-terminated string)
[in]uiNameLength- the number of characters in the name
Returns
the index of the rule in the rule list if the name is found, APG_UNDEFINED otherwise

Definition at line 160 of file semantics.c.

◆ uiFindUdt()

aint uiFindUdt ( semantic_udt spUdts,
aint  uiUdtCount,
const char *  cpName,
aint  uiNameLength 
)

Definition at line 172 of file semantics.c.

◆ vSabnfGrammarAstCallbacks()

void vSabnfGrammarAstCallbacks ( void *  vpAstCtx)

Set the callback functions for the AST translation of the semantic phase parse to opcodes.

Parameters
vpAstCtxPointer to an AST context.

Definition at line 740 of file semantic-callbacks.c.

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