11
2- #line 1 ". /readstat_sav_parse_mr_name.rl"
2+ #line 1 "src/spss /readstat_sav_parse_mr_name.rl"
33#include <string.h>
44#include <stdio.h>
55#include <stdlib.h>
1010#include "readstat_sav.h"
1111
1212
13- #line 11 ". /readstat_sav_parse_mr_name.c"
13+ #line 11 "src/spss /readstat_sav_parse_mr_name.c"
1414static const char _mr_extractor_actions [] = {
1515 0 , 1 , 0 , 1 , 1 , 1 , 2 , 1 ,
1616 3 , 1 , 4
1717};
1818
1919static const char _mr_extractor_key_offsets [] = {
2020 0 , 0 , 2 , 4 , 6 , 9 , 11 , 14 ,
21- 16 , 21 , 26
21+ 19 , 24 , 29 , 31 , 36 , 41
2222};
2323
2424static const char _mr_extractor_trans_keys [] = {
2525 32 , 61 , 32 , 61 , 67 , 68 , 32 , 48 ,
26- 57 , 48 , 57 , 32 , 48 , 57 , 32 , 61 ,
27- 0 , 32 , 61 , 9 , 13 , 0 , 32 , 61 ,
28- 9 , 13 , 32 , 61 , 0
26+ 57 , 48 , 57 , 32 , 48 , 57 , 0 , 32 ,
27+ 61 , 9 , 13 , 0 , 32 , 61 , 9 , 13 ,
28+ 0 , 32 , 61 , 9 , 13 , 32 , 61 , 0 ,
29+ 32 , 61 , 9 , 13 , 0 , 32 , 61 , 9 ,
30+ 13 , 0 , 32 , 9 , 13 , 0
2931};
3032
3133static const char _mr_extractor_single_lengths [] = {
32- 0 , 2 , 2 , 0 , 1 , 0 , 1 , 2 ,
33- 3 , 3 , 2
34+ 0 , 2 , 2 , 0 , 1 , 0 , 1 , 3 ,
35+ 3 , 3 , 2 , 3 , 3 , 2
3436};
3537
3638static const char _mr_extractor_range_lengths [] = {
37- 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 ,
38- 1 , 1 , 0
39+ 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 ,
40+ 1 , 1 , 0 , 1 , 1 , 1
3941};
4042
4143static const char _mr_extractor_index_offsets [] = {
4244 0 , 0 , 3 , 6 , 8 , 11 , 13 , 16 ,
43- 19 , 24 , 29
45+ 21 , 26 , 31 , 34 , 39 , 44
4446};
4547
4648static const char _mr_extractor_indicies [] = {
4749 1 , 1 , 0 , 1 , 2 , 0 , 3 , 1 ,
4850 4 , 5 , 1 , 6 , 1 , 7 , 6 , 1 ,
49- 9 , 1 , 8 , 10 , 11 , 1 , 10 , 8 ,
50- 10 , 11 , 1 , 10 , 8 , 1 , 1 , 8 ,
51+ 9 , 10 , 1 , 9 , 8 , 11 , 12 , 1 ,
52+ 11 , 8 , 9 , 10 , 1 , 9 , 8 , 1 ,
53+ 1 , 8 , 13 , 14 , 1 , 13 , 8 , 11 ,
54+ 15 , 1 , 11 , 8 , 15 , 15 , 15 , 1 ,
5155 0
5256};
5357
5458static const char _mr_extractor_trans_targs [] = {
55- 2 , 0 , 3 , 4 , 5 , 4 , 6 , 7 ,
56- 8 , 7 , 9 , 10
59+ 2 , 0 , 3 , 4 , 5 , 4 , 6 , 8 ,
60+ 7 , 9 , 10 , 11 , 8 , 11 , 12 , 13
5761};
5862
5963static const char _mr_extractor_trans_actions [] = {
6064 0 , 0 , 1 , 3 , 5 , 0 , 0 , 7 ,
61- 0 , 0 , 9 , 9
65+ 0 , 9 , 9 , 0 , 0 , 9 , 9 , 0
6266};
6367
6468static const int mr_extractor_start = 1 ;
6569
6670static const int mr_extractor_en_main = 1 ;
6771
6872
69- #line 121 ". /readstat_sav_parse_mr_name.rl"
73+ #line 121 "src/spss /readstat_sav_parse_mr_name.rl"
7074
7175
7276readstat_error_t extract_mr_data (const char * line , mr_set_t * result , sav_ctx_t * ctx ) {
@@ -88,14 +92,14 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
8892
8993 // Execute Ragel finite state machine (FSM)
9094
91- #line 85 ". /readstat_sav_parse_mr_name.c"
95+ #line 89 "src/spss /readstat_sav_parse_mr_name.c"
9296 {
9397 cs = mr_extractor_start ;
9498 }
9599
96- #line 142 ". /readstat_sav_parse_mr_name.rl"
100+ #line 142 "src/spss /readstat_sav_parse_mr_name.rl"
97101
98- #line 88 ". /readstat_sav_parse_mr_name.c"
102+ #line 92 "src/spss /readstat_sav_parse_mr_name.c"
99103 {
100104 int _klen ;
101105 unsigned int _trans ;
@@ -170,7 +174,7 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
170174 switch ( * _acts ++ )
171175 {
172176 case 0 :
173- #line 13 ". /readstat_sav_parse_mr_name.rl"
177+ #line 13 "src/spss /readstat_sav_parse_mr_name.rl"
174178 {
175179 size_t src_len = p - start ;
176180 size_t dst_len = 4 * src_len + 1 ; // UTF-8 expansion: up to 4 bytes per char
@@ -186,14 +190,14 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
186190 }
187191 break ;
188192 case 1 :
189- #line 27 ". /readstat_sav_parse_mr_name.rl"
193+ #line 27 "src/spss /readstat_sav_parse_mr_name.rl"
190194 {
191195 mr_type = * p ;
192196 start = p + 1 ;
193197 }
194198 break ;
195199 case 2 :
196- #line 32 ". /readstat_sav_parse_mr_name.rl"
200+ #line 32 "src/spss /readstat_sav_parse_mr_name.rl"
197201 {
198202 int n_cv_digs = p - start ;
199203 char * n_dig_str = (char * )readstat_malloc (n_cv_digs + 1 );
@@ -224,7 +228,7 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
224228 }
225229 break ;
226230 case 3 :
227- #line 61 ". /readstat_sav_parse_mr_name.rl"
231+ #line 61 "src/spss /readstat_sav_parse_mr_name.rl"
228232 {
229233 char * lbl_len_str = (char * )readstat_malloc (p - start + 1 );
230234 if (lbl_len_str == NULL ) {
@@ -250,7 +254,7 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
250254 }
251255 break ;
252256 case 4 :
253- #line 85 ". /readstat_sav_parse_mr_name.rl"
257+ #line 85 "src/spss /readstat_sav_parse_mr_name.rl"
254258 {
255259 size_t src_len = p - start ;
256260 size_t dst_len = 4 * src_len + 1 ; // UTF-8 expansion: up to 4 bytes per char
@@ -275,7 +279,7 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
275279 mr_subvariables [mr_subvar_count ++ ] = subvar ;
276280 }
277281 break ;
278- #line 262 ". /readstat_sav_parse_mr_name.c"
282+ #line 266 "src/spss /readstat_sav_parse_mr_name.c"
279283 }
280284 }
281285
@@ -288,10 +292,10 @@ readstat_error_t extract_mr_data(const char *line, mr_set_t *result, sav_ctx_t *
288292 _out : {}
289293 }
290294
291- #line 143 ". /readstat_sav_parse_mr_name.rl"
295+ #line 143 "src/spss /readstat_sav_parse_mr_name.rl"
292296
293297 // Check if FSM finished successfully
294- if (cs < 9 || p != pe ) {
298+ if (cs < 8 || p != pe ) {
295299 retval = READSTAT_ERROR_BAD_MR_STRING ;
296300 goto cleanup ;
297301 }
@@ -330,7 +334,7 @@ readstat_error_t parse_mr_line(const char *line, mr_set_t *result, sav_ctx_t *ct
330334}
331335
332336
333- #line 313 ". /readstat_sav_parse_mr_name.c"
337+ #line 317 "src/spss /readstat_sav_parse_mr_name.c"
334338static const char _mr_parser_actions [] = {
335339 0 , 1 , 0
336340};
@@ -373,7 +377,7 @@ static const int mr_parser_start = 1;
373377static const int mr_parser_en_main = 1 ;
374378
375379
376- #line 216 ". /readstat_sav_parse_mr_name.rl"
380+ #line 216 "src/spss /readstat_sav_parse_mr_name.rl"
377381
378382
379383readstat_error_t parse_mr_string (const char * line , mr_set_t * * mr_sets , size_t * n_mr_lines , sav_ctx_t * ctx ) {
@@ -386,14 +390,14 @@ readstat_error_t parse_mr_string(const char *line, mr_set_t **mr_sets, size_t *n
386390 * n_mr_lines = 0 ;
387391
388392
389- #line 365 ". /readstat_sav_parse_mr_name.c"
393+ #line 369 "src/spss /readstat_sav_parse_mr_name.c"
390394 {
391395 cs = mr_parser_start ;
392396 }
393397
394- #line 228 ". /readstat_sav_parse_mr_name.rl"
398+ #line 228 "src/spss /readstat_sav_parse_mr_name.rl"
395399
396- #line 368 ". /readstat_sav_parse_mr_name.c"
400+ #line 372 "src/spss /readstat_sav_parse_mr_name.c"
397401 {
398402 int _klen ;
399403 unsigned int _trans ;
@@ -468,7 +472,7 @@ readstat_error_t parse_mr_string(const char *line, mr_set_t **mr_sets, size_t *n
468472 switch ( * _acts ++ )
469473 {
470474 case 0 :
471- #line 186 ". /readstat_sav_parse_mr_name.rl"
475+ #line 186 "src/spss /readstat_sav_parse_mr_name.rl"
472476 {
473477 char * mln = (char * )readstat_malloc (p - start );
474478 if (mln == NULL ) {
@@ -493,7 +497,7 @@ readstat_error_t parse_mr_string(const char *line, mr_set_t **mr_sets, size_t *n
493497 start = p + 1 ;
494498 }
495499 break ;
496- #line 466 ". /readstat_sav_parse_mr_name.c"
500+ #line 470 "src/spss /readstat_sav_parse_mr_name.c"
497501 }
498502 }
499503
@@ -506,7 +510,7 @@ readstat_error_t parse_mr_string(const char *line, mr_set_t **mr_sets, size_t *n
506510 _out : {}
507511 }
508512
509- #line 229 ". /readstat_sav_parse_mr_name.rl"
513+ #line 229 "src/spss /readstat_sav_parse_mr_name.rl"
510514
511515 if (cs < 4 || p != pe ) {
512516 retval = READSTAT_ERROR_BAD_MR_STRING ;
0 commit comments