/
mdlparse.c
7333 lines (6526 loc) · 308 KB
/
mdlparse.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* A Bison parser, made by GNU Bison 3.0.2. */
/* Bison implementation for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
variables, as they might otherwise be expanded by user macros.
There are some unavoidable exceptions within include files to
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "3.0.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
/* Pure parsers. */
#define YYPURE 1
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Substitute the variable and function names. */
#define yyparse mdlparse
#define yylex mdllex
#define yyerror mdlerror
#define yydebug mdldebug
#define yynerrs mdlnerrs
/* Copy the first part of user declarations. */
#line 1 "../src/../src/mdlparse.y" /* yacc.c:339 */
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <errno.h>
#include "rng.h"
#include "logging.h"
#include "vector.h"
#include "strfunc.h"
#include "mem_util.h"
#include "sym_table.h"
#include "diffuse_util.h"
#include "mdlparse_util.h"
#include "mdlparse_aux.h"
#include "util.h"
#include "react_output.h"
#include "macromolecule.h"
#include "mcell_misc.h"
#include "mcell_structs.h"
#include "mcell_viz.h"
#include "mcell_release.h"
#include "mcell_objects.h"
/* make sure to declare yyscan_t before including mdlparse.h */
typedef void *yyscan_t;
#include "mdlparse.h"
int mdllex_init(yyscan_t *ptr_yy_globals) ;
int mdllex_destroy(yyscan_t yyscanner);
void mdlrestart(FILE *infile, yyscan_t scanner);
int mdllex(YYSTYPE *yylval, struct mdlparse_vars *parse_state, yyscan_t scanner);
static int mdlparse_file(struct mdlparse_vars *parse_state, char const *name);
#ifdef DEBUG_MDL_PARSER
#define FAILCHECK(t) do { mcell_error_nodie("Parser fail: %s:%d (%s)\n", __FILE__, __LINE__, t); return 1; } while(0)
#else
#define FAILCHECK(t) return 1
#endif
#define CHECK(a) do { if ((a) != 0) FAILCHECK("non-zero"); } while (0)
#define CHECKN(a) do { if ((a) == NULL) FAILCHECK("NULL"); } while (0)
#define CHECKF(a) do { \
if (isnan(a)) \
{ \
mdlerror(parse_state, "Expression result is not a number"); \
FAILCHECK("NaN"); \
} \
else if (isinf(a)) \
{ \
mdlerror(parse_state, "Expression result is infinite"); \
FAILCHECK("Infinite"); \
} \
} while(0)
#undef yyerror
#define yyerror(a, b, c) mdlerror(a, c)
#line 139 "mdlparse.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
# define YY_NULLPTR nullptr
# else
# define YY_NULLPTR 0
# endif
# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
/* In a future release of Bison, this section will be replaced
by #include "y.tab.h". */
#ifndef YY_MDL_MDLPARSE_H_INCLUDED
# define YY_MDL_MDLPARSE_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int mdldebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
ABS = 258,
ABSORPTIVE = 259,
ACCURATE_3D_REACTIONS = 260,
ACOS = 261,
ALL_CROSSINGS = 262,
ALL_DATA = 263,
ALL_ELEMENTS = 264,
ALL_ENCLOSED = 265,
ALL_HITS = 266,
ALL_ITERATIONS = 267,
ALL_MESHES = 268,
ALL_MOLECULES = 269,
ALL_NOTIFICATIONS = 270,
ALL_TIMES = 271,
ALL_WARNINGS = 272,
ASCII = 273,
ASIN = 274,
ASPECT_RATIO = 275,
ATAN = 276,
BACK = 277,
BACK_CROSSINGS = 278,
BACK_HITS = 279,
BINARY = 280,
BOTTOM = 281,
BOX = 282,
BOX_TRIANGULATION_REPORT = 283,
BRIEF = 284,
CEIL = 285,
CELLBLENDER = 286,
CENTER_MOLECULES_ON_GRID = 287,
CHECKPOINT_INFILE = 288,
CHECKPOINT_ITERATIONS = 289,
CHECKPOINT_OUTFILE = 290,
CHECKPOINT_REALTIME = 291,
CHECKPOINT_REPORT = 292,
CLAMP_CONCENTRATION = 293,
CLOSE_PARTITION_SPACING = 294,
COMPLEX_PLACEMENT_ATTEMPTS = 295,
COMPLEX_PLACEMENT_FAILURE = 296,
COMPLEX_PLACEMENT_FAILURE_THRESHOLD = 297,
COMPLEX_RATE = 298,
CONCENTRATION = 299,
CORNERS = 300,
COS = 301,
COUNT = 302,
CUBIC = 303,
CUBIC_RELEASE_SITE = 304,
CUSTOM_SPACE_STEP = 305,
CUSTOM_TIME_STEP = 306,
DEFAULT = 307,
DEFINE_COMPLEX_MOLECULE = 308,
DEFINE_MOLECULE = 309,
DEFINE_MOLECULES = 310,
DEFINE_REACTIONS = 311,
DEFINE_RELEASE_PATTERN = 312,
DEFINE_SURFACE_CLASS = 313,
DEFINE_SURFACE_CLASSES = 314,
DEFINE_SURFACE_REGIONS = 315,
DEGENERATE_POLYGONS = 316,
DELAY = 317,
DENSITY = 318,
DIFFUSION_CONSTANT_2D = 319,
DIFFUSION_CONSTANT_3D = 320,
DIFFUSION_CONSTANT_REPORT = 321,
DREAMM_V3 = 322,
DREAMM_V3_GROUPED = 323,
EFFECTOR_GRID_DENSITY = 324,
ELEMENT_CONNECTIONS = 325,
ELLIPTIC = 326,
ELLIPTIC_RELEASE_SITE = 327,
EQUAL = 328,
ERROR = 329,
ESTIMATE_CONCENTRATION = 330,
EXCLUDE_ELEMENTS = 331,
EXCLUDE_PATCH = 332,
EXCLUDE_REGION = 333,
EXIT = 334,
EXP = 335,
EXPRESSION = 336,
FALSE = 337,
FCLOSE = 338,
FILENAME = 339,
FILENAME_PREFIX = 340,
FILE_OUTPUT_REPORT = 341,
FINAL_SUMMARY = 342,
FLOOR = 343,
FOPEN = 344,
FORMAT = 345,
FPRINTF = 346,
FPRINT_TIME = 347,
FRONT = 348,
FRONT_CROSSINGS = 349,
FRONT_HITS = 350,
GAUSSIAN_RELEASE_NUMBER = 351,
GEOMETRY = 352,
HEADER = 353,
HIGH_PROBABILITY_THRESHOLD = 354,
HIGH_REACTION_PROBABILITY = 355,
IGNORED = 356,
INCLUDE_ELEMENTS = 357,
INCLUDE_FILE = 358,
INCLUDE_PATCH = 359,
INCLUDE_REGION = 360,
INPUT_FILE = 361,
INSTANTIATE = 362,
LLINTEGER = 363,
FULLY_RANDOM = 364,
INTERACTION_RADIUS = 365,
ITERATION_LIST = 366,
ITERATION_NUMBERS = 367,
ITERATION_REPORT = 368,
ITERATIONS = 369,
KEEP_CHECKPOINT_FILES = 370,
LEFT = 371,
LIFETIME_THRESHOLD = 372,
LIFETIME_TOO_SHORT = 373,
LIST = 374,
LOCATION = 375,
LOG = 376,
LOG10 = 377,
MAX_TOK = 378,
MAXIMUM_STEP_LENGTH = 379,
MEAN_DIAMETER = 380,
MEAN_NUMBER = 381,
MEMORY_PARTITION_X = 382,
MEMORY_PARTITION_Y = 383,
MEMORY_PARTITION_Z = 384,
MEMORY_PARTITION_POOL = 385,
MESHES = 386,
MICROSCOPIC_REVERSIBILITY = 387,
MIN_TOK = 388,
MISSED_REACTIONS = 389,
MISSED_REACTION_THRESHOLD = 390,
MISSING_SURFACE_ORIENTATION = 391,
MOD = 392,
MODE = 393,
MODIFY_SURFACE_REGIONS = 394,
MOLECULE = 395,
MOLECULE_COLLISION_REPORT = 396,
MOLECULE_DENSITY = 397,
MOLECULE_NUMBER = 398,
MOLECULE_POSITIONS = 399,
MOLECULES = 400,
MOLECULE_PLACEMENT_FAILURE = 401,
NAME_LIST = 402,
NEGATIVE_DIFFUSION_CONSTANT = 403,
NEGATIVE_REACTION_RATE = 404,
NO = 405,
NOEXIT = 406,
NONE = 407,
NO_SPECIES = 408,
NOT_EQUAL = 409,
NOTIFICATIONS = 410,
NUMBER_OF_SUBUNITS = 411,
NUMBER_OF_TRAINS = 412,
NUMBER_TO_RELEASE = 413,
OBJECT = 414,
OFF = 415,
ON = 416,
ORIENTATIONS = 417,
OUTPUT_BUFFER_SIZE = 418,
INVALID_OUTPUT_STEP_TIME = 419,
OVERWRITTEN_OUTPUT_FILE = 420,
PARTITION_LOCATION_REPORT = 421,
PARTITION_X = 422,
PARTITION_Y = 423,
PARTITION_Z = 424,
PI_TOK = 425,
POLYGON_LIST = 426,
POSITIONS = 427,
PRINTF = 428,
PRINT_TIME = 429,
PROBABILITY_REPORT = 430,
PROBABILITY_REPORT_THRESHOLD = 431,
PROGRESS_REPORT = 432,
RADIAL_DIRECTIONS = 433,
RADIAL_SUBDIVISIONS = 434,
RAND_GAUSSIAN = 435,
RAND_UNIFORM = 436,
RATE_RULES = 437,
REACTION_DATA_OUTPUT = 438,
REACTION_OUTPUT_REPORT = 439,
REACTION_GROUP = 440,
REAL = 441,
RECTANGULAR_RELEASE_SITE = 442,
RECTANGULAR_TOKEN = 443,
REFLECTIVE = 444,
REGION_DATA = 445,
RELEASE_EVENT_REPORT = 446,
RELEASE_INTERVAL = 447,
RELEASE_PATTERN = 448,
RELEASE_PROBABILITY = 449,
RELEASE_SITE = 450,
REMOVE_ELEMENTS = 451,
RIGHT = 452,
ROTATE = 453,
ROUND_OFF = 454,
SCALE = 455,
SEED = 456,
SHAPE = 457,
SHOW_EXACT_TIME = 458,
SIN = 459,
SITE_DIAMETER = 460,
SITE_RADIUS = 461,
SPACE_STEP = 462,
SPHERICAL = 463,
SPHERICAL_RELEASE_SITE = 464,
SPHERICAL_SHELL = 465,
SPHERICAL_SHELL_SITE = 466,
SPRINTF = 467,
SQRT = 468,
STANDARD_DEVIATION = 469,
STEP = 470,
STRING_TO_NUM = 471,
STR_VALUE = 472,
SUBUNIT = 473,
SUBUNIT_RELATIONSHIPS = 474,
SUMMATION_OPERATOR = 475,
SURFACE_CLASS = 476,
SURFACE_ONLY = 477,
TAN = 478,
TARGET_ONLY = 479,
TET_ELEMENT_CONNECTIONS = 480,
THROUGHPUT_REPORT = 481,
TIME_LIST = 482,
TIME_POINTS = 483,
TIME_STEP = 484,
TIME_STEP_MAX = 485,
TO = 486,
TOP = 487,
TRAIN_DURATION = 488,
TRAIN_INTERVAL = 489,
TRANSLATE = 490,
TRANSPARENT = 491,
TRIGGER = 492,
TRUE = 493,
UNLIMITED = 494,
USELESS_VOLUME_ORIENTATION = 495,
VACANCY_SEARCH_DISTANCE = 496,
VAR = 497,
VARYING_PROBABILITY_REPORT = 498,
VERTEX_LIST = 499,
VIZ_MESH_FORMAT = 500,
VIZ_MOLECULE_FORMAT = 501,
VIZ_OUTPUT = 502,
VIZ_OUTPUT_REPORT = 503,
VIZ_VALUE = 504,
VOLUME_DATA_OUTPUT = 505,
VOLUME_OUTPUT_REPORT = 506,
VOLUME_DEPENDENT_RELEASE_NUMBER = 507,
VOLUME_ONLY = 508,
VOXEL_COUNT = 509,
VOXEL_LIST = 510,
VOXEL_SIZE = 511,
WARNING = 512,
WARNINGS = 513,
WORLD = 514,
YES = 515,
UNARYMINUS = 516
};
#endif
/* Tokens. */
#define ABS 258
#define ABSORPTIVE 259
#define ACCURATE_3D_REACTIONS 260
#define ACOS 261
#define ALL_CROSSINGS 262
#define ALL_DATA 263
#define ALL_ELEMENTS 264
#define ALL_ENCLOSED 265
#define ALL_HITS 266
#define ALL_ITERATIONS 267
#define ALL_MESHES 268
#define ALL_MOLECULES 269
#define ALL_NOTIFICATIONS 270
#define ALL_TIMES 271
#define ALL_WARNINGS 272
#define ASCII 273
#define ASIN 274
#define ASPECT_RATIO 275
#define ATAN 276
#define BACK 277
#define BACK_CROSSINGS 278
#define BACK_HITS 279
#define BINARY 280
#define BOTTOM 281
#define BOX 282
#define BOX_TRIANGULATION_REPORT 283
#define BRIEF 284
#define CEIL 285
#define CELLBLENDER 286
#define CENTER_MOLECULES_ON_GRID 287
#define CHECKPOINT_INFILE 288
#define CHECKPOINT_ITERATIONS 289
#define CHECKPOINT_OUTFILE 290
#define CHECKPOINT_REALTIME 291
#define CHECKPOINT_REPORT 292
#define CLAMP_CONCENTRATION 293
#define CLOSE_PARTITION_SPACING 294
#define COMPLEX_PLACEMENT_ATTEMPTS 295
#define COMPLEX_PLACEMENT_FAILURE 296
#define COMPLEX_PLACEMENT_FAILURE_THRESHOLD 297
#define COMPLEX_RATE 298
#define CONCENTRATION 299
#define CORNERS 300
#define COS 301
#define COUNT 302
#define CUBIC 303
#define CUBIC_RELEASE_SITE 304
#define CUSTOM_SPACE_STEP 305
#define CUSTOM_TIME_STEP 306
#define DEFAULT 307
#define DEFINE_COMPLEX_MOLECULE 308
#define DEFINE_MOLECULE 309
#define DEFINE_MOLECULES 310
#define DEFINE_REACTIONS 311
#define DEFINE_RELEASE_PATTERN 312
#define DEFINE_SURFACE_CLASS 313
#define DEFINE_SURFACE_CLASSES 314
#define DEFINE_SURFACE_REGIONS 315
#define DEGENERATE_POLYGONS 316
#define DELAY 317
#define DENSITY 318
#define DIFFUSION_CONSTANT_2D 319
#define DIFFUSION_CONSTANT_3D 320
#define DIFFUSION_CONSTANT_REPORT 321
#define DREAMM_V3 322
#define DREAMM_V3_GROUPED 323
#define EFFECTOR_GRID_DENSITY 324
#define ELEMENT_CONNECTIONS 325
#define ELLIPTIC 326
#define ELLIPTIC_RELEASE_SITE 327
#define EQUAL 328
#define ERROR 329
#define ESTIMATE_CONCENTRATION 330
#define EXCLUDE_ELEMENTS 331
#define EXCLUDE_PATCH 332
#define EXCLUDE_REGION 333
#define EXIT 334
#define EXP 335
#define EXPRESSION 336
#define FALSE 337
#define FCLOSE 338
#define FILENAME 339
#define FILENAME_PREFIX 340
#define FILE_OUTPUT_REPORT 341
#define FINAL_SUMMARY 342
#define FLOOR 343
#define FOPEN 344
#define FORMAT 345
#define FPRINTF 346
#define FPRINT_TIME 347
#define FRONT 348
#define FRONT_CROSSINGS 349
#define FRONT_HITS 350
#define GAUSSIAN_RELEASE_NUMBER 351
#define GEOMETRY 352
#define HEADER 353
#define HIGH_PROBABILITY_THRESHOLD 354
#define HIGH_REACTION_PROBABILITY 355
#define IGNORED 356
#define INCLUDE_ELEMENTS 357
#define INCLUDE_FILE 358
#define INCLUDE_PATCH 359
#define INCLUDE_REGION 360
#define INPUT_FILE 361
#define INSTANTIATE 362
#define LLINTEGER 363
#define FULLY_RANDOM 364
#define INTERACTION_RADIUS 365
#define ITERATION_LIST 366
#define ITERATION_NUMBERS 367
#define ITERATION_REPORT 368
#define ITERATIONS 369
#define KEEP_CHECKPOINT_FILES 370
#define LEFT 371
#define LIFETIME_THRESHOLD 372
#define LIFETIME_TOO_SHORT 373
#define LIST 374
#define LOCATION 375
#define LOG 376
#define LOG10 377
#define MAX_TOK 378
#define MAXIMUM_STEP_LENGTH 379
#define MEAN_DIAMETER 380
#define MEAN_NUMBER 381
#define MEMORY_PARTITION_X 382
#define MEMORY_PARTITION_Y 383
#define MEMORY_PARTITION_Z 384
#define MEMORY_PARTITION_POOL 385
#define MESHES 386
#define MICROSCOPIC_REVERSIBILITY 387
#define MIN_TOK 388
#define MISSED_REACTIONS 389
#define MISSED_REACTION_THRESHOLD 390
#define MISSING_SURFACE_ORIENTATION 391
#define MOD 392
#define MODE 393
#define MODIFY_SURFACE_REGIONS 394
#define MOLECULE 395
#define MOLECULE_COLLISION_REPORT 396
#define MOLECULE_DENSITY 397
#define MOLECULE_NUMBER 398
#define MOLECULE_POSITIONS 399
#define MOLECULES 400
#define MOLECULE_PLACEMENT_FAILURE 401
#define NAME_LIST 402
#define NEGATIVE_DIFFUSION_CONSTANT 403
#define NEGATIVE_REACTION_RATE 404
#define NO 405
#define NOEXIT 406
#define NONE 407
#define NO_SPECIES 408
#define NOT_EQUAL 409
#define NOTIFICATIONS 410
#define NUMBER_OF_SUBUNITS 411
#define NUMBER_OF_TRAINS 412
#define NUMBER_TO_RELEASE 413
#define OBJECT 414
#define OFF 415
#define ON 416
#define ORIENTATIONS 417
#define OUTPUT_BUFFER_SIZE 418
#define INVALID_OUTPUT_STEP_TIME 419
#define OVERWRITTEN_OUTPUT_FILE 420
#define PARTITION_LOCATION_REPORT 421
#define PARTITION_X 422
#define PARTITION_Y 423
#define PARTITION_Z 424
#define PI_TOK 425
#define POLYGON_LIST 426
#define POSITIONS 427
#define PRINTF 428
#define PRINT_TIME 429
#define PROBABILITY_REPORT 430
#define PROBABILITY_REPORT_THRESHOLD 431
#define PROGRESS_REPORT 432
#define RADIAL_DIRECTIONS 433
#define RADIAL_SUBDIVISIONS 434
#define RAND_GAUSSIAN 435
#define RAND_UNIFORM 436
#define RATE_RULES 437
#define REACTION_DATA_OUTPUT 438
#define REACTION_OUTPUT_REPORT 439
#define REACTION_GROUP 440
#define REAL 441
#define RECTANGULAR_RELEASE_SITE 442
#define RECTANGULAR_TOKEN 443
#define REFLECTIVE 444
#define REGION_DATA 445
#define RELEASE_EVENT_REPORT 446
#define RELEASE_INTERVAL 447
#define RELEASE_PATTERN 448
#define RELEASE_PROBABILITY 449
#define RELEASE_SITE 450
#define REMOVE_ELEMENTS 451
#define RIGHT 452
#define ROTATE 453
#define ROUND_OFF 454
#define SCALE 455
#define SEED 456
#define SHAPE 457
#define SHOW_EXACT_TIME 458
#define SIN 459
#define SITE_DIAMETER 460
#define SITE_RADIUS 461
#define SPACE_STEP 462
#define SPHERICAL 463
#define SPHERICAL_RELEASE_SITE 464
#define SPHERICAL_SHELL 465
#define SPHERICAL_SHELL_SITE 466
#define SPRINTF 467
#define SQRT 468
#define STANDARD_DEVIATION 469
#define STEP 470
#define STRING_TO_NUM 471
#define STR_VALUE 472
#define SUBUNIT 473
#define SUBUNIT_RELATIONSHIPS 474
#define SUMMATION_OPERATOR 475
#define SURFACE_CLASS 476
#define SURFACE_ONLY 477
#define TAN 478
#define TARGET_ONLY 479
#define TET_ELEMENT_CONNECTIONS 480
#define THROUGHPUT_REPORT 481
#define TIME_LIST 482
#define TIME_POINTS 483
#define TIME_STEP 484
#define TIME_STEP_MAX 485
#define TO 486
#define TOP 487
#define TRAIN_DURATION 488
#define TRAIN_INTERVAL 489
#define TRANSLATE 490
#define TRANSPARENT 491
#define TRIGGER 492
#define TRUE 493
#define UNLIMITED 494
#define USELESS_VOLUME_ORIENTATION 495
#define VACANCY_SEARCH_DISTANCE 496
#define VAR 497
#define VARYING_PROBABILITY_REPORT 498
#define VERTEX_LIST 499
#define VIZ_MESH_FORMAT 500
#define VIZ_MOLECULE_FORMAT 501
#define VIZ_OUTPUT 502
#define VIZ_OUTPUT_REPORT 503
#define VIZ_VALUE 504
#define VOLUME_DATA_OUTPUT 505
#define VOLUME_OUTPUT_REPORT 506
#define VOLUME_DEPENDENT_RELEASE_NUMBER 507
#define VOLUME_ONLY 508
#define VOXEL_COUNT 509
#define VOXEL_LIST 510
#define VOXEL_SIZE 511
#define WARNING 512
#define WARNINGS 513
#define WORLD 514
#define YES 515
#define UNARYMINUS 516
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
#line 69 "../src/../src/mdlparse.y" /* yacc.c:355 */
int ival;
int tok;
double dbl;
long long llival;
char *str;
struct sym_entry *sym;
struct vector3 *vec3;
struct num_expr_list_head nlist;
struct release_evaluator *rev;
struct sym_table_list *symlist;
struct output_times *otimes;
/* Reaction output */
struct output_times_inlist ro_otimes;
struct output_column_list ro_cols;
struct output_set *ro_set;
struct output_set_list ro_sets;
struct output_expression *cnt;
/* Viz output */
struct frame_data_list_head frame_list;
/* Region definitions */
struct element_list *elem_list_item;
struct element_list_head elem_list;
struct region *reg;
/* Diffusion constants */
struct diffusion_constant diff_const;
/* Geometry */
struct vertex_list_head vertlist;
struct vertex_list *vertlistitem;
struct element_connection_list_head ecl;
struct element_connection_list *elem_conn;
struct object *obj;
struct object_list obj_list;
struct voxel_object *voxel;
/* Molecule species */
struct mcell_species mol_type;
struct mcell_species_list mol_type_list;
struct mcell_species_spec *mcell_mol_spec;
struct parse_mcell_species_list mcell_species_lst;
struct sm_dat *surf_mol_dat;
struct sm_dat_list surf_mol_dat_list;
struct species_list species_lst;
struct species_list_item *species_lst_item;
/* Reactions */
struct reaction_arrow react_arrow;
struct reaction_rate react_rate;
struct reaction_rates react_rates;
/* Release sites/patterns */
struct release_pattern rpat;
struct release_single_molecule *rsm;
struct release_single_molecule_list rsm_list;
/* printf arguments */
struct arg *printfarg;
struct arg_list printfargs;
/* Macromolecules */
struct macro_subunit_assignment_list mmol_subunits;
struct macro_topology *mmol_topo;
struct macro_subunit_spec *mmol_su_comp;
struct macro_subunit_assignment *mmol_su_assign;
struct macro_geometry *mmol_geom;
struct macro_relationship *mmol_su_rel;
struct macro_rate_ruleset *mmol_rate_ruleset;
struct macro_rate_rule *mmol_rate_rule;
struct macro_rate_clause *mmol_rate_clause;
/* Macromolecules (after the species is built) */
struct macro_relation_state *relation_state;
#line 780 "mdlparse.c" /* yacc.c:355 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
int mdlparse (struct mdlparse_vars *parse_state, yyscan_t scanner);
#endif /* !YY_MDL_MDLPARSE_H_INCLUDED */
/* Copy the second part of user declarations. */
#line 794 "mdlparse.c" /* yacc.c:358 */
#ifdef short
# undef short
#endif
#ifdef YYTYPE_UINT8
typedef YYTYPE_UINT8 yytype_uint8;
#else
typedef unsigned char yytype_uint8;
#endif
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
#else
typedef signed char yytype_int8;
#endif
#ifdef YYTYPE_UINT16
typedef YYTYPE_UINT16 yytype_uint16;
#else
typedef unsigned short int yytype_uint16;
#endif
#ifdef YYTYPE_INT16
typedef YYTYPE_INT16 yytype_int16;
#else
typedef short int yytype_int16;
#endif
#ifndef YYSIZE_T
# ifdef __SIZE_TYPE__
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
# elif ! defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
# define YYSIZE_T unsigned int
# endif
#endif
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
# define YY_(Msgid) Msgid
# endif
#endif
#ifndef YY_ATTRIBUTE
# if (defined __GNUC__ \
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
# else
# define YY_ATTRIBUTE(Spec) /* empty */
# endif
#endif
#ifndef YY_ATTRIBUTE_PURE
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
#endif
#ifndef YY_ATTRIBUTE_UNUSED
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
#endif
#if !defined _Noreturn \
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
# if defined _MSC_VER && 1200 <= _MSC_VER
# define _Noreturn __declspec (noreturn)
# else
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
# define YYUSE(E) ((void) (E))
#else
# define YYUSE(E) /* empty */
#endif
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
#endif
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
#endif
#ifndef YY_INITIAL_VALUE
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# ifdef YYSTACK_USE_ALLOCA
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# elif defined __BUILTIN_VA_ARG_INCR
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
# elif defined _AIX
# define YYSTACK_ALLOC __alloca
# elif defined _MSC_VER
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
/* Pacify GCC's 'empty if-body' warning. */
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
to allow for a few compiler-allocated temporary stack slots. */
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
&& (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# endif
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
yytype_int16 yyss_alloc;
YYSTYPE yyvs_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \