OpenMD 3.1
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
MDTreeParser.cpp
1/* $ANTLR 2.7.7 (20191228): "MDTreeParser.g" -> "MDTreeParser.cpp"$ */
2#include "MDTreeParser.hpp"
3#include <antlr/Token.hpp>
4#include <antlr/AST.hpp>
5#include <antlr/NoViableAltException.hpp>
6#include <antlr/MismatchedTokenException.hpp>
7#include <antlr/SemanticException.hpp>
8#include <antlr/BitSet.hpp>
9#line 1 "MDTreeParser.g"
10#line 11 "MDTreeParser.cpp"
11MDTreeParser::MDTreeParser()
12 : ANTLR_USE_NAMESPACE(antlr)TreeParser() {
13}
14
15void MDTreeParser::mdfile(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
16 ANTLR_USE_NAMESPACE(antlr)RefAST mdfile_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
17
18 try { // for error handling
19 { // ( ... )*
20 for (;;) {
21 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
22 _t = ASTNULL;
23 if ((_tokenSet_0.member(_t->getType()))) {
24 statement(_t);
25 _t = _retTree;
26 }
27 else {
28 goto _loop3;
29 }
30
31 }
32 _loop3:;
33 } // ( ... )*
34#line 34 "MDTreeParser.g"
35 blockStack.top()->validate(); blockStack.pop();
36#line 37 "MDTreeParser.cpp"
37 }
38 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
39 reportError(ex);
40 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
41 _t = _t->getNextSibling();
42 }
43 _retTree = _t;
44}
45
46void MDTreeParser::statement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
47 ANTLR_USE_NAMESPACE(antlr)RefAST statement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
48
49 try { // for error handling
50 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
51 _t = ASTNULL;
52 switch ( _t->getType()) {
53 case ASSIGNEQUAL:
54 {
55 assignment(_t);
56 _t = _retTree;
57 break;
58 }
59 case COMPONENT:
60 {
61 componentblock(_t);
62 _t = _retTree;
63 break;
64 }
65 case MOLECULE:
66 {
67 moleculeblock(_t);
68 _t = _retTree;
69 break;
70 }
71 case ZCONSTRAINT:
72 {
73 zconstraintblock(_t);
74 _t = _retTree;
75 break;
76 }
77 case RESTRAINT:
78 {
79 restraintblock(_t);
80 _t = _retTree;
81 break;
82 }
83 case FLUCQ:
84 {
85 flucqblock(_t);
86 _t = _retTree;
87 break;
88 }
89 case RNEMD:
90 {
91 rnemdblock(_t);
92 _t = _retTree;
93 break;
94 }
95 case MINIMIZER:
96 {
97 minimizerblock(_t);
98 _t = _retTree;
99 break;
100 }
101 default:
102 {
103 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
104 }
105 }
106 }
107 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
108 reportError(ex);
109 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
110 _t = _t->getNextSibling();
111 }
112 _retTree = _t;
113}
114
115void MDTreeParser::assignment(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
116 ANTLR_USE_NAMESPACE(antlr)RefAST assignment_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
117 ANTLR_USE_NAMESPACE(antlr)RefAST id = ANTLR_USE_NAMESPACE(antlr)nullAST;
118
119 try { // for error handling
120 ANTLR_USE_NAMESPACE(antlr)RefAST __t6 = _t;
121 ANTLR_USE_NAMESPACE(antlr)RefAST tmp1_AST_in = _t;
122 match(_t,ASSIGNEQUAL);
123 _t = _t->getFirstChild();
124 id = _t;
125 match(_t,ID);
126 _t = _t->getNextSibling();
127 constant(_t,id);
128 _t = _retTree;
129 _t = __t6;
130 _t = _t->getNextSibling();
131 }
132 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
133 reportError(ex);
134 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
135 _t = _t->getNextSibling();
136 }
137 _retTree = _t;
138}
139
140void MDTreeParser::componentblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
141 ANTLR_USE_NAMESPACE(antlr)RefAST componentblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
142
143 try { // for error handling
144 ANTLR_USE_NAMESPACE(antlr)RefAST __t10 = _t;
145 ANTLR_USE_NAMESPACE(antlr)RefAST tmp2_AST_in = _t;
146 match(_t,COMPONENT);
147 _t = _t->getFirstChild();
148#line 70 "MDTreeParser.g"
149 Component* currComponet = new Component(); blockStack.push(currComponet);
150#line 151 "MDTreeParser.cpp"
151 { // ( ... )*
152 for (;;) {
153 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
154 _t = ASTNULL;
155 if ((_t->getType() == ASSIGNEQUAL)) {
156 assignment(_t);
157 _t = _retTree;
158 }
159 else {
160 goto _loop12;
161 }
162
163 }
164 _loop12:;
165 } // ( ... )*
166 ANTLR_USE_NAMESPACE(antlr)RefAST tmp3_AST_in = _t;
167 match(_t,ENDBLOCK);
168 _t = _t->getNextSibling();
169 _t = __t10;
170 _t = _t->getNextSibling();
171#line 72 "MDTreeParser.g"
172 blockStack.top()->validate();blockStack.pop(); currConf->addComponent(currComponet);
173#line 174 "MDTreeParser.cpp"
174 }
175 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
176 reportError(ex);
177 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
178 _t = _t->getNextSibling();
179 }
180 _retTree = _t;
181}
182
183void MDTreeParser::moleculeblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
184 ANTLR_USE_NAMESPACE(antlr)RefAST moleculeblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
185
186 try { // for error handling
187 ANTLR_USE_NAMESPACE(antlr)RefAST __t34 = _t;
188 ANTLR_USE_NAMESPACE(antlr)RefAST tmp4_AST_in = _t;
189 match(_t,MOLECULE);
190 _t = _t->getFirstChild();
191#line 101 "MDTreeParser.g"
192 MoleculeStamp* currMoleculeStamp = new MoleculeStamp(); blockStack.push(currMoleculeStamp);
193#line 194 "MDTreeParser.cpp"
194 { // ( ... )*
195 for (;;) {
196 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
197 _t = ASTNULL;
198 if ((_tokenSet_1.member(_t->getType()))) {
199 moleculestatement(_t);
200 _t = _retTree;
201 }
202 else {
203 goto _loop36;
204 }
205
206 }
207 _loop36:;
208 } // ( ... )*
209 ANTLR_USE_NAMESPACE(antlr)RefAST tmp5_AST_in = _t;
210 match(_t,ENDBLOCK);
211 _t = _t->getNextSibling();
212 _t = __t34;
213 _t = _t->getNextSibling();
214#line 103 "MDTreeParser.g"
215 blockStack.top()->validate(); blockStack.pop(); currConf->addMoleculeStamp(currMoleculeStamp);
216#line 217 "MDTreeParser.cpp"
217 }
218 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
219 reportError(ex);
220 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
221 _t = _t->getNextSibling();
222 }
223 _retTree = _t;
224}
225
226void MDTreeParser::zconstraintblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
227 ANTLR_USE_NAMESPACE(antlr)RefAST zconstraintblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
228
229 try { // for error handling
230 ANTLR_USE_NAMESPACE(antlr)RefAST __t14 = _t;
231 ANTLR_USE_NAMESPACE(antlr)RefAST tmp6_AST_in = _t;
232 match(_t,ZCONSTRAINT);
233 _t = _t->getFirstChild();
234#line 75 "MDTreeParser.g"
235 ZConsStamp* currZConsStamp = new ZConsStamp(); blockStack.push(currZConsStamp);
236#line 237 "MDTreeParser.cpp"
237 { // ( ... )*
238 for (;;) {
239 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
240 _t = ASTNULL;
241 if ((_t->getType() == ASSIGNEQUAL)) {
242 assignment(_t);
243 _t = _retTree;
244 }
245 else {
246 goto _loop16;
247 }
248
249 }
250 _loop16:;
251 } // ( ... )*
252 ANTLR_USE_NAMESPACE(antlr)RefAST tmp7_AST_in = _t;
253 match(_t,ENDBLOCK);
254 _t = _t->getNextSibling();
255 _t = __t14;
256 _t = _t->getNextSibling();
257#line 77 "MDTreeParser.g"
258 blockStack.top()->validate();blockStack.pop(); currConf->addZConsStamp(currZConsStamp);
259#line 260 "MDTreeParser.cpp"
260 }
261 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
262 reportError(ex);
263 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
264 _t = _t->getNextSibling();
265 }
266 _retTree = _t;
267}
268
269void MDTreeParser::restraintblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
270 ANTLR_USE_NAMESPACE(antlr)RefAST restraintblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
271
272 try { // for error handling
273 ANTLR_USE_NAMESPACE(antlr)RefAST __t18 = _t;
274 ANTLR_USE_NAMESPACE(antlr)RefAST tmp8_AST_in = _t;
275 match(_t,RESTRAINT);
276 _t = _t->getFirstChild();
277#line 80 "MDTreeParser.g"
278 RestraintStamp* currRestraintStamp = new RestraintStamp(); blockStack.push(currRestraintStamp);
279#line 280 "MDTreeParser.cpp"
280 { // ( ... )*
281 for (;;) {
282 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
283 _t = ASTNULL;
284 if ((_t->getType() == ASSIGNEQUAL)) {
285 assignment(_t);
286 _t = _retTree;
287 }
288 else {
289 goto _loop20;
290 }
291
292 }
293 _loop20:;
294 } // ( ... )*
295 ANTLR_USE_NAMESPACE(antlr)RefAST tmp9_AST_in = _t;
296 match(_t,ENDBLOCK);
297 _t = _t->getNextSibling();
298 _t = __t18;
299 _t = _t->getNextSibling();
300#line 82 "MDTreeParser.g"
301 blockStack.top()->validate();blockStack.pop(); currConf->addRestraintStamp(currRestraintStamp);
302#line 303 "MDTreeParser.cpp"
303 }
304 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
305 reportError(ex);
306 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
307 _t = _t->getNextSibling();
308 }
309 _retTree = _t;
310}
311
312void MDTreeParser::flucqblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
313 ANTLR_USE_NAMESPACE(antlr)RefAST flucqblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
314
315 try { // for error handling
316 ANTLR_USE_NAMESPACE(antlr)RefAST __t22 = _t;
317 ANTLR_USE_NAMESPACE(antlr)RefAST tmp10_AST_in = _t;
318 match(_t,FLUCQ);
319 _t = _t->getFirstChild();
320#line 85 "MDTreeParser.g"
321 FluctuatingChargeParameters* flucQpars = new FluctuatingChargeParameters(); blockStack.push(flucQpars);
322#line 323 "MDTreeParser.cpp"
323 { // ( ... )*
324 for (;;) {
325 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
326 _t = ASTNULL;
327 if ((_t->getType() == ASSIGNEQUAL)) {
328 assignment(_t);
329 _t = _retTree;
330 }
331 else {
332 goto _loop24;
333 }
334
335 }
336 _loop24:;
337 } // ( ... )*
338 ANTLR_USE_NAMESPACE(antlr)RefAST tmp11_AST_in = _t;
339 match(_t,ENDBLOCK);
340 _t = _t->getNextSibling();
341 _t = __t22;
342 _t = _t->getNextSibling();
343#line 87 "MDTreeParser.g"
344 blockStack.top()->validate();blockStack.pop(); currConf->addFluctuatingChargeParameters(flucQpars);
345#line 346 "MDTreeParser.cpp"
346 }
347 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
348 reportError(ex);
349 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
350 _t = _t->getNextSibling();
351 }
352 _retTree = _t;
353}
354
355void MDTreeParser::rnemdblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
356 ANTLR_USE_NAMESPACE(antlr)RefAST rnemdblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
357
358 try { // for error handling
359 ANTLR_USE_NAMESPACE(antlr)RefAST __t26 = _t;
360 ANTLR_USE_NAMESPACE(antlr)RefAST tmp12_AST_in = _t;
361 match(_t,RNEMD);
362 _t = _t->getFirstChild();
363#line 90 "MDTreeParser.g"
364 RNEMDParameters* rnemdPars = new RNEMDParameters(); blockStack.push(rnemdPars);
365#line 366 "MDTreeParser.cpp"
366 { // ( ... )*
367 for (;;) {
368 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
369 _t = ASTNULL;
370 if ((_t->getType() == ASSIGNEQUAL)) {
371 assignment(_t);
372 _t = _retTree;
373 }
374 else {
375 goto _loop28;
376 }
377
378 }
379 _loop28:;
380 } // ( ... )*
381 ANTLR_USE_NAMESPACE(antlr)RefAST tmp13_AST_in = _t;
382 match(_t,ENDBLOCK);
383 _t = _t->getNextSibling();
384 _t = __t26;
385 _t = _t->getNextSibling();
386#line 92 "MDTreeParser.g"
387 blockStack.top()->validate();blockStack.pop(); currConf->addRNEMDParameters(rnemdPars);
388#line 389 "MDTreeParser.cpp"
389 }
390 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
391 reportError(ex);
392 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
393 _t = _t->getNextSibling();
394 }
395 _retTree = _t;
396}
397
398void MDTreeParser::minimizerblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
399 ANTLR_USE_NAMESPACE(antlr)RefAST minimizerblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
400
401 try { // for error handling
402 ANTLR_USE_NAMESPACE(antlr)RefAST __t30 = _t;
403 ANTLR_USE_NAMESPACE(antlr)RefAST tmp14_AST_in = _t;
404 match(_t,MINIMIZER);
405 _t = _t->getFirstChild();
406#line 95 "MDTreeParser.g"
407 MinimizerParameters* minimizerPars = new MinimizerParameters(); blockStack.push(minimizerPars);
408#line 409 "MDTreeParser.cpp"
409 { // ( ... )*
410 for (;;) {
411 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
412 _t = ASTNULL;
413 if ((_t->getType() == ASSIGNEQUAL)) {
414 assignment(_t);
415 _t = _retTree;
416 }
417 else {
418 goto _loop32;
419 }
420
421 }
422 _loop32:;
423 } // ( ... )*
424 ANTLR_USE_NAMESPACE(antlr)RefAST tmp15_AST_in = _t;
425 match(_t,ENDBLOCK);
426 _t = _t->getNextSibling();
427 _t = __t30;
428 _t = _t->getNextSibling();
429#line 97 "MDTreeParser.g"
430 blockStack.top()->validate();blockStack.pop(); currConf->addMinimizerParameters(minimizerPars);
431#line 432 "MDTreeParser.cpp"
432 }
433 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
434 reportError(ex);
435 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
436 _t = _t->getNextSibling();
437 }
438 _retTree = _t;
439}
440
441void MDTreeParser::constant(ANTLR_USE_NAMESPACE(antlr)RefAST _t,
442 ANTLR_USE_NAMESPACE(antlr)RefAST id
443) {
444 ANTLR_USE_NAMESPACE(antlr)RefAST constant_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
445 ANTLR_USE_NAMESPACE(antlr)RefAST str1 = ANTLR_USE_NAMESPACE(antlr)nullAST;
446 ANTLR_USE_NAMESPACE(antlr)RefAST str2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
447#line 50 "MDTreeParser.g"
448
449 int ival;
450 RealType dval;
451 std::vector<RealType> dvec;
452
453#line 454 "MDTreeParser.cpp"
454
455 try { // for error handling
456 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
457 _t = ASTNULL;
458 switch ( _t->getType()) {
459 case NUM_INT:
460 case NUM_LONG:
461 {
462 ival=intConst(_t);
463 _t = _retTree;
464#line 56 "MDTreeParser.g"
465 blockStack.top()->assign(id->getText(), ival);
466#line 467 "MDTreeParser.cpp"
467 break;
468 }
469 case NUM_FLOAT:
470 case NUM_DOUBLE:
471 {
472 dval=floatConst(_t);
473 _t = _retTree;
474#line 57 "MDTreeParser.g"
475 blockStack.top()->assign(id->getText(), dval);
476#line 477 "MDTreeParser.cpp"
477 break;
478 }
479 case ID:
480 {
481 str1 = _t;
482 match(_t,ID);
483 _t = _t->getNextSibling();
484#line 58 "MDTreeParser.g"
485 blockStack.top()->assign(id->getText(), str1->getText());
486#line 487 "MDTreeParser.cpp"
487 break;
488 }
489 case StringLiteral:
490 {
491 str2 = _t;
492 match(_t,StringLiteral);
493 _t = _t->getNextSibling();
494#line 59 "MDTreeParser.g"
495 std::string s = str2->getText();
496 s = s.substr(1, s.length()-2);
497 blockStack.top()->assign(id->getText(),s);
498
499#line 500 "MDTreeParser.cpp"
500 break;
501 }
502 case LPAREN:
503 {
504 ANTLR_USE_NAMESPACE(antlr)RefAST __t8 = _t;
505 ANTLR_USE_NAMESPACE(antlr)RefAST tmp16_AST_in = _t;
506 match(_t,LPAREN);
507 _t = _t->getFirstChild();
508 dvec=doubleNumberTuple(_t);
509 _t = _retTree;
510 ANTLR_USE_NAMESPACE(antlr)RefAST tmp17_AST_in = _t;
511 match(_t,RPAREN);
512 _t = _t->getNextSibling();
513 _t = __t8;
514 _t = _t->getNextSibling();
515#line 64 "MDTreeParser.g"
516
517 blockStack.top()->assign(id->getText(), dvec);
518
519#line 520 "MDTreeParser.cpp"
520 break;
521 }
522 default:
523 {
524 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
525 }
526 }
527 }
528 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
529 reportError(ex);
530 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
531 _t = _t->getNextSibling();
532 }
533 _retTree = _t;
534}
535
536int MDTreeParser::intConst(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
537#line 349 "MDTreeParser.g"
538 int ival;
539#line 540 "MDTreeParser.cpp"
540 ANTLR_USE_NAMESPACE(antlr)RefAST intConst_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
541 ANTLR_USE_NAMESPACE(antlr)RefAST i1 = ANTLR_USE_NAMESPACE(antlr)nullAST;
542 ANTLR_USE_NAMESPACE(antlr)RefAST i2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
543
544 try { // for error handling
545 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
546 _t = ASTNULL;
547 switch ( _t->getType()) {
548 case NUM_INT:
549 {
550 i1 = _t;
551 match(_t,NUM_INT);
552 _t = _t->getNextSibling();
553#line 350 "MDTreeParser.g"
554 ival = lexi_cast<int>(i1->getText());
555#line 556 "MDTreeParser.cpp"
556 break;
557 }
558 case NUM_LONG:
559 {
560 i2 = _t;
561 match(_t,NUM_LONG);
562 _t = _t->getNextSibling();
563#line 351 "MDTreeParser.g"
564 ival = lexi_cast<int>(i2->getText());
565#line 566 "MDTreeParser.cpp"
566 break;
567 }
568 default:
569 {
570 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
571 }
572 }
573 }
574 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
575 reportError(ex);
576 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
577 _t = _t->getNextSibling();
578 }
579 _retTree = _t;
580 return ival;
581}
582
583RealType MDTreeParser::floatConst(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
584#line 361 "MDTreeParser.g"
585 RealType dval;
586#line 587 "MDTreeParser.cpp"
587 ANTLR_USE_NAMESPACE(antlr)RefAST floatConst_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
588 ANTLR_USE_NAMESPACE(antlr)RefAST d1 = ANTLR_USE_NAMESPACE(antlr)nullAST;
589 ANTLR_USE_NAMESPACE(antlr)RefAST d2 = ANTLR_USE_NAMESPACE(antlr)nullAST;
590
591 try { // for error handling
592 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
593 _t = ASTNULL;
594 switch ( _t->getType()) {
595 case NUM_FLOAT:
596 {
597 d1 = _t;
598 match(_t,NUM_FLOAT);
599 _t = _t->getNextSibling();
600#line 362 "MDTreeParser.g"
601 dval = lexi_cast<RealType>(d1->getText());
602#line 603 "MDTreeParser.cpp"
603 break;
604 }
605 case NUM_DOUBLE:
606 {
607 d2 = _t;
608 match(_t,NUM_DOUBLE);
609 _t = _t->getNextSibling();
610#line 363 "MDTreeParser.g"
611 dval = lexi_cast<RealType>(d2->getText());
612#line 613 "MDTreeParser.cpp"
613 break;
614 }
615 default:
616 {
617 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
618 }
619 }
620 }
621 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
622 reportError(ex);
623 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
624 _t = _t->getNextSibling();
625 }
626 _retTree = _t;
627 return dval;
628}
629
630vector<RealType> MDTreeParser::doubleNumberTuple(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
631#line 333 "MDTreeParser.g"
632 vector<RealType> dvec;
633#line 634 "MDTreeParser.cpp"
634 ANTLR_USE_NAMESPACE(antlr)RefAST doubleNumberTuple_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
635#line 333 "MDTreeParser.g"
636
637 RealType dval;
638
639#line 640 "MDTreeParser.cpp"
640
641 try { // for error handling
642 { // ( ... )+
643 int _cnt122=0;
644 for (;;) {
645 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
646 _t = ASTNULL;
647 if (((_t->getType() >= NUM_INT && _t->getType() <= NUM_DOUBLE))) {
648 dval=doubleNumber(_t);
649 _t = _retTree;
650#line 337 "MDTreeParser.g"
651 dvec.push_back(dval);
652#line 653 "MDTreeParser.cpp"
653 }
654 else {
655 if ( _cnt122>=1 ) { goto _loop122; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
656 }
657
658 _cnt122++;
659 }
660 _loop122:;
661 } // ( ... )+
662 }
663 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
664 reportError(ex);
665 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
666 _t = _t->getNextSibling();
667 }
668 _retTree = _t;
669 return dvec;
670}
671
672void MDTreeParser::moleculestatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
673 ANTLR_USE_NAMESPACE(antlr)RefAST moleculestatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
674
675 try { // for error handling
676 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
677 _t = ASTNULL;
678 switch ( _t->getType()) {
679 case ASSIGNEQUAL:
680 {
681 assignment(_t);
682 _t = _retTree;
683 break;
684 }
685 case ATOM:
686 {
687 atomblock(_t);
688 _t = _retTree;
689 break;
690 }
691 case BOND:
692 {
693 bondblock(_t);
694 _t = _retTree;
695 break;
696 }
697 case BEND:
698 {
699 bendblock(_t);
700 _t = _retTree;
701 break;
702 }
703 case TORSION:
704 {
705 torsionblock(_t);
706 _t = _retTree;
707 break;
708 }
709 case INVERSION:
710 {
711 inversionblock(_t);
712 _t = _retTree;
713 break;
714 }
715 case RIGIDBODY:
716 {
717 rigidbodyblock(_t);
718 _t = _retTree;
719 break;
720 }
721 case CUTOFFGROUP:
722 {
723 cutoffgroupblock(_t);
724 _t = _retTree;
725 break;
726 }
727 case FRAGMENT:
728 {
729 fragmentblock(_t);
730 _t = _retTree;
731 break;
732 }
733 case CONSTRAINT:
734 {
735 constraintblock(_t);
736 _t = _retTree;
737 break;
738 }
739 default:
740 {
741 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
742 }
743 }
744 }
745 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
746 reportError(ex);
747 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
748 _t = _t->getNextSibling();
749 }
750 _retTree = _t;
751}
752
753void MDTreeParser::atomblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
754 ANTLR_USE_NAMESPACE(antlr)RefAST atomblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
755#line 118 "MDTreeParser.g"
756
757 int index;
758
759#line 760 "MDTreeParser.cpp"
760
761 try { // for error handling
762 ANTLR_USE_NAMESPACE(antlr)RefAST __t39 = _t;
763 ANTLR_USE_NAMESPACE(antlr)RefAST tmp18_AST_in = _t;
764 match(_t,ATOM);
765 _t = _t->getFirstChild();
766 index=intConst(_t);
767 _t = _retTree;
768#line 122 "MDTreeParser.g"
769 AtomStamp* currAtomStamp = new AtomStamp(index); blockStack.push(currAtomStamp);
770#line 771 "MDTreeParser.cpp"
771 { // ( ... )*
772 for (;;) {
773 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
774 _t = ASTNULL;
775 if ((_tokenSet_2.member(_t->getType()))) {
776 atomstatement(_t);
777 _t = _retTree;
778 }
779 else {
780 goto _loop41;
781 }
782
783 }
784 _loop41:;
785 } // ( ... )*
786 ANTLR_USE_NAMESPACE(antlr)RefAST tmp19_AST_in = _t;
787 match(_t,ENDBLOCK);
788 _t = _t->getNextSibling();
789 _t = __t39;
790 _t = _t->getNextSibling();
791#line 124 "MDTreeParser.g"
792
793 blockStack.top()->validate();
794 blockStack.pop();
795 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
796 currMoleculeStamp->addAtomStamp(currAtomStamp);
797
798#line 799 "MDTreeParser.cpp"
799 }
800 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
801 reportError(ex);
802 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
803 _t = _t->getNextSibling();
804 }
805 _retTree = _t;
806}
807
808void MDTreeParser::bondblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
809 ANTLR_USE_NAMESPACE(antlr)RefAST bondblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
810
811 try { // for error handling
812 ANTLR_USE_NAMESPACE(antlr)RefAST __t47 = _t;
813 ANTLR_USE_NAMESPACE(antlr)RefAST tmp20_AST_in = _t;
814 match(_t,BOND);
815 _t = _t->getFirstChild();
816#line 147 "MDTreeParser.g"
817 BondStamp* currBondStamp = new BondStamp(); blockStack.push(currBondStamp);
818#line 819 "MDTreeParser.cpp"
819 { // ( ... )*
820 for (;;) {
821 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
822 _t = ASTNULL;
823 if ((_tokenSet_3.member(_t->getType()))) {
824 bondstatement(_t);
825 _t = _retTree;
826 }
827 else {
828 goto _loop49;
829 }
830
831 }
832 _loop49:;
833 } // ( ... )*
834 ANTLR_USE_NAMESPACE(antlr)RefAST tmp21_AST_in = _t;
835 match(_t,ENDBLOCK);
836 _t = _t->getNextSibling();
837 _t = __t47;
838 _t = _t->getNextSibling();
839#line 149 "MDTreeParser.g"
840
841 blockStack.top()->validate();
842 blockStack.pop();
843 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
844 currMoleculeStamp->addBondStamp(currBondStamp);
845
846#line 847 "MDTreeParser.cpp"
847 }
848 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
849 reportError(ex);
850 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
851 _t = _t->getNextSibling();
852 }
853 _retTree = _t;
854}
855
856void MDTreeParser::bendblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
857 ANTLR_USE_NAMESPACE(antlr)RefAST bendblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
858
859 try { // for error handling
860 ANTLR_USE_NAMESPACE(antlr)RefAST __t59 = _t;
861 ANTLR_USE_NAMESPACE(antlr)RefAST tmp22_AST_in = _t;
862 match(_t,BEND);
863 _t = _t->getFirstChild();
864#line 174 "MDTreeParser.g"
865 BendStamp* currBendStamp = new BendStamp(); blockStack.push(currBendStamp);
866#line 867 "MDTreeParser.cpp"
867 { // ( ... )*
868 for (;;) {
869 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
870 _t = ASTNULL;
871 if ((_tokenSet_4.member(_t->getType()))) {
872 bendstatement(_t);
873 _t = _retTree;
874 }
875 else {
876 goto _loop61;
877 }
878
879 }
880 _loop61:;
881 } // ( ... )*
882 ANTLR_USE_NAMESPACE(antlr)RefAST tmp23_AST_in = _t;
883 match(_t,ENDBLOCK);
884 _t = _t->getNextSibling();
885 _t = __t59;
886 _t = _t->getNextSibling();
887#line 176 "MDTreeParser.g"
888
889 blockStack.top()->validate();
890 blockStack.pop();
891 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
892 currMoleculeStamp->addBendStamp(currBendStamp);
893
894#line 895 "MDTreeParser.cpp"
895 }
896 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
897 reportError(ex);
898 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
899 _t = _t->getNextSibling();
900 }
901 _retTree = _t;
902}
903
904void MDTreeParser::torsionblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
905 ANTLR_USE_NAMESPACE(antlr)RefAST torsionblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
906
907 try { // for error handling
908 ANTLR_USE_NAMESPACE(antlr)RefAST __t72 = _t;
909 ANTLR_USE_NAMESPACE(antlr)RefAST tmp24_AST_in = _t;
910 match(_t,TORSION);
911 _t = _t->getFirstChild();
912#line 201 "MDTreeParser.g"
913 TorsionStamp* currTorsionStamp = new TorsionStamp(); blockStack.push(currTorsionStamp);
914#line 915 "MDTreeParser.cpp"
915 { // ( ... )*
916 for (;;) {
917 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
918 _t = ASTNULL;
919 if ((_tokenSet_5.member(_t->getType()))) {
920 torsionstatement(_t);
921 _t = _retTree;
922 }
923 else {
924 goto _loop74;
925 }
926
927 }
928 _loop74:;
929 } // ( ... )*
930 ANTLR_USE_NAMESPACE(antlr)RefAST tmp25_AST_in = _t;
931 match(_t,ENDBLOCK);
932 _t = _t->getNextSibling();
933 _t = __t72;
934 _t = _t->getNextSibling();
935#line 203 "MDTreeParser.g"
936
937 blockStack.top()->validate();
938 blockStack.pop();
939 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
940 currMoleculeStamp->addTorsionStamp(currTorsionStamp);
941
942#line 943 "MDTreeParser.cpp"
943 }
944 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
945 reportError(ex);
946 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
947 _t = _t->getNextSibling();
948 }
949 _retTree = _t;
950}
951
952void MDTreeParser::inversionblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
953 ANTLR_USE_NAMESPACE(antlr)RefAST inversionblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
954
955 try { // for error handling
956 ANTLR_USE_NAMESPACE(antlr)RefAST __t86 = _t;
957 ANTLR_USE_NAMESPACE(antlr)RefAST tmp26_AST_in = _t;
958 match(_t,INVERSION);
959 _t = _t->getFirstChild();
960#line 230 "MDTreeParser.g"
961 InversionStamp* currInversionStamp = new InversionStamp(); blockStack.push(currInversionStamp);
962#line 963 "MDTreeParser.cpp"
963 { // ( ... )*
964 for (;;) {
965 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
966 _t = ASTNULL;
967 if ((_tokenSet_6.member(_t->getType()))) {
968 inversionstatement(_t);
969 _t = _retTree;
970 }
971 else {
972 goto _loop88;
973 }
974
975 }
976 _loop88:;
977 } // ( ... )*
978 ANTLR_USE_NAMESPACE(antlr)RefAST tmp27_AST_in = _t;
979 match(_t,ENDBLOCK);
980 _t = _t->getNextSibling();
981 _t = __t86;
982 _t = _t->getNextSibling();
983#line 232 "MDTreeParser.g"
984
985 blockStack.top()->validate();
986 blockStack.pop();
987 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
988 currMoleculeStamp->addInversionStamp(currInversionStamp);
989
990#line 991 "MDTreeParser.cpp"
991 }
992 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
993 reportError(ex);
994 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
995 _t = _t->getNextSibling();
996 }
997 _retTree = _t;
998}
999
1000void MDTreeParser::rigidbodyblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1001 ANTLR_USE_NAMESPACE(antlr)RefAST rigidbodyblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1002#line 258 "MDTreeParser.g"
1003
1004 int index;
1005
1006#line 1007 "MDTreeParser.cpp"
1007
1008 try { // for error handling
1009 ANTLR_USE_NAMESPACE(antlr)RefAST __t98 = _t;
1010 ANTLR_USE_NAMESPACE(antlr)RefAST tmp28_AST_in = _t;
1011 match(_t,RIGIDBODY);
1012 _t = _t->getFirstChild();
1013 index=intConst(_t);
1014 _t = _retTree;
1015#line 262 "MDTreeParser.g"
1016 RigidBodyStamp* currRigidBodyStamp = new RigidBodyStamp(index); blockStack.push(currRigidBodyStamp);
1017#line 1018 "MDTreeParser.cpp"
1018 { // ( ... )*
1019 for (;;) {
1020 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1021 _t = ASTNULL;
1022 if ((_t->getType() == MEMBERS || _t->getType() == ASSIGNEQUAL)) {
1023 rigidbodystatement(_t);
1024 _t = _retTree;
1025 }
1026 else {
1027 goto _loop100;
1028 }
1029
1030 }
1031 _loop100:;
1032 } // ( ... )*
1033 ANTLR_USE_NAMESPACE(antlr)RefAST tmp29_AST_in = _t;
1034 match(_t,ENDBLOCK);
1035 _t = _t->getNextSibling();
1036 _t = __t98;
1037 _t = _t->getNextSibling();
1038#line 264 "MDTreeParser.g"
1039
1040 blockStack.top()->validate();
1041 blockStack.pop();
1042 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
1043 currMoleculeStamp->addRigidBodyStamp(currRigidBodyStamp);
1044
1045#line 1046 "MDTreeParser.cpp"
1046 }
1047 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1048 reportError(ex);
1049 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1050 _t = _t->getNextSibling();
1051 }
1052 _retTree = _t;
1053}
1054
1055void MDTreeParser::cutoffgroupblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1056 ANTLR_USE_NAMESPACE(antlr)RefAST cutoffgroupblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1057
1058 try { // for error handling
1059 ANTLR_USE_NAMESPACE(antlr)RefAST __t104 = _t;
1060 ANTLR_USE_NAMESPACE(antlr)RefAST tmp30_AST_in = _t;
1061 match(_t,CUTOFFGROUP);
1062 _t = _t->getFirstChild();
1063#line 281 "MDTreeParser.g"
1064 CutoffGroupStamp* currCutoffGroupStamp = new CutoffGroupStamp(); blockStack.push(currCutoffGroupStamp);
1065#line 1066 "MDTreeParser.cpp"
1066 { // ( ... )*
1067 for (;;) {
1068 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1069 _t = ASTNULL;
1070 if ((_t->getType() == MEMBERS || _t->getType() == ASSIGNEQUAL)) {
1071 cutoffgroupstatement(_t);
1072 _t = _retTree;
1073 }
1074 else {
1075 goto _loop106;
1076 }
1077
1078 }
1079 _loop106:;
1080 } // ( ... )*
1081 ANTLR_USE_NAMESPACE(antlr)RefAST tmp31_AST_in = _t;
1082 match(_t,ENDBLOCK);
1083 _t = _t->getNextSibling();
1084 _t = __t104;
1085 _t = _t->getNextSibling();
1086#line 283 "MDTreeParser.g"
1087
1088 blockStack.top()->validate();
1089 blockStack.pop();
1090 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
1091 currMoleculeStamp->addCutoffGroupStamp(currCutoffGroupStamp);
1092
1093#line 1094 "MDTreeParser.cpp"
1094 }
1095 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1096 reportError(ex);
1097 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1098 _t = _t->getNextSibling();
1099 }
1100 _retTree = _t;
1101}
1102
1103void MDTreeParser::fragmentblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1104 ANTLR_USE_NAMESPACE(antlr)RefAST fragmentblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1105#line 300 "MDTreeParser.g"
1106 int ival;
1107#line 1108 "MDTreeParser.cpp"
1108
1109 try { // for error handling
1110 ANTLR_USE_NAMESPACE(antlr)RefAST __t110 = _t;
1111 ANTLR_USE_NAMESPACE(antlr)RefAST tmp32_AST_in = _t;
1112 match(_t,FRAGMENT);
1113 _t = _t->getFirstChild();
1114 ival=intConst(_t);
1115 _t = _retTree;
1116#line 301 "MDTreeParser.g"
1117 FragmentStamp* currFragmentStamp = new FragmentStamp(ival); blockStack.push(currFragmentStamp);
1118#line 1119 "MDTreeParser.cpp"
1119 { // ( ... )*
1120 for (;;) {
1121 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1122 _t = ASTNULL;
1123 if ((_t->getType() == ASSIGNEQUAL)) {
1124 fragmentstatement(_t);
1125 _t = _retTree;
1126 }
1127 else {
1128 goto _loop112;
1129 }
1130
1131 }
1132 _loop112:;
1133 } // ( ... )*
1134 ANTLR_USE_NAMESPACE(antlr)RefAST tmp33_AST_in = _t;
1135 match(_t,ENDBLOCK);
1136 _t = _t->getNextSibling();
1137 _t = __t110;
1138 _t = _t->getNextSibling();
1139#line 303 "MDTreeParser.g"
1140
1141 blockStack.top()->validate();
1142 blockStack.pop();
1143 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
1144 currMoleculeStamp->addFragmentStamp(currFragmentStamp);
1145
1146#line 1147 "MDTreeParser.cpp"
1147 }
1148 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1149 reportError(ex);
1150 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1151 _t = _t->getNextSibling();
1152 }
1153 _retTree = _t;
1154}
1155
1156void MDTreeParser::constraintblock(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1157 ANTLR_USE_NAMESPACE(antlr)RefAST constraintblock_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1158
1159 try { // for error handling
1160 ANTLR_USE_NAMESPACE(antlr)RefAST __t115 = _t;
1161 ANTLR_USE_NAMESPACE(antlr)RefAST tmp34_AST_in = _t;
1162 match(_t,CONSTRAINT);
1163 _t = _t->getFirstChild();
1164#line 314 "MDTreeParser.g"
1165 ConstraintStamp* currConstraintStamp = new ConstraintStamp(); blockStack.push(currConstraintStamp);
1166#line 1167 "MDTreeParser.cpp"
1167 { // ( ... )*
1168 for (;;) {
1169 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1170 _t = ASTNULL;
1171 if ((_t->getType() == MEMBERS || _t->getType() == ASSIGNEQUAL)) {
1172 constraintstatement(_t);
1173 _t = _retTree;
1174 }
1175 else {
1176 goto _loop117;
1177 }
1178
1179 }
1180 _loop117:;
1181 } // ( ... )*
1182 ANTLR_USE_NAMESPACE(antlr)RefAST tmp35_AST_in = _t;
1183 match(_t,ENDBLOCK);
1184 _t = _t->getNextSibling();
1185 _t = __t115;
1186 _t = _t->getNextSibling();
1187#line 316 "MDTreeParser.g"
1188
1189 blockStack.pop();
1190 MoleculeStamp* currMoleculeStamp = static_cast<MoleculeStamp*>(blockStack.top());
1191 currMoleculeStamp->addConstraintStamp(currConstraintStamp);
1192
1193#line 1194 "MDTreeParser.cpp"
1194 }
1195 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1196 reportError(ex);
1197 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1198 _t = _t->getNextSibling();
1199 }
1200 _retTree = _t;
1201}
1202
1203void MDTreeParser::atomstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1204 ANTLR_USE_NAMESPACE(antlr)RefAST atomstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1205#line 132 "MDTreeParser.g"
1206
1207 vector<RealType> dvec;
1208 RealType rval;
1209 AtomStamp* currAtomStamp = static_cast<AtomStamp*>(blockStack.top());
1210
1211
1212#line 1213 "MDTreeParser.cpp"
1213
1214 try { // for error handling
1215 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1216 _t = ASTNULL;
1217 switch ( _t->getType()) {
1218 case ASSIGNEQUAL:
1219 {
1220 assignment(_t);
1221 _t = _retTree;
1222 break;
1223 }
1224 case POSITION:
1225 {
1226 ANTLR_USE_NAMESPACE(antlr)RefAST __t43 = _t;
1227 ANTLR_USE_NAMESPACE(antlr)RefAST tmp36_AST_in = _t;
1228 match(_t,POSITION);
1229 _t = _t->getFirstChild();
1230 dvec=doubleNumberTuple(_t);
1231 _t = _retTree;
1232 _t = __t43;
1233 _t = _t->getNextSibling();
1234#line 140 "MDTreeParser.g"
1235 currAtomStamp->setPosition(dvec);
1236#line 1237 "MDTreeParser.cpp"
1237 break;
1238 }
1239 case ORIENTATION:
1240 {
1241 ANTLR_USE_NAMESPACE(antlr)RefAST __t44 = _t;
1242 ANTLR_USE_NAMESPACE(antlr)RefAST tmp37_AST_in = _t;
1243 match(_t,ORIENTATION);
1244 _t = _t->getFirstChild();
1245 dvec=doubleNumberTuple(_t);
1246 _t = _retTree;
1247 _t = __t44;
1248 _t = _t->getNextSibling();
1249#line 141 "MDTreeParser.g"
1250 currAtomStamp->setOrientation(dvec);
1251#line 1252 "MDTreeParser.cpp"
1252 break;
1253 }
1254 case CHARGE:
1255 {
1256 ANTLR_USE_NAMESPACE(antlr)RefAST __t45 = _t;
1257 ANTLR_USE_NAMESPACE(antlr)RefAST tmp38_AST_in = _t;
1258 match(_t,CHARGE);
1259 _t = _t->getFirstChild();
1260 rval=doubleNumber(_t);
1261 _t = _retTree;
1262 _t = __t45;
1263 _t = _t->getNextSibling();
1264#line 142 "MDTreeParser.g"
1265 currAtomStamp->overrideCharge(rval);
1266#line 1267 "MDTreeParser.cpp"
1267 break;
1268 }
1269 default:
1270 {
1271 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
1272 }
1273 }
1274 }
1275 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1276 reportError(ex);
1277 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1278 _t = _t->getNextSibling();
1279 }
1280 _retTree = _t;
1281}
1282
1283RealType MDTreeParser::doubleNumber(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1284#line 355 "MDTreeParser.g"
1285 RealType dval;
1286#line 1287 "MDTreeParser.cpp"
1287 ANTLR_USE_NAMESPACE(antlr)RefAST doubleNumber_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1288 ANTLR_USE_NAMESPACE(antlr)RefAST ic = ANTLR_USE_NAMESPACE(antlr)nullAST;
1289 ANTLR_USE_NAMESPACE(antlr)RefAST fc = ANTLR_USE_NAMESPACE(antlr)nullAST;
1290
1291 try { // for error handling
1292 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1293 _t = ASTNULL;
1294 switch ( _t->getType()) {
1295 case NUM_INT:
1296 case NUM_LONG:
1297 {
1298 ic = (_t == ASTNULL) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1299 intConst(_t);
1300 _t = _retTree;
1301#line 356 "MDTreeParser.g"
1302 dval = lexi_cast<RealType>(ic->getText());
1303#line 1304 "MDTreeParser.cpp"
1304 break;
1305 }
1306 case NUM_FLOAT:
1307 case NUM_DOUBLE:
1308 {
1309 fc = (_t == ASTNULL) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1310 floatConst(_t);
1311 _t = _retTree;
1312#line 357 "MDTreeParser.g"
1313 dval = lexi_cast<RealType>(fc->getText());
1314#line 1315 "MDTreeParser.cpp"
1315 break;
1316 }
1317 default:
1318 {
1319 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
1320 }
1321 }
1322 }
1323 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1324 reportError(ex);
1325 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1326 _t = _t->getNextSibling();
1327 }
1328 _retTree = _t;
1329 return dval;
1330}
1331
1332void MDTreeParser::bondstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1333 ANTLR_USE_NAMESPACE(antlr)RefAST bondstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1334#line 157 "MDTreeParser.g"
1335
1336 vector<int> ivec;
1337 RealType rval;
1338 vector<RealType> dvec;
1339 BondStamp* currBondStamp = static_cast<BondStamp*>(blockStack.top());
1340
1341#line 1342 "MDTreeParser.cpp"
1342
1343 try { // for error handling
1344 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1345 _t = ASTNULL;
1346 switch ( _t->getType()) {
1347 case ASSIGNEQUAL:
1348 {
1349 assignment(_t);
1350 _t = _retTree;
1351 break;
1352 }
1353 case MEMBERS:
1354 {
1355 ANTLR_USE_NAMESPACE(antlr)RefAST __t51 = _t;
1356 ANTLR_USE_NAMESPACE(antlr)RefAST tmp39_AST_in = _t;
1357 match(_t,MEMBERS);
1358 _t = _t->getFirstChild();
1359 ivec=inttuple(_t);
1360 _t = _retTree;
1361 _t = __t51;
1362 _t = _t->getNextSibling();
1363#line 165 "MDTreeParser.g"
1364 currBondStamp->setMembers(ivec);
1365#line 1366 "MDTreeParser.cpp"
1366 break;
1367 }
1368 case FIXED:
1369 {
1370 ANTLR_USE_NAMESPACE(antlr)RefAST __t52 = _t;
1371 ANTLR_USE_NAMESPACE(antlr)RefAST tmp40_AST_in = _t;
1372 match(_t,FIXED);
1373 _t = _t->getFirstChild();
1374 rval=doubleNumber(_t);
1375 _t = _retTree;
1376 _t = __t52;
1377 _t = _t->getNextSibling();
1378#line 166 "MDTreeParser.g"
1379 currBondStamp->overrideType("Fixed", rval);
1380#line 1381 "MDTreeParser.cpp"
1381 break;
1382 }
1383 case HARMONIC:
1384 {
1385 ANTLR_USE_NAMESPACE(antlr)RefAST __t53 = _t;
1386 ANTLR_USE_NAMESPACE(antlr)RefAST tmp41_AST_in = _t;
1387 match(_t,HARMONIC);
1388 _t = _t->getFirstChild();
1389 dvec=doubleNumberTuple(_t);
1390 _t = _retTree;
1391 _t = __t53;
1392 _t = _t->getNextSibling();
1393#line 167 "MDTreeParser.g"
1394 currBondStamp->overrideType("Harmonic", dvec);
1395#line 1396 "MDTreeParser.cpp"
1396 break;
1397 }
1398 case CUBIC:
1399 {
1400 ANTLR_USE_NAMESPACE(antlr)RefAST __t54 = _t;
1401 ANTLR_USE_NAMESPACE(antlr)RefAST tmp42_AST_in = _t;
1402 match(_t,CUBIC);
1403 _t = _t->getFirstChild();
1404 dvec=doubleNumberTuple(_t);
1405 _t = _retTree;
1406 _t = __t54;
1407 _t = _t->getNextSibling();
1408#line 168 "MDTreeParser.g"
1409 currBondStamp->overrideType("Cubic", dvec);
1410#line 1411 "MDTreeParser.cpp"
1411 break;
1412 }
1413 case QUARTIC:
1414 {
1415 ANTLR_USE_NAMESPACE(antlr)RefAST __t55 = _t;
1416 ANTLR_USE_NAMESPACE(antlr)RefAST tmp43_AST_in = _t;
1417 match(_t,QUARTIC);
1418 _t = _t->getFirstChild();
1419 dvec=doubleNumberTuple(_t);
1420 _t = _retTree;
1421 _t = __t55;
1422 _t = _t->getNextSibling();
1423#line 169 "MDTreeParser.g"
1424 currBondStamp->overrideType("Quartic", dvec);
1425#line 1426 "MDTreeParser.cpp"
1426 break;
1427 }
1428 case POLYNOMIAL:
1429 {
1430 ANTLR_USE_NAMESPACE(antlr)RefAST __t56 = _t;
1431 ANTLR_USE_NAMESPACE(antlr)RefAST tmp44_AST_in = _t;
1432 match(_t,POLYNOMIAL);
1433 _t = _t->getFirstChild();
1434 dvec=doubleNumberTuple(_t);
1435 _t = _retTree;
1436 _t = __t56;
1437 _t = _t->getNextSibling();
1438#line 170 "MDTreeParser.g"
1439 currBondStamp->overrideType("Polynomial", dvec);
1440#line 1441 "MDTreeParser.cpp"
1441 break;
1442 }
1443 case MORSE:
1444 {
1445 ANTLR_USE_NAMESPACE(antlr)RefAST __t57 = _t;
1446 ANTLR_USE_NAMESPACE(antlr)RefAST tmp45_AST_in = _t;
1447 match(_t,MORSE);
1448 _t = _t->getFirstChild();
1449 dvec=doubleNumberTuple(_t);
1450 _t = _retTree;
1451 _t = __t57;
1452 _t = _t->getNextSibling();
1453#line 171 "MDTreeParser.g"
1454 currBondStamp->overrideType("Morse", dvec);
1455#line 1456 "MDTreeParser.cpp"
1456 break;
1457 }
1458 default:
1459 {
1460 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
1461 }
1462 }
1463 }
1464 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1465 reportError(ex);
1466 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1467 _t = _t->getNextSibling();
1468 }
1469 _retTree = _t;
1470}
1471
1472vector<int> MDTreeParser::inttuple(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1473#line 341 "MDTreeParser.g"
1474 vector<int> ivec;
1475#line 1476 "MDTreeParser.cpp"
1476 ANTLR_USE_NAMESPACE(antlr)RefAST inttuple_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1477#line 341 "MDTreeParser.g"
1478
1479 int ival;
1480
1481#line 1482 "MDTreeParser.cpp"
1482
1483 try { // for error handling
1484 { // ( ... )+
1485 int _cnt125=0;
1486 for (;;) {
1487 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1488 _t = ASTNULL;
1489 if ((_t->getType() == NUM_INT || _t->getType() == NUM_LONG)) {
1490 ival=intConst(_t);
1491 _t = _retTree;
1492#line 345 "MDTreeParser.g"
1493 ivec.push_back(ival);
1494#line 1495 "MDTreeParser.cpp"
1495 }
1496 else {
1497 if ( _cnt125>=1 ) { goto _loop125; } else {throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);}
1498 }
1499
1500 _cnt125++;
1501 }
1502 _loop125:;
1503 } // ( ... )+
1504 }
1505 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1506 reportError(ex);
1507 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1508 _t = _t->getNextSibling();
1509 }
1510 _retTree = _t;
1511 return ivec;
1512}
1513
1514void MDTreeParser::bendstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1515 ANTLR_USE_NAMESPACE(antlr)RefAST bendstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1516#line 184 "MDTreeParser.g"
1517
1518 vector<int> ivec;
1519 vector<RealType> dvec;
1520 BendStamp* currBendStamp = static_cast<BendStamp*>(blockStack.top());
1521
1522#line 1523 "MDTreeParser.cpp"
1523
1524 try { // for error handling
1525 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1526 _t = ASTNULL;
1527 switch ( _t->getType()) {
1528 case ASSIGNEQUAL:
1529 {
1530 assignment(_t);
1531 _t = _retTree;
1532 break;
1533 }
1534 case MEMBERS:
1535 {
1536 ANTLR_USE_NAMESPACE(antlr)RefAST __t63 = _t;
1537 ANTLR_USE_NAMESPACE(antlr)RefAST tmp46_AST_in = _t;
1538 match(_t,MEMBERS);
1539 _t = _t->getFirstChild();
1540 ivec=inttuple(_t);
1541 _t = _retTree;
1542 _t = __t63;
1543 _t = _t->getNextSibling();
1544#line 191 "MDTreeParser.g"
1545 currBendStamp->setMembers(ivec);
1546#line 1547 "MDTreeParser.cpp"
1547 break;
1548 }
1549 case HARMONIC:
1550 {
1551 ANTLR_USE_NAMESPACE(antlr)RefAST __t64 = _t;
1552 ANTLR_USE_NAMESPACE(antlr)RefAST tmp47_AST_in = _t;
1553 match(_t,HARMONIC);
1554 _t = _t->getFirstChild();
1555 dvec=doubleNumberTuple(_t);
1556 _t = _retTree;
1557 _t = __t64;
1558 _t = _t->getNextSibling();
1559#line 192 "MDTreeParser.g"
1560 currBendStamp->overrideType("Harmonic", dvec);
1561#line 1562 "MDTreeParser.cpp"
1562 break;
1563 }
1564 case GHOSTBEND:
1565 {
1566 ANTLR_USE_NAMESPACE(antlr)RefAST __t65 = _t;
1567 ANTLR_USE_NAMESPACE(antlr)RefAST tmp48_AST_in = _t;
1568 match(_t,GHOSTBEND);
1569 _t = _t->getFirstChild();
1570 dvec=doubleNumberTuple(_t);
1571 _t = _retTree;
1572 _t = __t65;
1573 _t = _t->getNextSibling();
1574#line 193 "MDTreeParser.g"
1575 currBendStamp->overrideType("GhostBend", dvec);
1576#line 1577 "MDTreeParser.cpp"
1577 break;
1578 }
1579 case UREYBRADLEY:
1580 {
1581 ANTLR_USE_NAMESPACE(antlr)RefAST __t66 = _t;
1582 ANTLR_USE_NAMESPACE(antlr)RefAST tmp49_AST_in = _t;
1583 match(_t,UREYBRADLEY);
1584 _t = _t->getFirstChild();
1585 dvec=doubleNumberTuple(_t);
1586 _t = _retTree;
1587 _t = __t66;
1588 _t = _t->getNextSibling();
1589#line 194 "MDTreeParser.g"
1590 currBendStamp->overrideType("UreyBradley", dvec);
1591#line 1592 "MDTreeParser.cpp"
1592 break;
1593 }
1594 case CUBIC:
1595 {
1596 ANTLR_USE_NAMESPACE(antlr)RefAST __t67 = _t;
1597 ANTLR_USE_NAMESPACE(antlr)RefAST tmp50_AST_in = _t;
1598 match(_t,CUBIC);
1599 _t = _t->getFirstChild();
1600 dvec=doubleNumberTuple(_t);
1601 _t = _retTree;
1602 _t = __t67;
1603 _t = _t->getNextSibling();
1604#line 195 "MDTreeParser.g"
1605 currBendStamp->overrideType("Cubic", dvec);
1606#line 1607 "MDTreeParser.cpp"
1607 break;
1608 }
1609 case QUARTIC:
1610 {
1611 ANTLR_USE_NAMESPACE(antlr)RefAST __t68 = _t;
1612 ANTLR_USE_NAMESPACE(antlr)RefAST tmp51_AST_in = _t;
1613 match(_t,QUARTIC);
1614 _t = _t->getFirstChild();
1615 dvec=doubleNumberTuple(_t);
1616 _t = _retTree;
1617 _t = __t68;
1618 _t = _t->getNextSibling();
1619#line 196 "MDTreeParser.g"
1620 currBendStamp->overrideType("Quartic", dvec);
1621#line 1622 "MDTreeParser.cpp"
1622 break;
1623 }
1624 case POLYNOMIAL:
1625 {
1626 ANTLR_USE_NAMESPACE(antlr)RefAST __t69 = _t;
1627 ANTLR_USE_NAMESPACE(antlr)RefAST tmp52_AST_in = _t;
1628 match(_t,POLYNOMIAL);
1629 _t = _t->getFirstChild();
1630 dvec=doubleNumberTuple(_t);
1631 _t = _retTree;
1632 _t = __t69;
1633 _t = _t->getNextSibling();
1634#line 197 "MDTreeParser.g"
1635 currBendStamp->overrideType("Polynomial", dvec);
1636#line 1637 "MDTreeParser.cpp"
1637 break;
1638 }
1639 case COSINE:
1640 {
1641 ANTLR_USE_NAMESPACE(antlr)RefAST __t70 = _t;
1642 ANTLR_USE_NAMESPACE(antlr)RefAST tmp53_AST_in = _t;
1643 match(_t,COSINE);
1644 _t = _t->getFirstChild();
1645 dvec=doubleNumberTuple(_t);
1646 _t = _retTree;
1647 _t = __t70;
1648 _t = _t->getNextSibling();
1649#line 198 "MDTreeParser.g"
1650 currBendStamp->overrideType("Cosine", dvec);
1651#line 1652 "MDTreeParser.cpp"
1652 break;
1653 }
1654 default:
1655 {
1656 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
1657 }
1658 }
1659 }
1660 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1661 reportError(ex);
1662 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1663 _t = _t->getNextSibling();
1664 }
1665 _retTree = _t;
1666}
1667
1668void MDTreeParser::torsionstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1669 ANTLR_USE_NAMESPACE(antlr)RefAST torsionstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1670#line 211 "MDTreeParser.g"
1671
1672 vector<int> ivec;
1673 vector<RealType> dvec;
1674 TorsionStamp* currTorsionStamp = static_cast<TorsionStamp*>(blockStack.top());
1675
1676#line 1677 "MDTreeParser.cpp"
1677
1678 try { // for error handling
1679 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1680 _t = ASTNULL;
1681 switch ( _t->getType()) {
1682 case ASSIGNEQUAL:
1683 {
1684 assignment(_t);
1685 _t = _retTree;
1686 break;
1687 }
1688 case MEMBERS:
1689 {
1690 ANTLR_USE_NAMESPACE(antlr)RefAST __t76 = _t;
1691 ANTLR_USE_NAMESPACE(antlr)RefAST tmp54_AST_in = _t;
1692 match(_t,MEMBERS);
1693 _t = _t->getFirstChild();
1694 ivec=inttuple(_t);
1695 _t = _retTree;
1696 _t = __t76;
1697 _t = _t->getNextSibling();
1698#line 218 "MDTreeParser.g"
1699 currTorsionStamp->setMembers(ivec);
1700#line 1701 "MDTreeParser.cpp"
1701 break;
1702 }
1703 case GHOSTTORSION:
1704 {
1705 ANTLR_USE_NAMESPACE(antlr)RefAST __t77 = _t;
1706 ANTLR_USE_NAMESPACE(antlr)RefAST tmp55_AST_in = _t;
1707 match(_t,GHOSTTORSION);
1708 _t = _t->getFirstChild();
1709 dvec=doubleNumberTuple(_t);
1710 _t = _retTree;
1711 _t = __t77;
1712 _t = _t->getNextSibling();
1713#line 219 "MDTreeParser.g"
1714 currTorsionStamp->overrideType("GhostTorsion", dvec);
1715#line 1716 "MDTreeParser.cpp"
1716 break;
1717 }
1718 case CUBIC:
1719 {
1720 ANTLR_USE_NAMESPACE(antlr)RefAST __t78 = _t;
1721 ANTLR_USE_NAMESPACE(antlr)RefAST tmp56_AST_in = _t;
1722 match(_t,CUBIC);
1723 _t = _t->getFirstChild();
1724 dvec=doubleNumberTuple(_t);
1725 _t = _retTree;
1726 _t = __t78;
1727 _t = _t->getNextSibling();
1728#line 220 "MDTreeParser.g"
1729 currTorsionStamp->overrideType("Cubic", dvec);
1730#line 1731 "MDTreeParser.cpp"
1731 break;
1732 }
1733 case QUARTIC:
1734 {
1735 ANTLR_USE_NAMESPACE(antlr)RefAST __t79 = _t;
1736 ANTLR_USE_NAMESPACE(antlr)RefAST tmp57_AST_in = _t;
1737 match(_t,QUARTIC);
1738 _t = _t->getFirstChild();
1739 dvec=doubleNumberTuple(_t);
1740 _t = _retTree;
1741 _t = __t79;
1742 _t = _t->getNextSibling();
1743#line 221 "MDTreeParser.g"
1744 currTorsionStamp->overrideType("Quartic", dvec);
1745#line 1746 "MDTreeParser.cpp"
1746 break;
1747 }
1748 case POLYNOMIAL:
1749 {
1750 ANTLR_USE_NAMESPACE(antlr)RefAST __t80 = _t;
1751 ANTLR_USE_NAMESPACE(antlr)RefAST tmp58_AST_in = _t;
1752 match(_t,POLYNOMIAL);
1753 _t = _t->getFirstChild();
1754 dvec=doubleNumberTuple(_t);
1755 _t = _retTree;
1756 _t = __t80;
1757 _t = _t->getNextSibling();
1758#line 222 "MDTreeParser.g"
1759 currTorsionStamp->overrideType("Polynomial", dvec);
1760#line 1761 "MDTreeParser.cpp"
1761 break;
1762 }
1763 case CHARMM:
1764 {
1765 ANTLR_USE_NAMESPACE(antlr)RefAST __t81 = _t;
1766 ANTLR_USE_NAMESPACE(antlr)RefAST tmp59_AST_in = _t;
1767 match(_t,CHARMM);
1768 _t = _t->getFirstChild();
1769 dvec=doubleNumberTuple(_t);
1770 _t = _retTree;
1771 _t = __t81;
1772 _t = _t->getNextSibling();
1773#line 223 "MDTreeParser.g"
1774 currTorsionStamp->overrideType("Charmm", dvec);
1775#line 1776 "MDTreeParser.cpp"
1776 break;
1777 }
1778 case OPLS:
1779 {
1780 ANTLR_USE_NAMESPACE(antlr)RefAST __t82 = _t;
1781 ANTLR_USE_NAMESPACE(antlr)RefAST tmp60_AST_in = _t;
1782 match(_t,OPLS);
1783 _t = _t->getFirstChild();
1784 dvec=doubleNumberTuple(_t);
1785 _t = _retTree;
1786 _t = __t82;
1787 _t = _t->getNextSibling();
1788#line 224 "MDTreeParser.g"
1789 currTorsionStamp->overrideType("Opls", dvec);
1790#line 1791 "MDTreeParser.cpp"
1791 break;
1792 }
1793 case TRAPPE:
1794 {
1795 ANTLR_USE_NAMESPACE(antlr)RefAST __t83 = _t;
1796 ANTLR_USE_NAMESPACE(antlr)RefAST tmp61_AST_in = _t;
1797 match(_t,TRAPPE);
1798 _t = _t->getFirstChild();
1799 dvec=doubleNumberTuple(_t);
1800 _t = _retTree;
1801 _t = __t83;
1802 _t = _t->getNextSibling();
1803#line 225 "MDTreeParser.g"
1804 currTorsionStamp->overrideType("Trappe", dvec);
1805#line 1806 "MDTreeParser.cpp"
1806 break;
1807 }
1808 case HARMONIC:
1809 {
1810 ANTLR_USE_NAMESPACE(antlr)RefAST __t84 = _t;
1811 ANTLR_USE_NAMESPACE(antlr)RefAST tmp62_AST_in = _t;
1812 match(_t,HARMONIC);
1813 _t = _t->getFirstChild();
1814 dvec=doubleNumberTuple(_t);
1815 _t = _retTree;
1816 _t = __t84;
1817 _t = _t->getNextSibling();
1818#line 226 "MDTreeParser.g"
1819 currTorsionStamp->overrideType("Harmonic", dvec);
1820#line 1821 "MDTreeParser.cpp"
1821 break;
1822 }
1823 default:
1824 {
1825 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
1826 }
1827 }
1828 }
1829 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1830 reportError(ex);
1831 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1832 _t = _t->getNextSibling();
1833 }
1834 _retTree = _t;
1835}
1836
1837void MDTreeParser::inversionstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1838 ANTLR_USE_NAMESPACE(antlr)RefAST inversionstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1839#line 240 "MDTreeParser.g"
1840
1841 int icent;
1842 vector<int> ivec;
1843 vector<RealType> dvec;
1844 InversionStamp* currInversionStamp = static_cast<InversionStamp*>(blockStack.top());
1845
1846#line 1847 "MDTreeParser.cpp"
1847
1848 try { // for error handling
1849 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1850 _t = ASTNULL;
1851 switch ( _t->getType()) {
1852 case ASSIGNEQUAL:
1853 {
1854 assignment(_t);
1855 _t = _retTree;
1856 break;
1857 }
1858 case CENTER:
1859 {
1860 ANTLR_USE_NAMESPACE(antlr)RefAST __t90 = _t;
1861 ANTLR_USE_NAMESPACE(antlr)RefAST tmp63_AST_in = _t;
1862 match(_t,CENTER);
1863 _t = _t->getFirstChild();
1864 icent=intConst(_t);
1865 _t = _retTree;
1866 _t = __t90;
1867 _t = _t->getNextSibling();
1868#line 248 "MDTreeParser.g"
1869 currInversionStamp->setCenter(icent);
1870#line 1871 "MDTreeParser.cpp"
1871 break;
1872 }
1873 case SATELLITES:
1874 {
1875 ANTLR_USE_NAMESPACE(antlr)RefAST __t91 = _t;
1876 ANTLR_USE_NAMESPACE(antlr)RefAST tmp64_AST_in = _t;
1877 match(_t,SATELLITES);
1878 _t = _t->getFirstChild();
1879 ivec=inttuple(_t);
1880 _t = _retTree;
1881 _t = __t91;
1882 _t = _t->getNextSibling();
1883#line 249 "MDTreeParser.g"
1884 currInversionStamp->setSatellites(ivec);
1885#line 1886 "MDTreeParser.cpp"
1886 break;
1887 }
1888 case AMBERIMPROPER:
1889 {
1890 ANTLR_USE_NAMESPACE(antlr)RefAST __t92 = _t;
1891 ANTLR_USE_NAMESPACE(antlr)RefAST tmp65_AST_in = _t;
1892 match(_t,AMBERIMPROPER);
1893 _t = _t->getFirstChild();
1894 dvec=doubleNumberTuple(_t);
1895 _t = _retTree;
1896 _t = __t92;
1897 _t = _t->getNextSibling();
1898#line 250 "MDTreeParser.g"
1899 currInversionStamp->overrideType("AmberImproper", dvec);
1900#line 1901 "MDTreeParser.cpp"
1901 break;
1902 }
1903 case IMPROPERCOSINE:
1904 {
1905 ANTLR_USE_NAMESPACE(antlr)RefAST __t93 = _t;
1906 ANTLR_USE_NAMESPACE(antlr)RefAST tmp66_AST_in = _t;
1907 match(_t,IMPROPERCOSINE);
1908 _t = _t->getFirstChild();
1909 dvec=doubleNumberTuple(_t);
1910 _t = _retTree;
1911 _t = __t93;
1912 _t = _t->getNextSibling();
1913#line 251 "MDTreeParser.g"
1914 currInversionStamp->overrideType("ImproperCosine", dvec);
1915#line 1916 "MDTreeParser.cpp"
1916 break;
1917 }
1918 case HARMONIC:
1919 {
1920 ANTLR_USE_NAMESPACE(antlr)RefAST __t94 = _t;
1921 ANTLR_USE_NAMESPACE(antlr)RefAST tmp67_AST_in = _t;
1922 match(_t,HARMONIC);
1923 _t = _t->getFirstChild();
1924 dvec=doubleNumberTuple(_t);
1925 _t = _retTree;
1926 _t = __t94;
1927 _t = _t->getNextSibling();
1928#line 252 "MDTreeParser.g"
1929 currInversionStamp->overrideType("Harmonic", dvec);
1930#line 1931 "MDTreeParser.cpp"
1931 break;
1932 }
1933 case CENTRALATOMHEIGHT:
1934 {
1935 ANTLR_USE_NAMESPACE(antlr)RefAST __t95 = _t;
1936 ANTLR_USE_NAMESPACE(antlr)RefAST tmp68_AST_in = _t;
1937 match(_t,CENTRALATOMHEIGHT);
1938 _t = _t->getFirstChild();
1939 dvec=doubleNumberTuple(_t);
1940 _t = _retTree;
1941 _t = __t95;
1942 _t = _t->getNextSibling();
1943#line 253 "MDTreeParser.g"
1944 currInversionStamp->overrideType("CentralAtomHeight", dvec);
1945#line 1946 "MDTreeParser.cpp"
1946 break;
1947 }
1948 case DREIDING:
1949 {
1950 ANTLR_USE_NAMESPACE(antlr)RefAST __t96 = _t;
1951 ANTLR_USE_NAMESPACE(antlr)RefAST tmp69_AST_in = _t;
1952 match(_t,DREIDING);
1953 _t = _t->getFirstChild();
1954 dvec=doubleNumberTuple(_t);
1955 _t = _retTree;
1956 _t = __t96;
1957 _t = _t->getNextSibling();
1958#line 254 "MDTreeParser.g"
1959 currInversionStamp->overrideType("Dreiding", dvec);
1960#line 1961 "MDTreeParser.cpp"
1961 break;
1962 }
1963 default:
1964 {
1965 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
1966 }
1967 }
1968 }
1969 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
1970 reportError(ex);
1971 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
1972 _t = _t->getNextSibling();
1973 }
1974 _retTree = _t;
1975}
1976
1977void MDTreeParser::rigidbodystatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
1978 ANTLR_USE_NAMESPACE(antlr)RefAST rigidbodystatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
1979#line 272 "MDTreeParser.g"
1980
1981 vector<int> ivec;
1982 RigidBodyStamp* currRigidBodyStamp = static_cast<RigidBodyStamp*>(blockStack.top());
1983
1984#line 1985 "MDTreeParser.cpp"
1985
1986 try { // for error handling
1987 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
1988 _t = ASTNULL;
1989 switch ( _t->getType()) {
1990 case ASSIGNEQUAL:
1991 {
1992 assignment(_t);
1993 _t = _retTree;
1994 break;
1995 }
1996 case MEMBERS:
1997 {
1998 ANTLR_USE_NAMESPACE(antlr)RefAST __t102 = _t;
1999 ANTLR_USE_NAMESPACE(antlr)RefAST tmp70_AST_in = _t;
2000 match(_t,MEMBERS);
2001 _t = _t->getFirstChild();
2002 ivec=inttuple(_t);
2003 _t = _retTree;
2004 _t = __t102;
2005 _t = _t->getNextSibling();
2006#line 278 "MDTreeParser.g"
2007 currRigidBodyStamp->setMembers(ivec);
2008#line 2009 "MDTreeParser.cpp"
2009 break;
2010 }
2011 default:
2012 {
2013 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
2014 }
2015 }
2016 }
2017 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
2018 reportError(ex);
2019 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
2020 _t = _t->getNextSibling();
2021 }
2022 _retTree = _t;
2023}
2024
2025void MDTreeParser::cutoffgroupstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
2026 ANTLR_USE_NAMESPACE(antlr)RefAST cutoffgroupstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
2027#line 291 "MDTreeParser.g"
2028
2029 vector<int> ivec;
2030 CutoffGroupStamp* currCutoffGroupStamp = static_cast<CutoffGroupStamp*>(blockStack.top());
2031
2032#line 2033 "MDTreeParser.cpp"
2033
2034 try { // for error handling
2035 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
2036 _t = ASTNULL;
2037 switch ( _t->getType()) {
2038 case ASSIGNEQUAL:
2039 {
2040 assignment(_t);
2041 _t = _retTree;
2042 break;
2043 }
2044 case MEMBERS:
2045 {
2046 ANTLR_USE_NAMESPACE(antlr)RefAST __t108 = _t;
2047 ANTLR_USE_NAMESPACE(antlr)RefAST tmp71_AST_in = _t;
2048 match(_t,MEMBERS);
2049 _t = _t->getFirstChild();
2050 ivec=inttuple(_t);
2051 _t = _retTree;
2052 _t = __t108;
2053 _t = _t->getNextSibling();
2054#line 297 "MDTreeParser.g"
2055 currCutoffGroupStamp->setMembers(ivec);
2056#line 2057 "MDTreeParser.cpp"
2057 break;
2058 }
2059 default:
2060 {
2061 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
2062 }
2063 }
2064 }
2065 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
2066 reportError(ex);
2067 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
2068 _t = _t->getNextSibling();
2069 }
2070 _retTree = _t;
2071}
2072
2073void MDTreeParser::fragmentstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
2074 ANTLR_USE_NAMESPACE(antlr)RefAST fragmentstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
2075
2076 try { // for error handling
2077 assignment(_t);
2078 _t = _retTree;
2079 }
2080 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
2081 reportError(ex);
2082 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
2083 _t = _t->getNextSibling();
2084 }
2085 _retTree = _t;
2086}
2087
2088void MDTreeParser::constraintstatement(ANTLR_USE_NAMESPACE(antlr)RefAST _t) {
2089 ANTLR_USE_NAMESPACE(antlr)RefAST constraintstatement_AST_in = (_t == ANTLR_USE_NAMESPACE(antlr)RefAST(ASTNULL)) ? ANTLR_USE_NAMESPACE(antlr)nullAST : _t;
2090#line 323 "MDTreeParser.g"
2091
2092 vector<int> ivec;
2093 ConstraintStamp* currConstraintStamp = static_cast<ConstraintStamp*>(blockStack.top());
2094
2095#line 2096 "MDTreeParser.cpp"
2096
2097 try { // for error handling
2098 if (_t == ANTLR_USE_NAMESPACE(antlr)nullAST )
2099 _t = ASTNULL;
2100 switch ( _t->getType()) {
2101 case ASSIGNEQUAL:
2102 {
2103 assignment(_t);
2104 _t = _retTree;
2105 break;
2106 }
2107 case MEMBERS:
2108 {
2109 ANTLR_USE_NAMESPACE(antlr)RefAST __t119 = _t;
2110 ANTLR_USE_NAMESPACE(antlr)RefAST tmp72_AST_in = _t;
2111 match(_t,MEMBERS);
2112 _t = _t->getFirstChild();
2113 ivec=inttuple(_t);
2114 _t = _retTree;
2115 _t = __t119;
2116 _t = _t->getNextSibling();
2117#line 329 "MDTreeParser.g"
2118 currConstraintStamp->setMembers(ivec);
2119#line 2120 "MDTreeParser.cpp"
2120 break;
2121 }
2122 default:
2123 {
2124 throw ANTLR_USE_NAMESPACE(antlr)NoViableAltException(_t);
2125 }
2126 }
2127 }
2128 catch (ANTLR_USE_NAMESPACE(antlr)RecognitionException& ex) {
2129 reportError(ex);
2130 if ( _t != ANTLR_USE_NAMESPACE(antlr)nullAST )
2131 _t = _t->getNextSibling();
2132 }
2133 _retTree = _t;
2134}
2135
2136void MDTreeParser::initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& )
2137{
2138}
2139const char* MDTreeParser::tokenNames[] = {
2140 "<0>",
2141 "EOF",
2142 "<2>",
2143 "NULL_TREE_LOOKAHEAD",
2144 "\"component\"",
2145 "\"molecule\"",
2146 "\"zconstraint\"",
2147 "\"restraint\"",
2148 "\"atom\"",
2149 "\"bond\"",
2150 "\"bend\"",
2151 "\"torsion\"",
2152 "\"inversion\"",
2153 "\"rigidBody\"",
2154 "\"cutoffGroup\"",
2155 "\"constraint\"",
2156 "\"distance\"",
2157 "\"fragment\"",
2158 "\"members\"",
2159 "\"center\"",
2160 "\"satellites\"",
2161 "\"position\"",
2162 "\"orientation\"",
2163 "\"flucQ\"",
2164 "\"RNEMD\"",
2165 "\"minimizer\"",
2166 "\"Fixed\"",
2167 "\"Harmonic\"",
2168 "\"Cubic\"",
2169 "\"Quartic\"",
2170 "\"Polynomial\"",
2171 "\"Morse\"",
2172 "\"GhostBend\"",
2173 "\"UreyBradley\"",
2174 "\"Cosine\"",
2175 "\"GhostTorsion\"",
2176 "\"Charmm\"",
2177 "\"Opls\"",
2178 "\"Trappe\"",
2179 "\"AmberImproper\"",
2180 "\"ImproperCosine\"",
2181 "\"CentralAtomHeight\"",
2182 "\"Dreiding\"",
2183 "\"charge\"",
2184 "ENDBLOCK",
2185 "ID",
2186 "ASSIGNEQUAL",
2187 "SEMICOLON",
2188 "StringLiteral",
2189 "LCURLY",
2190 "RCURLY",
2191 "LBRACKET",
2192 "RBRACKET",
2193 "LPAREN",
2194 "RPAREN",
2195 "COMMA",
2196 "NUM_INT",
2197 "NUM_LONG",
2198 "NUM_FLOAT",
2199 "NUM_DOUBLE",
2200 "DOT",
2201 "COLON",
2202 "QUESTIONMARK",
2203 "Whitespace",
2204 "Comment",
2205 "CPPComment",
2206 "a line directive",
2207 "LineDirective",
2208 "Space",
2209 "CharLiteral",
2210 "EndOfLine",
2211 "Escape",
2212 "Vocabulary",
2213 "Digit",
2214 "Decimal",
2215 "HEX_DIGIT",
2216 "EXPONENT",
2217 "FLOAT_SUFFIX",
2218 0
2219};
2220
2221const unsigned long MDTreeParser::_tokenSet_0_data_[] = { 58720496UL, 16384UL, 0UL, 0UL };
2222// "component" "molecule" "zconstraint" "restraint" "flucQ" "RNEMD" "minimizer"
2223// ASSIGNEQUAL
2224const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_0(_tokenSet_0_data_,4);
2225const unsigned long MDTreeParser::_tokenSet_1_data_[] = { 196352UL, 16384UL, 0UL, 0UL };
2226// "atom" "bond" "bend" "torsion" "inversion" "rigidBody" "cutoffGroup"
2227// "constraint" "fragment" ASSIGNEQUAL
2228const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_1(_tokenSet_1_data_,4);
2229const unsigned long MDTreeParser::_tokenSet_2_data_[] = { 6291456UL, 18432UL, 0UL, 0UL };
2230// "position" "orientation" "charge" ASSIGNEQUAL
2231const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_2(_tokenSet_2_data_,4);
2232const unsigned long MDTreeParser::_tokenSet_3_data_[] = { 4228120576UL, 16384UL, 0UL, 0UL };
2233// "members" "Fixed" "Harmonic" "Cubic" "Quartic" "Polynomial" "Morse"
2234// ASSIGNEQUAL
2235const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_3(_tokenSet_3_data_,4);
2236const unsigned long MDTreeParser::_tokenSet_4_data_[] = { 2013528064UL, 16391UL, 0UL, 0UL };
2237// "members" "Harmonic" "Cubic" "Quartic" "Polynomial" "GhostBend" "UreyBradley"
2238// "Cosine" ASSIGNEQUAL
2239const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_4(_tokenSet_4_data_,4);
2240const unsigned long MDTreeParser::_tokenSet_5_data_[] = { 2013528064UL, 16504UL, 0UL, 0UL };
2241// "members" "Harmonic" "Cubic" "Quartic" "Polynomial" "GhostTorsion" "Charmm"
2242// "Opls" "Trappe" ASSIGNEQUAL
2243const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_5(_tokenSet_5_data_,4);
2244const unsigned long MDTreeParser::_tokenSet_6_data_[] = { 135790592UL, 18304UL, 0UL, 0UL };
2245// "center" "satellites" "Harmonic" "AmberImproper" "ImproperCosine" "CentralAtomHeight"
2246// "Dreiding" ASSIGNEQUAL
2247const ANTLR_USE_NAMESPACE(antlr)BitSet MDTreeParser::_tokenSet_6(_tokenSet_6_data_,4);
2248
2249
virtual RefAST getNextSibling() const =0
Get the next sibling in line after this one.
@ INVERSION
Inversions.
@ TORSION
Torsions.
@ BEND
Bends.
@ BOND
Bonds.
@ MOLECULE
Molecules.