Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
config.h
Go to the documentation of this file.
1 /* *************************************************************************************
2  Copyright (c) 2021, Lowell D. Thomas
3  All rights reserved.
4 
5  This file is part of APG Version 7.0.
6  APG Version 7.0 may be used under the terms of the BSD 2-Clause License.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  1. Redistributions of source code must retain the above copyright notice, this
12  list of conditions and the following disclaimer.
13 
14  2. Redistributions in binary form must reproduce the above copyright notice,
15  this list of conditions and the following disclaimer in the documentation
16  and/or other materials provided with the distribution.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 
29 * *************************************************************************************/
90 #ifndef APG_CONFIG_H_
91 #define APG_CONFIG_H_
92 
99 #define CONFIG_FILE "apg-configuration"
100 
106 typedef struct {
107  char* cpCwd;
109  char* cpUseConfig;
110  char* cpOutput;
112  char* cpRulesHtml;
113  char* cpLfOut;
114  char* cpCrLfOut;
115  char** cppInput;
117  char** cppPRules;
131 } config;
132 
133 void* vpConfigCtor(exception* spEx);
134 void vConfigDtor(void* vpCtx);
135 const config* spConfigOptions(void* vpCtx, int iArgCount, char** cppArgs);
136 void vConfigDefault(void* vpCtx, char* cpFileName);
137 void vConfigHelp(void);
138 void vConfigVersion(void);
139 void vConfigDisplay(const config* spConfig, int iArgCount, char** cppArgs);
140 #endif /* APG_CONFIG_H_ */
config::cpRulesHtml
char * cpRulesHtml
if non-null, the file name for the HTML version of the rule/UDT names and dependencies
Definition: config.h:112
config::cppInput
char ** cppInput
array of uiInputFiles input file names
Definition: config.h:115
config::uiPRules
aint uiPRules
the number of protected rule names found
Definition: config.h:118
config::bDo
abool bDo
display the opcodes for each rule in human-readable form
Definition: config.h:129
config::bDv
abool bDv
verobose - sets options -dc, -dg, -dr, and -da
Definition: config.h:123
vConfigDisplay
void vConfigDisplay(const config *spConfig, int iArgCount, char **cppArgs)
Displays the full configuration as determined from the command line or command file arguments.
Definition: config.c:431
spConfigOptions
const config * spConfigOptions(void *vpCtx, int iArgCount, char **cppArgs)
Reads the command line arguments and parses them into a configuration structure.
Definition: config.c:194
vpConfigCtor
void * vpConfigCtor(exception *spEx)
Constructs a configuration object to hold all data relating to this instance of the configuration.
Definition: config.c:97
config::cpDefaultConfig
char * cpDefaultConfig
if non-n=NULL, generate a default configuration file using this file name
Definition: config.h:108
config::uiInputFiles
aint uiInputFiles
the number of input files found
Definition: config.h:116
config
This data controls the flow of the main program of the APG parser generator.
Definition: config.h:106
config::bHelp
abool bHelp
the help flag, if set the help screen is printed and processing stops
Definition: config.h:119
config::bDp
abool bDp
display the PPPT size
Definition: config.h:130
config::bNoPppt
abool bNoPppt
if set, Partially-Predictive Parsing Tables (PPPTs) will not be produced
Definition: config.h:122
config::cpCwd
char * cpCwd
the current working directory
Definition: config.h:107
config::bDc
abool bDc
display the complete configuration as found on command line or configuration file
Definition: config.h:124
vConfigHelp
void vConfigHelp(void)
Prints the help screen when requested or if there is a command line options error.
Definition: config.c:210
config::bStrict
abool bStrict
if set, the grammar is treated as strict ABNF
Definition: config.h:121
aint
uint_fast32_t aint
The APG parser's unsigned integer type.
Definition: apg.h:79
vConfigDefault
void vConfigDefault(void *vpCtx, char *cpFileName)
Prints a default configuration file.
Definition: config.c:282
config::cpLfOut
char * cpLfOut
if non-null, the file name for the converted LF line ends file
Definition: config.h:113
vConfigDtor
void vConfigDtor(void *vpCtx)
The configuration destructor.
Definition: config.c:171
config::cpGrammarHtml
char * cpGrammarHtml
if non-null, the file name for the HTML version of the annotated input grammar
Definition: config.h:111
config::bDra
abool bDra
display the grammar rule/UDT names alphabetically
Definition: config.h:128
vConfigVersion
void vConfigVersion(void)
Display the version number.
Definition: config.c:266
exception
A structure to describe the type and location of a caught exception.
Definition: exception.h:47
config::bDg
abool bDg
display an annotated version of the input grammar
Definition: config.h:125
config::cpCrLfOut
char * cpCrLfOut
if non-null, the file name for the converted CRLF line ends file
Definition: config.h:114
config::cppPRules
char ** cppPRules
array of protected rule names
Definition: config.h:117
config::cpUseConfig
char * cpUseConfig
if non-n=NULL, use this configuration file instead of command line arguments
Definition: config.h:109
config::bDr
abool bDr
display grammar rule/UDT names in the order they occur in the grammar
Definition: config.h:127
config::bVersion
abool bVersion
the version flag, if set the version number is printed and processing stops
Definition: config.h:120
abool
uint8_t abool
abool is the APG bool type.
Definition: apg.h:140
config::cpOutput
char * cpOutput
the path name for the generated C source & header files
Definition: config.h:110
config::bDa
abool bDa
display grammar attributes
Definition: config.h:126
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.