Version 7.0
Copyright © 2021 Lowell D. Thomas
APG
… an ABNF Parser Generator
float.c
Go to the documentation of this file.
1 //
2 // This C-language parser code 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 #include <stdint.h>
36 
37 static const char caStringTable[134] = {
38  102,108,111,97,116,0,115,105,103,110,0,100,101,99,105,109,97,108,0,105,110,116,101,103,101,114,0,100,111,116
39 ,0,102,114,97,99,116,105,111,110,0,101,120,112,111,110,101,110,116,0,101,115,105,103,110,0,101,120,112,0,55
40 ,46,48,0,66,83,68,32,50,45,67,108,97,117,115,101,0,67,111,112,121,114,105,103,104,116,32,40,99,41,32
41 ,50,48,50,48,32,76,111,119,101,108,108,32,68,46,32,84,104,111,109,97,115,44,32,97,108,108,32,114,105,103
42 ,104,116,115,32,114,101,115,101,114,118,101,100,0,0};
43 
44 static const uint8_t ucaPpptTable[1980] = {
45  3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
46 ,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
47 ,3,2,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
48 ,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
49 ,0,0,0,3,0,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
50 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
51 ,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
52 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
53 ,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
54 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
55 ,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
56 ,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2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,0,0,0,0,0,0,0,0,0
105 ,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
106 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
107 ,0,0,0,0,0,3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
108 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
109 ,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
110 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
111 };
112 
113 static const uint8_t aAcharTable[6] = {
114  43,45,46,101,43,45};
115 
116 static const uint16_t aParserInit[220] = {
117  220,43,101,1,1980,2,9,0,34,33,60,59,76,63,22,18,40,54,94,0,94,126,1,2,3,6,7,9,15,10,11
118 ,13,14,16,17,25,26,27,30,31,0,0,0,0,4,0,1,60,6,4,4,1,2,120,11,8,10,0,3,180,19
119 ,18,2,0,4,240,27,20,1,0,5,300,31,21,2,1,6,360,40,23,5,1,7,420,49,28,4,1,8,480,55
120 ,32,2,0,2,540,0,3,4,60,1,4,120,2,4,360,6,3,600,0,1,1,660,3,2,7,720,0,1,7,780
121 ,1,1,1,840,5,2,2,900,7,2,4,180,3,3,960,0,1,2,1020,9,2,4,240,4,4,300,5,2,1080,11
122 ,2,4,240,4,4,300,5,3,1140,1,-1,5,1200,48,57,7,1260,2,1,3,1320,0,-1,5,1380,48,57,3,1440,0
123 ,1,2,1500,13,3,7,1560,3,1,4,420,7,4,480,8,3,1620,0,1,1,1680,16,2,7,1740,4,1,7,1800,5
124 ,1,3,1860,1,-1,5,1920,48,57};
125 
126 static struct {
127  uint32_t uiSizeofAchar;
128  uint32_t uiSizeofUint;
133  const char* cpStringTable;
134  const uint8_t* ucpPpptTable;
135  const void* vpAcharTable;
136  const void* vpParserInit;
137 } s_parser_init = {
138  1,
139  2,
140  134,
141  6,
142  1980,
143  220,
144  caStringTable,
145  ucaPpptTable,
146  (const void*)aAcharTable,
147  (const void*)aParserInit
148 };
149 
150 // void pointer to the parser initialization data
151 void* vpFloatInit = (void*)&s_parser_init;
152 
153 // ALPHABET
154 // achar min = 43
155 // achar max = 101
156 // aint max = 1980
157 
158 // PPPT
159 // no. maps = 33
160 // map size = 60 (bytes)
161 // table size = 1980 (bytes)
162 
163 // GRAMMAR
164 // rules = 9
165 // UDTs = 0
166 // opcodes = 34
167 // --- ABNF original opcodes
168 // ALT = 3
169 // CAT = 5
170 // REP = 7
171 // RNM = 10
172 // TRG = 3
173 // TLS = 6
174 // TBS = 0
175 // --- SABNF opcodes
176 // UDT = 0
177 // AND = 0
178 // NOT = 0
179 // BKR = 0
180 // BKA = 0
181 // BKN = 0
182 // ABG = 0
183 // AEN = 0
184 
185 // ;original grammar
186 // float = sign decimal exponent
187 // sign = ["+" / "-"]
188 // decimal = integer [dot fraction]
189 // / dot fraction
190 // integer = 1*%d48-57
191 // dot = "."
192 // fraction = *%d48-57
193 // exponent = ["e" esign exp]
194 // esign = ["+" / "-"]
195 // exp = 1*%d48-57
196 
ucpPpptTable
const uint8_t * ucpPpptTable
Definition: float.c:134
uiAcharTableLength
uint32_t uiAcharTableLength
Definition: float.c:130
uiPpptTableLength
uint32_t uiPpptTableLength
Definition: float.c:131
cpStringTable
const char * cpStringTable
Definition: float.c:133
uiSizeofUint
uint32_t uiSizeofUint
Definition: float.c:128
vpParserInit
const void * vpParserInit
Definition: float.c:136
uiStringTableLength
uint32_t uiStringTableLength
Definition: float.c:129
vpFloatInit
void * vpFloatInit
Definition: float.c:151
vpAcharTable
const void * vpAcharTable
Definition: float.c:135
uiSizeofAchar
uint32_t uiSizeofAchar
Definition: float.c:127
uiParserInitLength
uint32_t uiParserInitLength
Definition: float.c:132
APG Version 7.0 is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.