Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
syntax.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 * *************************************************************************************/
32 
33 #ifndef SYNTAX_H_
34 #define SYNTAX_H_
35 
39 typedef aint (*pfn_findline)(line*, aint, aint, aint*);
40 
44 typedef struct {
47  void* vpAltStack;
52 } syntax_data;
53 
54 // prototypes
55 void vSabnfGrammarRuleCallbacks(void* vpParserCtx);
56 
57 #endif /* SYNTAX_H_ */
syntax_data
The syntax data that gets passed to the syntax parser's callback functions.
Definition: syntax.h:44
syntax_data::spApi
api * spApi
Pointer to the parent API object context.
Definition: syntax.h:45
syntax_data::uiRulesFound
aint uiRulesFound
True if rules have been found in the grammar.
Definition: syntax.h:50
syntax_data::vpAltStack
void * vpAltStack
A stack vector to manage open ALT operators.
Definition: syntax.h:47
alt_data
Used by syntax.c but needed here for constructor/destructor.
Definition: apip.h:40
vSabnfGrammarRuleCallbacks
void vSabnfGrammarRuleCallbacks(void *vpParserCtx)
Set the parser's rule callback functions for the syntax phase.
Definition: syntax-callbacks.c:329
syntax_data::spTopAlt
alt_data * spTopAlt
Pointer to the top of the ALT stack.
Definition: syntax.h:48
aint
uint_fast32_t aint
The APG parser's unsigned integer type.
Definition: apg.h:79
syntax_data::uiErrorsFound
aint uiErrorsFound
True if any errors in the grammar have been found.
Definition: syntax.h:51
pfn_findline
aint(* pfn_findline)(line *, aint, aint, aint *)
Pointer to a function that finds the line that a given character is in.
Definition: syntax.h:39
api
The API context.
Definition: apip.h:123
line
Defines the characteristics of a single line.
Definition: lines.h:40
abool
uint8_t abool
abool is the APG bool type.
Definition: apg.h:140
syntax_data::uiRuleError
aint uiRuleError
True if an error has been found in the rule definition/.
Definition: syntax.h:49
syntax_data::bStrict
abool bStrict
True if the grammar is to be treated as strict RFC5234 ABNF. No superset operators allowed.
Definition: syntax.h:46
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.