ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/libBASS/BASSyacc.c
Revision: 1346
Committed: Fri Jul 16 21:49:39 2004 UTC (21 years ago) by gezelter
Content type: text/plain
File size: 44562 byte(s)
Log Message:
fixing for machines that don't have lex and yacc

File Contents

# User Rev Content
1 gezelter 1346 /* A Bison parser, made by GNU Bison 1.875. */
2    
3     /* Skeleton parser for Yacc-like parsing with Bison,
4     Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5    
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2, or (at your option)
9     any later version.
10    
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     GNU General Public License for more details.
15    
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place - Suite 330,
19     Boston, MA 02111-1307, USA. */
20    
21     /* As a special exception, when this file is copied by Bison into a
22     Bison output file, you may use that output file without restriction.
23     This special exception was added by the Free Software Foundation
24     in version 1.24 of Bison. */
25    
26     /* Written by Richard Stallman by simplifying the original so called
27     ``semantic'' parser. */
28    
29     /* All symbols defined below should begin with yy or YY, to avoid
30     infringing on user name space. This should be done even for local
31     variables, as they might otherwise be expanded by user macros.
32     There are some unavoidable exceptions within include files to
33     define necessary library symbols; they are noted "INFRINGES ON
34     USER NAME SPACE" below. */
35    
36     /* Identify Bison output. */
37     #define YYBISON 1
38    
39     /* Skeleton name. */
40     #define YYSKELETON_NAME "yacc.c"
41    
42     /* Pure parsers. */
43     #define YYPURE 0
44    
45     /* Using locations. */
46     #define YYLSP_NEEDED 0
47    
48    
49    
50     /* Tokens. */
51     #ifndef YYTOKENTYPE
52     # define YYTOKENTYPE
53     /* Put the tokens into the symbol table, so that GDB and other debuggers
54     know about them. */
55     enum yytokentype {
56     MOLECULE = 258,
57     ATOM = 259,
58     BOND = 260,
59     BEND = 261,
60     TORSION = 262,
61     POSITION = 263,
62     MEMBERS = 264,
63     CONSTRAINT = 265,
64     COMPONENT = 266,
65     START_INDEX = 267,
66     DEFINED = 268,
67     ORIENTATION = 269,
68     ZCONSTRAINT = 270,
69     RIGIDBODY = 271,
70     CUTOFFGROUP = 272,
71     INTEGER = 273,
72     ARRAY_INDEX = 274,
73     DOUBLE = 275,
74     IDENTIFIER = 276,
75     QUOTED_STRING = 277,
76     LIST_STRING = 278
77     };
78     #endif
79     #define MOLECULE 258
80     #define ATOM 259
81     #define BOND 260
82     #define BEND 261
83     #define TORSION 262
84     #define POSITION 263
85     #define MEMBERS 264
86     #define CONSTRAINT 265
87     #define COMPONENT 266
88     #define START_INDEX 267
89     #define DEFINED 268
90     #define ORIENTATION 269
91     #define ZCONSTRAINT 270
92     #define RIGIDBODY 271
93     #define CUTOFFGROUP 272
94     #define INTEGER 273
95     #define ARRAY_INDEX 274
96     #define DOUBLE 275
97     #define IDENTIFIER 276
98     #define QUOTED_STRING 277
99     #define LIST_STRING 278
100    
101    
102    
103    
104     /* Copy the first part of user declarations. */
105    
106    
107     /* Enabling traces. */
108     #ifndef YYDEBUG
109     # define YYDEBUG 0
110     #endif
111    
112     /* Enabling verbose error messages. */
113     #ifdef YYERROR_VERBOSE
114     # undef YYERROR_VERBOSE
115     # define YYERROR_VERBOSE 1
116     #else
117     # define YYERROR_VERBOSE 0
118     #endif
119    
120     #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
121     #line 10 "BASSyacc.y"
122     typedef union YYSTYPE {
123     int i_val; /* integer value */
124     double d_val; /* double value */
125     char * s_ptr; /* string pointer */
126     struct node_tag* node_ptr; /* pointer to the statement node tree */
127     } YYSTYPE;
128     /* Line 191 of yacc.c. */
129     #line 129 "y.tab.c"
130     # define yystype YYSTYPE /* obsolescent; will be withdrawn */
131     # define YYSTYPE_IS_DECLARED 1
132     # define YYSTYPE_IS_TRIVIAL 1
133     #endif
134    
135    
136    
137     /* Copy the second part of user declarations. */
138     #line 45 "BASSyacc.y"
139    
140     #include <stdlib.h>
141     #include <stdio.h>
142     #include <string.h>
143    
144     #include "node_list.h"
145     #include "make_nodes.h"
146     #include "parse_tree.h"
147     #include "simError.h"
148     #ifdef IS_MPI
149     #define __is_lex__
150     #include "mpiBASS.h"
151     #endif
152    
153     extern int yylineno;
154    
155     struct filename_list{
156     char my_name[300];
157     struct filename_list* next;
158     };
159     extern struct filename_list* yyfile_name;
160    
161     extern void change_in_file( FILE* in_file );
162     extern void yacc_model( char* file_name );
163     extern void kill_lists(void);
164    
165     /* top of the node list */
166    
167     struct node_tag* head_node;
168     struct node_tag* current_node;
169    
170    
171    
172     /* Line 214 of yacc.c. */
173     #line 173 "y.tab.c"
174    
175     #if ! defined (yyoverflow) || YYERROR_VERBOSE
176    
177     /* The parser invokes alloca or malloc; define the necessary symbols. */
178    
179     # if YYSTACK_USE_ALLOCA
180     # define YYSTACK_ALLOC alloca
181     # else
182     # ifndef YYSTACK_USE_ALLOCA
183     # if defined (alloca) || defined (_ALLOCA_H)
184     # define YYSTACK_ALLOC alloca
185     # else
186     # ifdef __GNUC__
187     # define YYSTACK_ALLOC __builtin_alloca
188     # endif
189     # endif
190     # endif
191     # endif
192    
193     # ifdef YYSTACK_ALLOC
194     /* Pacify GCC's `empty if-body' warning. */
195     # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
196     # else
197     # if defined (__STDC__) || defined (__cplusplus)
198     # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
199     # define YYSIZE_T size_t
200     # endif
201     # define YYSTACK_ALLOC malloc
202     # define YYSTACK_FREE free
203     # endif
204     #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
205    
206    
207     #if (! defined (yyoverflow) \
208     && (! defined (__cplusplus) \
209     || (YYSTYPE_IS_TRIVIAL)))
210    
211     /* A type that is properly aligned for any stack member. */
212     union yyalloc
213     {
214     short yyss;
215     YYSTYPE yyvs;
216     };
217    
218     /* The size of the maximum gap between one aligned stack and the next. */
219     # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
220    
221     /* The size of an array large to enough to hold all stacks, each with
222     N elements. */
223     # define YYSTACK_BYTES(N) \
224     ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
225     + YYSTACK_GAP_MAXIMUM)
226    
227     /* Copy COUNT objects from FROM to TO. The source and destination do
228     not overlap. */
229     # ifndef YYCOPY
230     # if 1 < __GNUC__
231     # define YYCOPY(To, From, Count) \
232     __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
233     # else
234     # define YYCOPY(To, From, Count) \
235     do \
236     { \
237     register YYSIZE_T yyi; \
238     for (yyi = 0; yyi < (Count); yyi++) \
239     (To)[yyi] = (From)[yyi]; \
240     } \
241     while (0)
242     # endif
243     # endif
244    
245     /* Relocate STACK from its old location to the new one. The
246     local variables YYSIZE and YYSTACKSIZE give the old and new number of
247     elements in the stack, and YYPTR gives the new location of the
248     stack. Advance YYPTR to a properly aligned location for the next
249     stack. */
250     # define YYSTACK_RELOCATE(Stack) \
251     do \
252     { \
253     YYSIZE_T yynewbytes; \
254     YYCOPY (&yyptr->Stack, Stack, yysize); \
255     Stack = &yyptr->Stack; \
256     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
257     yyptr += yynewbytes / sizeof (*yyptr); \
258     } \
259     while (0)
260    
261     #endif
262    
263     #if defined (__STDC__) || defined (__cplusplus)
264     typedef signed char yysigned_char;
265     #else
266     typedef short yysigned_char;
267     #endif
268    
269     /* YYFINAL -- State number of the termination state. */
270     #define YYFINAL 3
271     /* YYLAST -- Last index in YYTABLE. */
272     #define YYLAST 279
273    
274     /* YYNTOKENS -- Number of terminals. */
275     #define YYNTOKENS 28
276     /* YYNNTS -- Number of nonterminals. */
277     #define YYNNTS 20
278     /* YYNRULES -- Number of rules. */
279     #define YYNRULES 38
280     /* YYNRULES -- Number of states. */
281     #define YYNSTATES 87
282    
283     /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
284     #define YYUNDEFTOK 2
285     #define YYMAXUTOK 278
286    
287     #define YYTRANSLATE(YYX) \
288     ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
289    
290     /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
291     static const unsigned char yytranslate[] =
292     {
293     0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
294     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
295     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
296     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
297     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
298     2, 2, 2, 2, 2, 2, 2, 2, 2, 25,
299     2, 24, 2, 2, 2, 2, 2, 2, 2, 2,
300     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
301     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
302     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
303     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
304     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
305     2, 2, 2, 26, 2, 27, 2, 2, 2, 2,
306     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
307     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
308     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
309     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
310     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
311     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
312     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
313     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
314     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
315     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
316     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
317     2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
318     2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
319     5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
320     15, 16, 17, 18, 19, 20, 21, 22, 23
321     };
322    
323     #if YYDEBUG
324     /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
325     YYRHS. */
326     static const unsigned char yyprhs[] =
327     {
328     0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
329     19, 21, 26, 31, 36, 41, 45, 49, 53, 57,
330     59, 61, 63, 65, 67, 69, 71, 73, 75, 80,
331     86, 92, 98, 104, 110, 116, 122, 127, 129
332     };
333    
334     /* YYRHS -- A `-1'-separated list of the rules' RHS. */
335     static const yysigned_char yyrhs[] =
336     {
337     29, 0, -1, 30, -1, -1, 30, 31, -1, 32,
338     -1, 33, -1, 34, -1, 35, -1, 36, -1, 37,
339     -1, 21, 24, 18, 25, -1, 21, 24, 20, 25,
340     -1, 21, 24, 21, 25, -1, 21, 24, 22, 25,
341     -1, 9, 23, 25, -1, 10, 23, 25, -1, 14,
342     23, 25, -1, 8, 23, 25, -1, 38, -1, 39,
343     -1, 40, -1, 41, -1, 42, -1, 43, -1, 44,
344     -1, 45, -1, 46, -1, 3, 26, 47, 27, -1,
345     4, 19, 26, 47, 27, -1, 5, 19, 26, 47,
346     27, -1, 6, 19, 26, 47, 27, -1, 7, 19,
347     26, 47, 27, -1, 15, 19, 26, 47, 27, -1,
348     16, 19, 26, 47, 27, -1, 17, 19, 26, 47,
349     27, -1, 11, 26, 47, 27, -1, 31, -1, 47,
350     31, -1
351     };
352    
353     /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
354     static const unsigned char yyrline[] =
355     {
356     0, 81, 81, 84, 85, 93, 94, 95, 96, 97,
357     98, 102, 104, 106, 108, 113, 118, 123, 128, 133,
358     134, 135, 136, 137, 138, 139, 140, 141, 145, 150,
359     155, 160, 165, 170, 175, 180, 185, 190, 191
360     };
361     #endif
362    
363     #if YYDEBUG || YYERROR_VERBOSE
364     /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
365     First, the terminals, then, starting at YYNTOKENS, nonterminals. */
366     static const char *const yytname[] =
367     {
368     "$end", "error", "$undefined", "MOLECULE", "ATOM", "BOND", "BEND",
369     "TORSION", "POSITION", "MEMBERS", "CONSTRAINT", "COMPONENT",
370     "START_INDEX", "DEFINED", "ORIENTATION", "ZCONSTRAINT", "RIGIDBODY",
371     "CUTOFFGROUP", "INTEGER", "ARRAY_INDEX", "DOUBLE", "IDENTIFIER",
372     "QUOTED_STRING", "LIST_STRING", "'='", "';'", "'{'", "'}'", "$accept",
373     "program", "commands", "stmt", "assignment", "members", "constraint",
374     "orientation", "position", "block", "molecule_block", "atom_block",
375     "bond_block", "bend_block", "torsion_block", "zconstraint_block",
376     "rigidbody_block", "cutoffgroup_block", "component_block", "stmt_list", 0
377     };
378     #endif
379    
380     # ifdef YYPRINT
381     /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
382     token YYLEX-NUM. */
383     static const unsigned short yytoknum[] =
384     {
385     0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
386     265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
387     275, 276, 277, 278, 61, 59, 123, 125
388     };
389     # endif
390    
391     /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
392     static const unsigned char yyr1[] =
393     {
394     0, 28, 29, 30, 30, 31, 31, 31, 31, 31,
395     31, 32, 32, 32, 32, 33, 34, 35, 36, 37,
396     37, 37, 37, 37, 37, 37, 37, 37, 38, 39,
397     40, 41, 42, 43, 44, 45, 46, 47, 47
398     };
399    
400     /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
401     static const unsigned char yyr2[] =
402     {
403     0, 2, 1, 0, 2, 1, 1, 1, 1, 1,
404     1, 4, 4, 4, 4, 3, 3, 3, 3, 1,
405     1, 1, 1, 1, 1, 1, 1, 1, 4, 5,
406     5, 5, 5, 5, 5, 5, 4, 1, 2
407     };
408    
409     /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
410     STATE-NUM when YYTABLE doesn't specify something else to do. Zero
411     means the default is an error. */
412     static const unsigned char yydefact[] =
413     {
414     3, 0, 2, 1, 0, 0, 0, 0, 0, 0,
415     0, 0, 0, 0, 0, 0, 0, 0, 4, 5,
416     6, 7, 8, 9, 10, 19, 20, 21, 22, 23,
417     24, 25, 26, 27, 0, 0, 0, 0, 0, 0,
418     0, 0, 0, 0, 0, 0, 0, 0, 37, 0,
419     0, 0, 0, 0, 18, 15, 16, 0, 17, 0,
420     0, 0, 0, 0, 0, 0, 28, 38, 0, 0,
421     0, 0, 36, 0, 0, 0, 11, 12, 13, 14,
422     29, 30, 31, 32, 33, 34, 35
423     };
424    
425     /* YYDEFGOTO[NTERM-NUM]. */
426     static const yysigned_char yydefgoto[] =
427     {
428     -1, 1, 2, 48, 19, 20, 21, 22, 23, 24,
429     25, 26, 27, 28, 29, 30, 31, 32, 33, 49
430     };
431    
432     /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
433     STATE-NUM. */
434     #define YYPACT_NINF -26
435     static const short yypact[] =
436     {
437     -26, 11, 258, -26, -25, -7, 5, 6, 17, -6,
438     -5, 14, 16, 20, 25, 27, 29, 26, -26, -26,
439     -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
440     -26, -26, -26, -26, 258, 23, 28, 30, 31, 33,
441     34, 35, 258, 36, 37, 38, 39, 1, -26, -1,
442     258, 258, 258, 258, -26, -26, -26, 24, -26, 258,
443     258, 258, 45, 58, 59, 64, -26, -26, 71, 96,
444     121, 146, -26, 171, 196, 221, -26, -26, -26, -26,
445     -26, -26, -26, -26, -26, -26, -26
446     };
447    
448     /* YYPGOTO[NTERM-NUM]. */
449     static const short yypgoto[] =
450     {
451     -26, -26, -26, -2, -26, -26, -26, -26, -26, -26,
452     -26, -26, -26, -26, -26, -26, -26, -26, -26, 199
453     };
454    
455     /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
456     positive, shift that token. If negative, reduce the rule which
457     number is the opposite. If zero, do what YYDEFACT says.
458     If YYTABLE_NINF, syntax error. */
459     #define YYTABLE_NINF -1
460     static const unsigned char yytable[] =
461     {
462     18, 34, 4, 5, 6, 7, 8, 9, 10, 11,
463     12, 3, 35, 13, 14, 15, 16, 39, 40, 62,
464     17, 63, 64, 65, 36, 37, 66, 4, 5, 6,
465     7, 8, 9, 10, 11, 12, 38, 41, 13, 14,
466     15, 16, 42, 43, 44, 17, 45, 67, 46, 50,
467     47, 72, 0, 0, 51, 67, 52, 53, 54, 55,
468     56, 58, 0, 59, 60, 61, 67, 67, 67, 67,
469     76, 67, 67, 67, 4, 5, 6, 7, 8, 9,
470     10, 11, 12, 77, 78, 13, 14, 15, 16, 79,
471     0, 0, 17, 0, 0, 0, 0, 0, 80, 4,
472     5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
473     13, 14, 15, 16, 0, 0, 0, 17, 0, 0,
474     0, 0, 0, 81, 4, 5, 6, 7, 8, 9,
475     10, 11, 12, 0, 0, 13, 14, 15, 16, 0,
476     0, 0, 17, 0, 0, 0, 0, 0, 82, 4,
477     5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
478     13, 14, 15, 16, 0, 0, 0, 17, 0, 0,
479     0, 0, 0, 83, 4, 5, 6, 7, 8, 9,
480     10, 11, 12, 0, 0, 13, 14, 15, 16, 0,
481     0, 0, 17, 0, 0, 0, 0, 0, 84, 4,
482     5, 6, 7, 8, 9, 10, 11, 12, 0, 0,
483     13, 14, 15, 16, 0, 0, 0, 17, 0, 0,
484     0, 0, 0, 85, 4, 5, 6, 7, 8, 9,
485     10, 11, 12, 0, 0, 13, 14, 15, 16, 0,
486     0, 57, 17, 0, 0, 0, 0, 0, 86, 68,
487     69, 70, 71, 0, 0, 0, 0, 0, 73, 74,
488     75, 4, 5, 6, 7, 8, 9, 10, 11, 12,
489     0, 0, 13, 14, 15, 16, 0, 0, 0, 17
490     };
491    
492     static const yysigned_char yycheck[] =
493     {
494     2, 26, 3, 4, 5, 6, 7, 8, 9, 10,
495     11, 0, 19, 14, 15, 16, 17, 23, 23, 18,
496     21, 20, 21, 22, 19, 19, 27, 3, 4, 5,
497     6, 7, 8, 9, 10, 11, 19, 23, 14, 15,
498     16, 17, 26, 23, 19, 21, 19, 49, 19, 26,
499     24, 27, -1, -1, 26, 57, 26, 26, 25, 25,
500     25, 25, -1, 26, 26, 26, 68, 69, 70, 71,
501     25, 73, 74, 75, 3, 4, 5, 6, 7, 8,
502     9, 10, 11, 25, 25, 14, 15, 16, 17, 25,
503     -1, -1, 21, -1, -1, -1, -1, -1, 27, 3,
504     4, 5, 6, 7, 8, 9, 10, 11, -1, -1,
505     14, 15, 16, 17, -1, -1, -1, 21, -1, -1,
506     -1, -1, -1, 27, 3, 4, 5, 6, 7, 8,
507     9, 10, 11, -1, -1, 14, 15, 16, 17, -1,
508     -1, -1, 21, -1, -1, -1, -1, -1, 27, 3,
509     4, 5, 6, 7, 8, 9, 10, 11, -1, -1,
510     14, 15, 16, 17, -1, -1, -1, 21, -1, -1,
511     -1, -1, -1, 27, 3, 4, 5, 6, 7, 8,
512     9, 10, 11, -1, -1, 14, 15, 16, 17, -1,
513     -1, -1, 21, -1, -1, -1, -1, -1, 27, 3,
514     4, 5, 6, 7, 8, 9, 10, 11, -1, -1,
515     14, 15, 16, 17, -1, -1, -1, 21, -1, -1,
516     -1, -1, -1, 27, 3, 4, 5, 6, 7, 8,
517     9, 10, 11, -1, -1, 14, 15, 16, 17, -1,
518     -1, 42, 21, -1, -1, -1, -1, -1, 27, 50,
519     51, 52, 53, -1, -1, -1, -1, -1, 59, 60,
520     61, 3, 4, 5, 6, 7, 8, 9, 10, 11,
521     -1, -1, 14, 15, 16, 17, -1, -1, -1, 21
522     };
523    
524     /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
525     symbol of state STATE-NUM. */
526     static const unsigned char yystos[] =
527     {
528     0, 29, 30, 0, 3, 4, 5, 6, 7, 8,
529     9, 10, 11, 14, 15, 16, 17, 21, 31, 32,
530     33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
531     43, 44, 45, 46, 26, 19, 19, 19, 19, 23,
532     23, 23, 26, 23, 19, 19, 19, 24, 31, 47,
533     26, 26, 26, 26, 25, 25, 25, 47, 25, 26,
534     26, 26, 18, 20, 21, 22, 27, 31, 47, 47,
535     47, 47, 27, 47, 47, 47, 25, 25, 25, 25,
536     27, 27, 27, 27, 27, 27, 27
537     };
538    
539     #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
540     # define YYSIZE_T __SIZE_TYPE__
541     #endif
542     #if ! defined (YYSIZE_T) && defined (size_t)
543     # define YYSIZE_T size_t
544     #endif
545     #if ! defined (YYSIZE_T)
546     # if defined (__STDC__) || defined (__cplusplus)
547     # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
548     # define YYSIZE_T size_t
549     # endif
550     #endif
551     #if ! defined (YYSIZE_T)
552     # define YYSIZE_T unsigned int
553     #endif
554    
555     #define yyerrok (yyerrstatus = 0)
556     #define yyclearin (yychar = YYEMPTY)
557     #define YYEMPTY (-2)
558     #define YYEOF 0
559    
560     #define YYACCEPT goto yyacceptlab
561     #define YYABORT goto yyabortlab
562     #define YYERROR goto yyerrlab1
563    
564    
565     /* Like YYERROR except do call yyerror. This remains here temporarily
566     to ease the transition to the new meaning of YYERROR, for GCC.
567     Once GCC version 2 has supplanted version 1, this can go. */
568    
569     #define YYFAIL goto yyerrlab
570    
571     #define YYRECOVERING() (!!yyerrstatus)
572    
573     #define YYBACKUP(Token, Value) \
574     do \
575     if (yychar == YYEMPTY && yylen == 1) \
576     { \
577     yychar = (Token); \
578     yylval = (Value); \
579     yytoken = YYTRANSLATE (yychar); \
580     YYPOPSTACK; \
581     goto yybackup; \
582     } \
583     else \
584     { \
585     yyerror ("syntax error: cannot back up");\
586     YYERROR; \
587     } \
588     while (0)
589    
590     #define YYTERROR 1
591     #define YYERRCODE 256
592    
593     /* YYLLOC_DEFAULT -- Compute the default location (before the actions
594     are run). */
595    
596     #ifndef YYLLOC_DEFAULT
597     # define YYLLOC_DEFAULT(Current, Rhs, N) \
598     Current.first_line = Rhs[1].first_line; \
599     Current.first_column = Rhs[1].first_column; \
600     Current.last_line = Rhs[N].last_line; \
601     Current.last_column = Rhs[N].last_column;
602     #endif
603    
604     /* YYLEX -- calling `yylex' with the right arguments. */
605    
606     #ifdef YYLEX_PARAM
607     # define YYLEX yylex (YYLEX_PARAM)
608     #else
609     # define YYLEX yylex ()
610     #endif
611    
612     /* Enable debugging if requested. */
613     #if YYDEBUG
614    
615     # ifndef YYFPRINTF
616     # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
617     # define YYFPRINTF fprintf
618     # endif
619    
620     # define YYDPRINTF(Args) \
621     do { \
622     if (yydebug) \
623     YYFPRINTF Args; \
624     } while (0)
625    
626     # define YYDSYMPRINT(Args) \
627     do { \
628     if (yydebug) \
629     yysymprint Args; \
630     } while (0)
631    
632     # define YYDSYMPRINTF(Title, Token, Value, Location) \
633     do { \
634     if (yydebug) \
635     { \
636     YYFPRINTF (stderr, "%s ", Title); \
637     yysymprint (stderr, \
638     Token, Value); \
639     YYFPRINTF (stderr, "\n"); \
640     } \
641     } while (0)
642    
643     /*------------------------------------------------------------------.
644     | yy_stack_print -- Print the state stack from its BOTTOM up to its |
645     | TOP (cinluded). |
646     `------------------------------------------------------------------*/
647    
648     #if defined (__STDC__) || defined (__cplusplus)
649     static void
650     yy_stack_print (short *bottom, short *top)
651     #else
652     static void
653     yy_stack_print (bottom, top)
654     short *bottom;
655     short *top;
656     #endif
657     {
658     YYFPRINTF (stderr, "Stack now");
659     for (/* Nothing. */; bottom <= top; ++bottom)
660     YYFPRINTF (stderr, " %d", *bottom);
661     YYFPRINTF (stderr, "\n");
662     }
663    
664     # define YY_STACK_PRINT(Bottom, Top) \
665     do { \
666     if (yydebug) \
667     yy_stack_print ((Bottom), (Top)); \
668     } while (0)
669    
670    
671     /*------------------------------------------------.
672     | Report that the YYRULE is going to be reduced. |
673     `------------------------------------------------*/
674    
675     #if defined (__STDC__) || defined (__cplusplus)
676     static void
677     yy_reduce_print (int yyrule)
678     #else
679     static void
680     yy_reduce_print (yyrule)
681     int yyrule;
682     #endif
683     {
684     int yyi;
685     unsigned int yylineno = yyrline[yyrule];
686     YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
687     yyrule - 1, yylineno);
688     /* Print the symbols being reduced, and their result. */
689     for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
690     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
691     YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
692     }
693    
694     # define YY_REDUCE_PRINT(Rule) \
695     do { \
696     if (yydebug) \
697     yy_reduce_print (Rule); \
698     } while (0)
699    
700     /* Nonzero means print parse trace. It is left uninitialized so that
701     multiple parsers can coexist. */
702     int yydebug;
703     #else /* !YYDEBUG */
704     # define YYDPRINTF(Args)
705     # define YYDSYMPRINT(Args)
706     # define YYDSYMPRINTF(Title, Token, Value, Location)
707     # define YY_STACK_PRINT(Bottom, Top)
708     # define YY_REDUCE_PRINT(Rule)
709     #endif /* !YYDEBUG */
710    
711    
712     /* YYINITDEPTH -- initial size of the parser's stacks. */
713     #ifndef YYINITDEPTH
714     # define YYINITDEPTH 200
715     #endif
716    
717     /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
718     if the built-in stack extension method is used).
719    
720     Do not make this value too large; the results are undefined if
721     SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
722     evaluated with infinite-precision integer arithmetic. */
723    
724     #if YYMAXDEPTH == 0
725     # undef YYMAXDEPTH
726     #endif
727    
728     #ifndef YYMAXDEPTH
729     # define YYMAXDEPTH 10000
730     #endif
731    
732    
733    
734     #if YYERROR_VERBOSE
735    
736     # ifndef yystrlen
737     # if defined (__GLIBC__) && defined (_STRING_H)
738     # define yystrlen strlen
739     # else
740     /* Return the length of YYSTR. */
741     static YYSIZE_T
742     # if defined (__STDC__) || defined (__cplusplus)
743     yystrlen (const char *yystr)
744     # else
745     yystrlen (yystr)
746     const char *yystr;
747     # endif
748     {
749     register const char *yys = yystr;
750    
751     while (*yys++ != '\0')
752     continue;
753    
754     return yys - yystr - 1;
755     }
756     # endif
757     # endif
758    
759     # ifndef yystpcpy
760     # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
761     # define yystpcpy stpcpy
762     # else
763     /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
764     YYDEST. */
765     static char *
766     # if defined (__STDC__) || defined (__cplusplus)
767     yystpcpy (char *yydest, const char *yysrc)
768     # else
769     yystpcpy (yydest, yysrc)
770     char *yydest;
771     const char *yysrc;
772     # endif
773     {
774     register char *yyd = yydest;
775     register const char *yys = yysrc;
776    
777     while ((*yyd++ = *yys++) != '\0')
778     continue;
779    
780     return yyd - 1;
781     }
782     # endif
783     # endif
784    
785     #endif /* !YYERROR_VERBOSE */
786    
787    
788    
789     #if YYDEBUG
790     /*--------------------------------.
791     | Print this symbol on YYOUTPUT. |
792     `--------------------------------*/
793    
794     #if defined (__STDC__) || defined (__cplusplus)
795     static void
796     yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
797     #else
798     static void
799     yysymprint (yyoutput, yytype, yyvaluep)
800     FILE *yyoutput;
801     int yytype;
802     YYSTYPE *yyvaluep;
803     #endif
804     {
805     /* Pacify ``unused variable'' warnings. */
806     (void) yyvaluep;
807    
808     if (yytype < YYNTOKENS)
809     {
810     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
811     # ifdef YYPRINT
812     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
813     # endif
814     }
815     else
816     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
817    
818     switch (yytype)
819     {
820     default:
821     break;
822     }
823     YYFPRINTF (yyoutput, ")");
824     }
825    
826     #endif /* ! YYDEBUG */
827     /*-----------------------------------------------.
828     | Release the memory associated to this symbol. |
829     `-----------------------------------------------*/
830    
831     #if defined (__STDC__) || defined (__cplusplus)
832     static void
833     yydestruct (int yytype, YYSTYPE *yyvaluep)
834     #else
835     static void
836     yydestruct (yytype, yyvaluep)
837     int yytype;
838     YYSTYPE *yyvaluep;
839     #endif
840     {
841     /* Pacify ``unused variable'' warnings. */
842     (void) yyvaluep;
843    
844     switch (yytype)
845     {
846    
847     default:
848     break;
849     }
850     }
851    
852    
853     /* Prevent warnings from -Wmissing-prototypes. */
854    
855     #ifdef YYPARSE_PARAM
856     # if defined (__STDC__) || defined (__cplusplus)
857     int yyparse (void *YYPARSE_PARAM);
858     # else
859     int yyparse ();
860     # endif
861     #else /* ! YYPARSE_PARAM */
862     #if defined (__STDC__) || defined (__cplusplus)
863     int yyparse (void);
864     #else
865     int yyparse ();
866     #endif
867     #endif /* ! YYPARSE_PARAM */
868    
869    
870    
871     /* The lookahead symbol. */
872     int yychar;
873    
874     /* The semantic value of the lookahead symbol. */
875     YYSTYPE yylval;
876    
877     /* Number of syntax errors so far. */
878     int yynerrs;
879    
880    
881    
882     /*----------.
883     | yyparse. |
884     `----------*/
885    
886     #ifdef YYPARSE_PARAM
887     # if defined (__STDC__) || defined (__cplusplus)
888     int yyparse (void *YYPARSE_PARAM)
889     # else
890     int yyparse (YYPARSE_PARAM)
891     void *YYPARSE_PARAM;
892     # endif
893     #else /* ! YYPARSE_PARAM */
894     #if defined (__STDC__) || defined (__cplusplus)
895     int
896     yyparse (void)
897     #else
898     int
899     yyparse ()
900    
901     #endif
902     #endif
903     {
904    
905     register int yystate;
906     register int yyn;
907     int yyresult;
908     /* Number of tokens to shift before error messages enabled. */
909     int yyerrstatus;
910     /* Lookahead token as an internal (translated) token number. */
911     int yytoken = 0;
912    
913     /* Three stacks and their tools:
914     `yyss': related to states,
915     `yyvs': related to semantic values,
916     `yyls': related to locations.
917    
918     Refer to the stacks thru separate pointers, to allow yyoverflow
919     to reallocate them elsewhere. */
920    
921     /* The state stack. */
922     short yyssa[YYINITDEPTH];
923     short *yyss = yyssa;
924     register short *yyssp;
925    
926     /* The semantic value stack. */
927     YYSTYPE yyvsa[YYINITDEPTH];
928     YYSTYPE *yyvs = yyvsa;
929     register YYSTYPE *yyvsp;
930    
931    
932    
933     #define YYPOPSTACK (yyvsp--, yyssp--)
934    
935     YYSIZE_T yystacksize = YYINITDEPTH;
936    
937     /* The variables used to return semantic value and location from the
938     action routines. */
939     YYSTYPE yyval;
940    
941    
942     /* When reducing, the number of symbols on the RHS of the reduced
943     rule. */
944     int yylen;
945    
946     YYDPRINTF ((stderr, "Starting parse\n"));
947    
948     yystate = 0;
949     yyerrstatus = 0;
950     yynerrs = 0;
951     yychar = YYEMPTY; /* Cause a token to be read. */
952    
953     /* Initialize stack pointers.
954     Waste one element of value and location stack
955     so that they stay on the same level as the state stack.
956     The wasted elements are never initialized. */
957    
958     yyssp = yyss;
959     yyvsp = yyvs;
960    
961     goto yysetstate;
962    
963     /*------------------------------------------------------------.
964     | yynewstate -- Push a new state, which is found in yystate. |
965     `------------------------------------------------------------*/
966     yynewstate:
967     /* In all cases, when you get here, the value and location stacks
968     have just been pushed. so pushing a state here evens the stacks.
969     */
970     yyssp++;
971    
972     yysetstate:
973     *yyssp = yystate;
974    
975     if (yyss + yystacksize - 1 <= yyssp)
976     {
977     /* Get the current used size of the three stacks, in elements. */
978     YYSIZE_T yysize = yyssp - yyss + 1;
979    
980     #ifdef yyoverflow
981     {
982     /* Give user a chance to reallocate the stack. Use copies of
983     these so that the &'s don't force the real ones into
984     memory. */
985     YYSTYPE *yyvs1 = yyvs;
986     short *yyss1 = yyss;
987    
988    
989     /* Each stack pointer address is followed by the size of the
990     data in use in that stack, in bytes. This used to be a
991     conditional around just the two extra args, but that might
992     be undefined if yyoverflow is a macro. */
993     yyoverflow ("parser stack overflow",
994     &yyss1, yysize * sizeof (*yyssp),
995     &yyvs1, yysize * sizeof (*yyvsp),
996    
997     &yystacksize);
998    
999     yyss = yyss1;
1000     yyvs = yyvs1;
1001     }
1002     #else /* no yyoverflow */
1003     # ifndef YYSTACK_RELOCATE
1004     goto yyoverflowlab;
1005     # else
1006     /* Extend the stack our own way. */
1007     if (YYMAXDEPTH <= yystacksize)
1008     goto yyoverflowlab;
1009     yystacksize *= 2;
1010     if (YYMAXDEPTH < yystacksize)
1011     yystacksize = YYMAXDEPTH;
1012    
1013     {
1014     short *yyss1 = yyss;
1015     union yyalloc *yyptr =
1016     (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1017     if (! yyptr)
1018     goto yyoverflowlab;
1019     YYSTACK_RELOCATE (yyss);
1020     YYSTACK_RELOCATE (yyvs);
1021    
1022     # undef YYSTACK_RELOCATE
1023     if (yyss1 != yyssa)
1024     YYSTACK_FREE (yyss1);
1025     }
1026     # endif
1027     #endif /* no yyoverflow */
1028    
1029     yyssp = yyss + yysize - 1;
1030     yyvsp = yyvs + yysize - 1;
1031    
1032    
1033     YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1034     (unsigned long int) yystacksize));
1035    
1036     if (yyss + yystacksize - 1 <= yyssp)
1037     YYABORT;
1038     }
1039    
1040     YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1041    
1042     goto yybackup;
1043    
1044     /*-----------.
1045     | yybackup. |
1046     `-----------*/
1047     yybackup:
1048    
1049     /* Do appropriate processing given the current state. */
1050     /* Read a lookahead token if we need one and don't already have one. */
1051     /* yyresume: */
1052    
1053     /* First try to decide what to do without reference to lookahead token. */
1054    
1055     yyn = yypact[yystate];
1056     if (yyn == YYPACT_NINF)
1057     goto yydefault;
1058    
1059     /* Not known => get a lookahead token if don't already have one. */
1060    
1061     /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1062     if (yychar == YYEMPTY)
1063     {
1064     YYDPRINTF ((stderr, "Reading a token: "));
1065     yychar = YYLEX;
1066     }
1067    
1068     if (yychar <= YYEOF)
1069     {
1070     yychar = yytoken = YYEOF;
1071     YYDPRINTF ((stderr, "Now at end of input.\n"));
1072     }
1073     else
1074     {
1075     yytoken = YYTRANSLATE (yychar);
1076     YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1077     }
1078    
1079     /* If the proper action on seeing token YYTOKEN is to reduce or to
1080     detect an error, take that action. */
1081     yyn += yytoken;
1082     if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1083     goto yydefault;
1084     yyn = yytable[yyn];
1085     if (yyn <= 0)
1086     {
1087     if (yyn == 0 || yyn == YYTABLE_NINF)
1088     goto yyerrlab;
1089     yyn = -yyn;
1090     goto yyreduce;
1091     }
1092    
1093     if (yyn == YYFINAL)
1094     YYACCEPT;
1095    
1096     /* Shift the lookahead token. */
1097     YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1098    
1099     /* Discard the token being shifted unless it is eof. */
1100     if (yychar != YYEOF)
1101     yychar = YYEMPTY;
1102    
1103     *++yyvsp = yylval;
1104    
1105    
1106     /* Count tokens shifted since error; after three, turn off error
1107     status. */
1108     if (yyerrstatus)
1109     yyerrstatus--;
1110    
1111     yystate = yyn;
1112     goto yynewstate;
1113    
1114    
1115     /*-----------------------------------------------------------.
1116     | yydefault -- do the default action for the current state. |
1117     `-----------------------------------------------------------*/
1118     yydefault:
1119     yyn = yydefact[yystate];
1120     if (yyn == 0)
1121     goto yyerrlab;
1122     goto yyreduce;
1123    
1124    
1125     /*-----------------------------.
1126     | yyreduce -- Do a reduction. |
1127     `-----------------------------*/
1128     yyreduce:
1129     /* yyn is the number of a rule to reduce with. */
1130     yylen = yyr2[yyn];
1131    
1132     /* If YYLEN is nonzero, implement the default value of the action:
1133     `$$ = $1'.
1134    
1135     Otherwise, the following line sets YYVAL to garbage.
1136     This behavior is undocumented and Bison
1137     users should not rely upon it. Assigning to YYVAL
1138     unconditionally makes the parser a bit smaller, and it avoids a
1139     GCC warning that YYVAL may be used uninitialized. */
1140     yyval = yyvsp[1-yylen];
1141    
1142    
1143     YY_REDUCE_PRINT (yyn);
1144     switch (yyn)
1145     {
1146     case 4:
1147     #line 85 "BASSyacc.y"
1148     {
1149     current_node->next_stmt = yyvsp[0].node_ptr;
1150     yyvsp[0].node_ptr->prev_stmt = current_node;
1151     current_node = yyvsp[0].node_ptr;
1152     }
1153     break;
1154    
1155     case 5:
1156     #line 93 "BASSyacc.y"
1157     { yyval.node_ptr = yyvsp[0].node_ptr; }
1158     break;
1159    
1160     case 6:
1161     #line 94 "BASSyacc.y"
1162     { yyval.node_ptr = yyvsp[0].node_ptr; }
1163     break;
1164    
1165     case 7:
1166     #line 95 "BASSyacc.y"
1167     { yyval.node_ptr = yyvsp[0].node_ptr; }
1168     break;
1169    
1170     case 8:
1171     #line 96 "BASSyacc.y"
1172     { yyval.node_ptr = yyvsp[0].node_ptr; }
1173     break;
1174    
1175     case 9:
1176     #line 97 "BASSyacc.y"
1177     { yyval.node_ptr = yyvsp[0].node_ptr; }
1178     break;
1179    
1180     case 10:
1181     #line 98 "BASSyacc.y"
1182     { yyval.node_ptr = yyvsp[0].node_ptr; }
1183     break;
1184    
1185     case 11:
1186     #line 103 "BASSyacc.y"
1187     { yyval.node_ptr = assign_i( yyvsp[-3].s_ptr, yyvsp[-1].i_val ); }
1188     break;
1189    
1190     case 12:
1191     #line 105 "BASSyacc.y"
1192     { yyval.node_ptr = assign_d( yyvsp[-3].s_ptr, yyvsp[-1].d_val ); }
1193     break;
1194    
1195     case 13:
1196     #line 107 "BASSyacc.y"
1197     { yyval.node_ptr = assign_s( yyvsp[-3].s_ptr, yyvsp[-1].s_ptr ); }
1198     break;
1199    
1200     case 14:
1201     #line 109 "BASSyacc.y"
1202     { yyval.node_ptr = assign_s( yyvsp[-3].s_ptr, yyvsp[-1].s_ptr ); }
1203     break;
1204    
1205     case 15:
1206     #line 114 "BASSyacc.y"
1207     { yyval.node_ptr = members( yyvsp[-1].s_ptr ); }
1208     break;
1209    
1210     case 16:
1211     #line 119 "BASSyacc.y"
1212     { yyval.node_ptr = constraint( yyvsp[-1].s_ptr ); }
1213     break;
1214    
1215     case 17:
1216     #line 124 "BASSyacc.y"
1217     { yyval.node_ptr = orientation( yyvsp[-1].s_ptr ); }
1218     break;
1219    
1220     case 18:
1221     #line 129 "BASSyacc.y"
1222     { yyval.node_ptr = position( yyvsp[-1].s_ptr ); }
1223     break;
1224    
1225     case 19:
1226     #line 133 "BASSyacc.y"
1227     { yyval.node_ptr = yyvsp[0].node_ptr; }
1228     break;
1229    
1230     case 20:
1231     #line 134 "BASSyacc.y"
1232     { yyval.node_ptr = yyvsp[0].node_ptr; }
1233     break;
1234    
1235     case 21:
1236     #line 135 "BASSyacc.y"
1237     { yyval.node_ptr = yyvsp[0].node_ptr; }
1238     break;
1239    
1240     case 22:
1241     #line 136 "BASSyacc.y"
1242     { yyval.node_ptr = yyvsp[0].node_ptr; }
1243     break;
1244    
1245     case 23:
1246     #line 137 "BASSyacc.y"
1247     { yyval.node_ptr = yyvsp[0].node_ptr; }
1248     break;
1249    
1250     case 24:
1251     #line 138 "BASSyacc.y"
1252     { yyval.node_ptr = yyvsp[0].node_ptr; }
1253     break;
1254    
1255     case 25:
1256     #line 139 "BASSyacc.y"
1257     { yyval.node_ptr = yyvsp[0].node_ptr; }
1258     break;
1259    
1260     case 26:
1261     #line 140 "BASSyacc.y"
1262     { yyval.node_ptr = yyvsp[0].node_ptr; }
1263     break;
1264    
1265     case 27:
1266     #line 141 "BASSyacc.y"
1267     { yyval.node_ptr = yyvsp[0].node_ptr; }
1268     break;
1269    
1270     case 28:
1271     #line 146 "BASSyacc.y"
1272     { yyval.node_ptr = molecule_blk( yyvsp[-1].node_ptr ); }
1273     break;
1274    
1275     case 29:
1276     #line 151 "BASSyacc.y"
1277     { yyval.node_ptr = atom_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1278     break;
1279    
1280     case 30:
1281     #line 156 "BASSyacc.y"
1282     { yyval.node_ptr = bond_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1283     break;
1284    
1285     case 31:
1286     #line 161 "BASSyacc.y"
1287     { yyval.node_ptr = bend_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1288     break;
1289    
1290     case 32:
1291     #line 166 "BASSyacc.y"
1292     { yyval.node_ptr = torsion_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1293     break;
1294    
1295     case 33:
1296     #line 171 "BASSyacc.y"
1297     { yyval.node_ptr = zconstraint_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1298     break;
1299    
1300     case 34:
1301     #line 176 "BASSyacc.y"
1302     { yyval.node_ptr = rigidbody_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1303     break;
1304    
1305     case 35:
1306     #line 181 "BASSyacc.y"
1307     { yyval.node_ptr = cutoffgroup_blk( yyvsp[-3].i_val, yyvsp[-1].node_ptr ); }
1308     break;
1309    
1310     case 36:
1311     #line 186 "BASSyacc.y"
1312     { yyval.node_ptr = component_blk( yyvsp[-1].node_ptr ); }
1313     break;
1314    
1315     case 37:
1316     #line 190 "BASSyacc.y"
1317     { yyval.node_ptr = yyvsp[0].node_ptr; }
1318     break;
1319    
1320     case 38:
1321     #line 191 "BASSyacc.y"
1322     {
1323     yyvsp[-1].node_ptr->next_stmt = yyvsp[0].node_ptr;
1324     yyvsp[0].node_ptr->prev_stmt = yyvsp[-1].node_ptr;
1325     yyval.node_ptr = yyvsp[0].node_ptr;
1326     }
1327     break;
1328    
1329    
1330     }
1331    
1332     /* Line 999 of yacc.c. */
1333     #line 1333 "y.tab.c"
1334    
1335     yyvsp -= yylen;
1336     yyssp -= yylen;
1337    
1338    
1339     YY_STACK_PRINT (yyss, yyssp);
1340    
1341     *++yyvsp = yyval;
1342    
1343    
1344     /* Now `shift' the result of the reduction. Determine what state
1345     that goes to, based on the state we popped back to and the rule
1346     number reduced by. */
1347    
1348     yyn = yyr1[yyn];
1349    
1350     yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1351     if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1352     yystate = yytable[yystate];
1353     else
1354     yystate = yydefgoto[yyn - YYNTOKENS];
1355    
1356     goto yynewstate;
1357    
1358    
1359     /*------------------------------------.
1360     | yyerrlab -- here on detecting error |
1361     `------------------------------------*/
1362     yyerrlab:
1363     /* If not already recovering from an error, report this error. */
1364     if (!yyerrstatus)
1365     {
1366     ++yynerrs;
1367     #if YYERROR_VERBOSE
1368     yyn = yypact[yystate];
1369    
1370     if (YYPACT_NINF < yyn && yyn < YYLAST)
1371     {
1372     YYSIZE_T yysize = 0;
1373     int yytype = YYTRANSLATE (yychar);
1374     char *yymsg;
1375     int yyx, yycount;
1376    
1377     yycount = 0;
1378     /* Start YYX at -YYN if negative to avoid negative indexes in
1379     YYCHECK. */
1380     for (yyx = yyn < 0 ? -yyn : 0;
1381     yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1382     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1383     yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1384     yysize += yystrlen ("syntax error, unexpected ") + 1;
1385     yysize += yystrlen (yytname[yytype]);
1386     yymsg = (char *) YYSTACK_ALLOC (yysize);
1387     if (yymsg != 0)
1388     {
1389     char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1390     yyp = yystpcpy (yyp, yytname[yytype]);
1391    
1392     if (yycount < 5)
1393     {
1394     yycount = 0;
1395     for (yyx = yyn < 0 ? -yyn : 0;
1396     yyx < (int) (sizeof (yytname) / sizeof (char *));
1397     yyx++)
1398     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1399     {
1400     const char *yyq = ! yycount ? ", expecting " : " or ";
1401     yyp = yystpcpy (yyp, yyq);
1402     yyp = yystpcpy (yyp, yytname[yyx]);
1403     yycount++;
1404     }
1405     }
1406     yyerror (yymsg);
1407     YYSTACK_FREE (yymsg);
1408     }
1409     else
1410     yyerror ("syntax error; also virtual memory exhausted");
1411     }
1412     else
1413     #endif /* YYERROR_VERBOSE */
1414     yyerror ("syntax error");
1415     }
1416    
1417    
1418    
1419     if (yyerrstatus == 3)
1420     {
1421     /* If just tried and failed to reuse lookahead token after an
1422     error, discard it. */
1423    
1424     /* Return failure if at end of input. */
1425     if (yychar == YYEOF)
1426     {
1427     /* Pop the error token. */
1428     YYPOPSTACK;
1429     /* Pop the rest of the stack. */
1430     while (yyss < yyssp)
1431     {
1432     YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1433     yydestruct (yystos[*yyssp], yyvsp);
1434     YYPOPSTACK;
1435     }
1436     YYABORT;
1437     }
1438    
1439     YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1440     yydestruct (yytoken, &yylval);
1441     yychar = YYEMPTY;
1442    
1443     }
1444    
1445     /* Else will try to reuse lookahead token after shifting the error
1446     token. */
1447     goto yyerrlab1;
1448    
1449    
1450     /*----------------------------------------------------.
1451     | yyerrlab1 -- error raised explicitly by an action. |
1452     `----------------------------------------------------*/
1453     yyerrlab1:
1454     yyerrstatus = 3; /* Each real token shifted decrements this. */
1455    
1456     for (;;)
1457     {
1458     yyn = yypact[yystate];
1459     if (yyn != YYPACT_NINF)
1460     {
1461     yyn += YYTERROR;
1462     if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1463     {
1464     yyn = yytable[yyn];
1465     if (0 < yyn)
1466     break;
1467     }
1468     }
1469    
1470     /* Pop the current state because it cannot handle the error token. */
1471     if (yyssp == yyss)
1472     YYABORT;
1473    
1474     YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1475     yydestruct (yystos[yystate], yyvsp);
1476     yyvsp--;
1477     yystate = *--yyssp;
1478    
1479     YY_STACK_PRINT (yyss, yyssp);
1480     }
1481    
1482     if (yyn == YYFINAL)
1483     YYACCEPT;
1484    
1485     YYDPRINTF ((stderr, "Shifting error token, "));
1486    
1487     *++yyvsp = yylval;
1488    
1489    
1490     yystate = yyn;
1491     goto yynewstate;
1492    
1493    
1494     /*-------------------------------------.
1495     | yyacceptlab -- YYACCEPT comes here. |
1496     `-------------------------------------*/
1497     yyacceptlab:
1498     yyresult = 0;
1499     goto yyreturn;
1500    
1501     /*-----------------------------------.
1502     | yyabortlab -- YYABORT comes here. |
1503     `-----------------------------------*/
1504     yyabortlab:
1505     yyresult = 1;
1506     goto yyreturn;
1507    
1508     #ifndef yyoverflow
1509     /*----------------------------------------------.
1510     | yyoverflowlab -- parser overflow comes here. |
1511     `----------------------------------------------*/
1512     yyoverflowlab:
1513     yyerror ("parser stack overflow");
1514     yyresult = 2;
1515     /* Fall through. */
1516     #endif
1517    
1518     yyreturn:
1519     #ifndef yyoverflow
1520     if (yyss != yyssa)
1521     YYSTACK_FREE (yyss);
1522     #endif
1523     return yyresult;
1524     }
1525    
1526    
1527     #line 80 "BASSyacc.y"
1528    
1529    
1530     extern int yyerror( char *err_msg ){
1531    
1532     sprintf( painCave.errMsg, "OOPSE parse error in %s at line %d: %s\n",
1533     yyfile_name->my_name, yylineno + 1, err_msg );
1534     painCave.isFatal = 1;
1535     simError();
1536     return 0;
1537     }
1538    
1539     void yacc_BASS( char* file_name ){
1540    
1541     FILE* in_file;
1542    
1543     head_node = (struct node_tag* )malloc( sizeof( node ) );
1544    
1545     head_node->type = GLOBAL_HEAD;
1546     head_node->index =0;
1547     head_node->next_stmt = NULL;
1548     head_node->prev_stmt = NULL;
1549     head_node->stmt_list = NULL;
1550    
1551     current_node = head_node;
1552    
1553     in_file = fopen( file_name, "r" );
1554     if( in_file == NULL ){
1555     sprintf( painCave.errMsg, "yacc error: couldn't open file =>%s\n",
1556     file_name );
1557     painCave.isFatal = 1;
1558     simError();
1559     }
1560    
1561     yyfile_name =
1562     (struct filename_list*)malloc( sizeof( struct filename_list ) );
1563     yyfile_name->next = NULL;
1564     strcpy( yyfile_name->my_name, file_name );
1565     change_in_file( in_file );
1566    
1567     yyparse();
1568    
1569     #ifdef IS_MPI
1570     strcpy( checkPointMsg, "yyParse successful." );
1571     MPIcheckPoint();
1572     painCave.isEventLoop = 1;
1573     #endif // is_mpi
1574    
1575     fclose( in_file );
1576     kill_lists();
1577    
1578     pt_me( head_node );
1579    
1580     #ifdef IS_MPI
1581     painCave.isEventLoop = 0;
1582     #endif // is_mpi
1583    
1584     kill_tree( head_node );
1585     head_node = NULL;
1586     }
1587