Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
float.h
Go to the documentation of this file.
1 //
2 // This C-language parser header was generated by APG Version 7.0.
3 // User modifications invalidate the license agreement and may cause unpredictable results.
4 //
5 /* *************************************************************************************
6  Copyright (c) 2021, Lowell D. Thomas
7  All rights reserved.
8 
9  This file was generated by and is part of APG Version 7.0.
10  APG Version 7.0 may be used under the terms of the BSD 2-Clause License.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14 
15  1. Redistributions of source code must retain the above copyright notice, this
16  list of conditions and the following disclaimer.
17 
18  2. Redistributions in binary form must reproduce the above copyright notice,
19  this list of conditions and the following disclaimer in the documentation
20  and/or other materials provided with the distribution.
21 
22  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 * *************************************************************************************/
34 
35 #ifndef _FLOAT_H_
36 #define _FLOAT_H_
37 
38 // rule ids
39 #define FLOAT_DECIMAL 2
40 #define FLOAT_DOT 4
41 #define FLOAT_ESIGN 7
42 #define FLOAT_EXP 8
43 #define FLOAT_EXPONENT 6
44 #define FLOAT_FLOAT 0
45 #define FLOAT_FRACTION 5
46 #define FLOAT_INTEGER 3
47 #define FLOAT_SIGN 1
48 #define RULE_COUNT_FLOAT 9
49 
50 // pointer to parser initialization data
51 extern void* vpFloatInit;
52 
53 // Helper function(s) for setting rule/UDT name callbacks.
54 // Un-comment and replace named NULL with pointer to the appropriate callback function.
55 // NOTE: This can easily be modified for setting AST callback functions:
56 // Replace parser_callback with ast_callback and
57 // vParserSetRuleCallback(vpParserCtx) with vAstSetRuleCallback(vpAstCtx) and
58 // vParserSetUdtCallback(vpParserCtx) with vAstSetUdtCallback(vpAstCtx).
59 /****************************************************************
60 void vFloatRuleCallbacks(void* vpParserCtx){
61  aint ui;
62  parser_callback cb[RULE_COUNT_FLOAT];
63  cb[FLOAT_DECIMAL] = NULL;
64  cb[FLOAT_DOT] = NULL;
65  cb[FLOAT_ESIGN] = NULL;
66  cb[FLOAT_EXP] = NULL;
67  cb[FLOAT_EXPONENT] = NULL;
68  cb[FLOAT_FLOAT] = NULL;
69  cb[FLOAT_FRACTION] = NULL;
70  cb[FLOAT_INTEGER] = NULL;
71  cb[FLOAT_SIGN] = NULL;
72  for(ui = 0; ui < (aint)RULE_COUNT_FLOAT; ui++){
73  vParserSetRuleCallback(vpParserCtx, ui, cb[ui]);
74  }
75 }
76 ****************************************************************/
77 
78 #endif /* _FLOAT_H_ */
vpFloatInit
void * vpFloatInit
Definition: float.c:151
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.