PauliOperatorParser.cpp 26 KB
Newer Older
1

2
// Generated from PauliOperator.g4 by ANTLR 4.8
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83


#include "PauliOperatorListener.h"

#include "PauliOperatorParser.h"


using namespace antlrcpp;
using namespace pauli;
using namespace antlr4;

PauliOperatorParser::PauliOperatorParser(TokenStream *input) : Parser(input) {
  _interpreter = new atn::ParserATNSimulator(this, _atn, _decisionToDFA, _sharedContextCache);
}

PauliOperatorParser::~PauliOperatorParser() {
  delete _interpreter;
}

std::string PauliOperatorParser::getGrammarFileName() const {
  return "PauliOperator.g4";
}

const std::vector<std::string>& PauliOperatorParser::getRuleNames() const {
  return _ruleNames;
}

dfa::Vocabulary& PauliOperatorParser::getVocabulary() const {
  return _vocabulary;
}


//----------------- PauliSrcContext ------------------------------------------------------------------

PauliOperatorParser::PauliSrcContext::PauliSrcContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

std::vector<PauliOperatorParser::TermContext *> PauliOperatorParser::PauliSrcContext::term() {
  return getRuleContexts<PauliOperatorParser::TermContext>();
}

PauliOperatorParser::TermContext* PauliOperatorParser::PauliSrcContext::term(size_t i) {
  return getRuleContext<PauliOperatorParser::TermContext>(i);
}

std::vector<PauliOperatorParser::PlusorminusContext *> PauliOperatorParser::PauliSrcContext::plusorminus() {
  return getRuleContexts<PauliOperatorParser::PlusorminusContext>();
}

PauliOperatorParser::PlusorminusContext* PauliOperatorParser::PauliSrcContext::plusorminus(size_t i) {
  return getRuleContext<PauliOperatorParser::PlusorminusContext>(i);
}


size_t PauliOperatorParser::PauliSrcContext::getRuleIndex() const {
  return PauliOperatorParser::RulePauliSrc;
}

void PauliOperatorParser::PauliSrcContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterPauliSrc(this);
}

void PauliOperatorParser::PauliSrcContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitPauliSrc(this);
}

PauliOperatorParser::PauliSrcContext* PauliOperatorParser::pauliSrc() {
  PauliSrcContext *_localctx = _tracker.createInstance<PauliSrcContext>(_ctx, getState());
  enterRule(_localctx, 0, PauliOperatorParser::RulePauliSrc);
  size_t _la = 0;

  auto onExit = finally([=] {
    exitRule();
  });
  try {
    enterOuterAlt(_localctx, 1);
84
    setState(18);
85
    term();
86
    setState(24);
87
88
89
90
91
    _errHandler->sync(this);
    _la = _input->LA(1);
    while (_la == PauliOperatorParser::T__0

    || _la == PauliOperatorParser::T__1) {
92
      setState(19);
93
      plusorminus();
94
      setState(20);
95
      term();
96
      setState(26);
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
      _errHandler->sync(this);
      _la = _input->LA(1);
    }
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- PlusorminusContext ------------------------------------------------------------------

PauliOperatorParser::PlusorminusContext::PlusorminusContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}


size_t PauliOperatorParser::PlusorminusContext::getRuleIndex() const {
  return PauliOperatorParser::RulePlusorminus;
}

void PauliOperatorParser::PlusorminusContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterPlusorminus(this);
}

void PauliOperatorParser::PlusorminusContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitPlusorminus(this);
}

PauliOperatorParser::PlusorminusContext* PauliOperatorParser::plusorminus() {
  PlusorminusContext *_localctx = _tracker.createInstance<PlusorminusContext>(_ctx, getState());
  enterRule(_localctx, 2, PauliOperatorParser::RulePlusorminus);
  size_t _la = 0;

  auto onExit = finally([=] {
    exitRule();
  });
  try {
    enterOuterAlt(_localctx, 1);
144
    setState(27);
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
    _la = _input->LA(1);
    if (!(_la == PauliOperatorParser::T__0

    || _la == PauliOperatorParser::T__1)) {
    _errHandler->recoverInline(this);
    }
    else {
      _errHandler->reportMatch(this);
      consume();
    }
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- TermContext ------------------------------------------------------------------

PauliOperatorParser::TermContext::TermContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

PauliOperatorParser::CoeffContext* PauliOperatorParser::TermContext::coeff() {
  return getRuleContext<PauliOperatorParser::CoeffContext>(0);
}

std::vector<PauliOperatorParser::PauliContext *> PauliOperatorParser::TermContext::pauli() {
  return getRuleContexts<PauliOperatorParser::PauliContext>();
}

PauliOperatorParser::PauliContext* PauliOperatorParser::TermContext::pauli(size_t i) {
  return getRuleContext<PauliOperatorParser::PauliContext>(i);
}


size_t PauliOperatorParser::TermContext::getRuleIndex() const {
  return PauliOperatorParser::RuleTerm;
}

void PauliOperatorParser::TermContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterTerm(this);
}

void PauliOperatorParser::TermContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitTerm(this);
}

PauliOperatorParser::TermContext* PauliOperatorParser::term() {
  TermContext *_localctx = _tracker.createInstance<TermContext>(_ctx, getState());
  enterRule(_localctx, 4, PauliOperatorParser::RuleTerm);
  size_t _la = 0;

  auto onExit = finally([=] {
    exitRule();
  });
  try {
    enterOuterAlt(_localctx, 1);
211
    setState(30);
212
213
214
    _errHandler->sync(this);

    _la = _input->LA(1);
215
216
217
218
219
220
    if ((((_la & ~ 0x3fULL) == 0) &&
      ((1ULL << _la) & ((1ULL << PauliOperatorParser::T__6)
      | (1ULL << PauliOperatorParser::T__9)
      | (1ULL << PauliOperatorParser::T__10)
      | (1ULL << PauliOperatorParser::REAL)
      | (1ULL << PauliOperatorParser::INT))) != 0)) {
221
      setState(29);
222
223
      coeff();
    }
224
    setState(35);
225
226
227
228
229
230
231
    _errHandler->sync(this);
    _la = _input->LA(1);
    while ((((_la & ~ 0x3fULL) == 0) &&
      ((1ULL << _la) & ((1ULL << PauliOperatorParser::T__2)
      | (1ULL << PauliOperatorParser::T__3)
      | (1ULL << PauliOperatorParser::T__4)
      | (1ULL << PauliOperatorParser::T__5))) != 0)) {
232
      setState(32);
233
      pauli();
234
      setState(37);
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
      _errHandler->sync(this);
      _la = _input->LA(1);
    }
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- PauliContext ------------------------------------------------------------------

PauliOperatorParser::PauliContext::PauliContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

tree::TerminalNode* PauliOperatorParser::PauliContext::INT() {
  return getToken(PauliOperatorParser::INT, 0);
}


size_t PauliOperatorParser::PauliContext::getRuleIndex() const {
  return PauliOperatorParser::RulePauli;
}

void PauliOperatorParser::PauliContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterPauli(this);
}

void PauliOperatorParser::PauliContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitPauli(this);
}

PauliOperatorParser::PauliContext* PauliOperatorParser::pauli() {
  PauliContext *_localctx = _tracker.createInstance<PauliContext>(_ctx, getState());
  enterRule(_localctx, 6, PauliOperatorParser::RulePauli);
  size_t _la = 0;

  auto onExit = finally([=] {
    exitRule();
  });
  try {
285
    setState(41);
286
287
288
289
290
291
    _errHandler->sync(this);
    switch (_input->LA(1)) {
      case PauliOperatorParser::T__2:
      case PauliOperatorParser::T__3:
      case PauliOperatorParser::T__4: {
        enterOuterAlt(_localctx, 1);
292
        setState(38);
293
294
295
296
297
298
299
300
301
302
303
        _la = _input->LA(1);
        if (!((((_la & ~ 0x3fULL) == 0) &&
          ((1ULL << _la) & ((1ULL << PauliOperatorParser::T__2)
          | (1ULL << PauliOperatorParser::T__3)
          | (1ULL << PauliOperatorParser::T__4))) != 0))) {
        _errHandler->recoverInline(this);
        }
        else {
          _errHandler->reportMatch(this);
          consume();
        }
304
        setState(39);
305
306
307
308
309
310
        match(PauliOperatorParser::INT);
        break;
      }

      case PauliOperatorParser::T__5: {
        enterOuterAlt(_localctx, 2);
311
        setState(40);
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
        match(PauliOperatorParser::T__5);
        break;
      }

    default:
      throw NoViableAltException(this);
    }
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- CoeffContext ------------------------------------------------------------------

PauliOperatorParser::CoeffContext::CoeffContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

PauliOperatorParser::ComplexContext* PauliOperatorParser::CoeffContext::complex() {
  return getRuleContext<PauliOperatorParser::ComplexContext>(0);
}

PauliOperatorParser::RealContext* PauliOperatorParser::CoeffContext::real() {
  return getRuleContext<PauliOperatorParser::RealContext>(0);
}


size_t PauliOperatorParser::CoeffContext::getRuleIndex() const {
  return PauliOperatorParser::RuleCoeff;
}

void PauliOperatorParser::CoeffContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterCoeff(this);
}

void PauliOperatorParser::CoeffContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitCoeff(this);
}

PauliOperatorParser::CoeffContext* PauliOperatorParser::coeff() {
  CoeffContext *_localctx = _tracker.createInstance<CoeffContext>(_ctx, getState());
  enterRule(_localctx, 8, PauliOperatorParser::RuleCoeff);

  auto onExit = finally([=] {
    exitRule();
  });
  try {
369
    setState(45);
370
371
372
373
    _errHandler->sync(this);
    switch (_input->LA(1)) {
      case PauliOperatorParser::T__6: {
        enterOuterAlt(_localctx, 1);
374
        setState(43);
375
376
377
378
        complex();
        break;
      }

379
380
381
382
      case PauliOperatorParser::T__9:
      case PauliOperatorParser::T__10:
      case PauliOperatorParser::REAL:
      case PauliOperatorParser::INT: {
383
        enterOuterAlt(_localctx, 2);
384
        setState(44);
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
        real();
        break;
      }

    default:
      throw NoViableAltException(this);
    }
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- ComplexContext ------------------------------------------------------------------

PauliOperatorParser::ComplexContext::ComplexContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

std::vector<PauliOperatorParser::RealContext *> PauliOperatorParser::ComplexContext::real() {
  return getRuleContexts<PauliOperatorParser::RealContext>();
}

PauliOperatorParser::RealContext* PauliOperatorParser::ComplexContext::real(size_t i) {
  return getRuleContext<PauliOperatorParser::RealContext>(i);
}

std::vector<tree::TerminalNode *> PauliOperatorParser::ComplexContext::INT() {
  return getTokens(PauliOperatorParser::INT);
}

tree::TerminalNode* PauliOperatorParser::ComplexContext::INT(size_t i) {
  return getToken(PauliOperatorParser::INT, i);
}

425
426
427
428
429
430
431
432
std::vector<PauliOperatorParser::ScientificContext *> PauliOperatorParser::ComplexContext::scientific() {
  return getRuleContexts<PauliOperatorParser::ScientificContext>();
}

PauliOperatorParser::ScientificContext* PauliOperatorParser::ComplexContext::scientific(size_t i) {
  return getRuleContext<PauliOperatorParser::ScientificContext>(i);
}

433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

size_t PauliOperatorParser::ComplexContext::getRuleIndex() const {
  return PauliOperatorParser::RuleComplex;
}

void PauliOperatorParser::ComplexContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterComplex(this);
}

void PauliOperatorParser::ComplexContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitComplex(this);
}

PauliOperatorParser::ComplexContext* PauliOperatorParser::complex() {
  ComplexContext *_localctx = _tracker.createInstance<ComplexContext>(_ctx, getState());
  enterRule(_localctx, 10, PauliOperatorParser::RuleComplex);

  auto onExit = finally([=] {
    exitRule();
  });
  try {
    enterOuterAlt(_localctx, 1);
459
    setState(47);
460
    match(PauliOperatorParser::T__6);
461
    setState(51);
462
    _errHandler->sync(this);
463
464
465
466
467
468
    switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 5, _ctx)) {
    case 1: {
      setState(48);
      real();
      break;
    }
469

470
471
472
473
474
475
476
477
478
479
480
    case 2: {
      setState(49);
      match(PauliOperatorParser::INT);
      break;
    }

    case 3: {
      setState(50);
      scientific();
      break;
    }
481
482
483

    }
    setState(53);
484
485
    match(PauliOperatorParser::T__7);
    setState(57);
486
    _errHandler->sync(this);
487
488
489
490
491
492
    switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 6, _ctx)) {
    case 1: {
      setState(54);
      real();
      break;
    }
493

494
495
496
497
498
499
500
501
502
503
504
    case 2: {
      setState(55);
      match(PauliOperatorParser::INT);
      break;
    }

    case 3: {
      setState(56);
      scientific();
      break;
    }
505
506

    }
507
    setState(59);
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
    match(PauliOperatorParser::T__8);
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- RealContext ------------------------------------------------------------------

PauliOperatorParser::RealContext::RealContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

tree::TerminalNode* PauliOperatorParser::RealContext::REAL() {
  return getToken(PauliOperatorParser::REAL, 0);
}

530
531
532
533
PauliOperatorParser::ScientificContext* PauliOperatorParser::RealContext::scientific() {
  return getRuleContext<PauliOperatorParser::ScientificContext>(0);
}

534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558

size_t PauliOperatorParser::RealContext::getRuleIndex() const {
  return PauliOperatorParser::RuleReal;
}

void PauliOperatorParser::RealContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterReal(this);
}

void PauliOperatorParser::RealContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitReal(this);
}

PauliOperatorParser::RealContext* PauliOperatorParser::real() {
  RealContext *_localctx = _tracker.createInstance<RealContext>(_ctx, getState());
  enterRule(_localctx, 12, PauliOperatorParser::RuleReal);

  auto onExit = finally([=] {
    exitRule();
  });
  try {
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
    setState(63);
    _errHandler->sync(this);
    switch (getInterpreter<atn::ParserATNSimulator>()->adaptivePredict(_input, 7, _ctx)) {
    case 1: {
      enterOuterAlt(_localctx, 1);
      setState(61);
      match(PauliOperatorParser::REAL);
      break;
    }

    case 2: {
      enterOuterAlt(_localctx, 2);
      setState(62);
      scientific();
      break;
    }

    }
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

//----------------- CommentContext ------------------------------------------------------------------

PauliOperatorParser::CommentContext::CommentContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

tree::TerminalNode* PauliOperatorParser::CommentContext::COMMENT() {
  return getToken(PauliOperatorParser::COMMENT, 0);
}


size_t PauliOperatorParser::CommentContext::getRuleIndex() const {
  return PauliOperatorParser::RuleComment;
}

void PauliOperatorParser::CommentContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterComment(this);
}

void PauliOperatorParser::CommentContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitComment(this);
}

PauliOperatorParser::CommentContext* PauliOperatorParser::comment() {
  CommentContext *_localctx = _tracker.createInstance<CommentContext>(_ctx, getState());
  enterRule(_localctx, 14, PauliOperatorParser::RuleComment);

  auto onExit = finally([=] {
    exitRule();
  });
  try {
    enterOuterAlt(_localctx, 1);
624
    setState(65);
625
626
627
628
629
630
631
632
633
634
635
636
    match(PauliOperatorParser::COMMENT);
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
//----------------- ScientificContext ------------------------------------------------------------------

PauliOperatorParser::ScientificContext::ScientificContext(ParserRuleContext *parent, size_t invokingState)
  : ParserRuleContext(parent, invokingState) {
}

tree::TerminalNode* PauliOperatorParser::ScientificContext::INT() {
  return getToken(PauliOperatorParser::INT, 0);
}

tree::TerminalNode* PauliOperatorParser::ScientificContext::REAL() {
  return getToken(PauliOperatorParser::REAL, 0);
}


size_t PauliOperatorParser::ScientificContext::getRuleIndex() const {
  return PauliOperatorParser::RuleScientific;
}

void PauliOperatorParser::ScientificContext::enterRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->enterScientific(this);
}

void PauliOperatorParser::ScientificContext::exitRule(tree::ParseTreeListener *listener) {
  auto parserListener = dynamic_cast<PauliOperatorListener *>(listener);
  if (parserListener != nullptr)
    parserListener->exitScientific(this);
}

PauliOperatorParser::ScientificContext* PauliOperatorParser::scientific() {
  ScientificContext *_localctx = _tracker.createInstance<ScientificContext>(_ctx, getState());
  enterRule(_localctx, 16, PauliOperatorParser::RuleScientific);
  size_t _la = 0;

  auto onExit = finally([=] {
    exitRule();
  });
  try {
    enterOuterAlt(_localctx, 1);
678
    setState(68);
679
680
681
682
    _errHandler->sync(this);

    _la = _input->LA(1);
    if (_la == PauliOperatorParser::REAL) {
683
      setState(67);
684
685
      match(PauliOperatorParser::REAL);
    }
686
    setState(71);
687
688
689
690
691
692
    _errHandler->sync(this);

    _la = _input->LA(1);
    if (_la == PauliOperatorParser::T__9

    || _la == PauliOperatorParser::T__10) {
693
      setState(70);
694
695
696
697
698
699
700
701
702
703
704
      _la = _input->LA(1);
      if (!(_la == PauliOperatorParser::T__9

      || _la == PauliOperatorParser::T__10)) {
      _errHandler->recoverInline(this);
      }
      else {
        _errHandler->reportMatch(this);
        consume();
      }
    }
705
    setState(73);
706
707
708
709
710
711
712
713
714
715
716
717
    match(PauliOperatorParser::INT);
   
  }
  catch (RecognitionException &e) {
    _errHandler->reportError(this, e);
    _localctx->exception = std::current_exception();
    _errHandler->recover(this, _localctx->exception);
  }

  return _localctx;
}

718
719
720
721
722
723
724
725
726
727
// Static vars and initialization.
std::vector<dfa::DFA> PauliOperatorParser::_decisionToDFA;
atn::PredictionContextCache PauliOperatorParser::_sharedContextCache;

// We own the ATN which in turn owns the ATN states.
atn::ATN PauliOperatorParser::_atn;
std::vector<uint16_t> PauliOperatorParser::_serializedATN;

std::vector<std::string> PauliOperatorParser::_ruleNames = {
  "pauliSrc", "plusorminus", "term", "pauli", "coeff", "complex", "real", 
728
  "comment", "scientific"
729
730
731
};

std::vector<std::string> PauliOperatorParser::_literalNames = {
732
733
  "", "'+'", "'-'", "'X'", "'Y'", "'Z'", "'I'", "'('", "','", "')'", "'e'", 
  "'E'"
734
735
736
};

std::vector<std::string> PauliOperatorParser::_symbolicNames = {
737
738
  "", "", "", "", "", "", "", "", "", "", "", "", "COMMENT", "REAL", "INT", 
  "WS", "EOL"
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
};

dfa::Vocabulary PauliOperatorParser::_vocabulary(_literalNames, _symbolicNames);

std::vector<std::string> PauliOperatorParser::_tokenNames;

PauliOperatorParser::Initializer::Initializer() {
	for (size_t i = 0; i < _symbolicNames.size(); ++i) {
		std::string name = _vocabulary.getLiteralName(i);
		if (name.empty()) {
			name = _vocabulary.getSymbolicName(i);
		}

		if (name.empty()) {
			_tokenNames.push_back("<INVALID>");
		} else {
      _tokenNames.push_back(name);
    }
	}

  _serializedATN = {
    0x3, 0x608b, 0xa72a, 0x8133, 0xb9ed, 0x417c, 0x3be7, 0x7786, 0x5964, 
761
    0x3, 0x12, 0x4e, 0x4, 0x2, 0x9, 0x2, 0x4, 0x3, 0x9, 0x3, 0x4, 0x4, 0x9, 
762
    0x4, 0x4, 0x5, 0x9, 0x5, 0x4, 0x6, 0x9, 0x6, 0x4, 0x7, 0x9, 0x7, 0x4, 
763
764
765
766
767
768
769
    0x8, 0x9, 0x8, 0x4, 0x9, 0x9, 0x9, 0x4, 0xa, 0x9, 0xa, 0x3, 0x2, 0x3, 
    0x2, 0x3, 0x2, 0x3, 0x2, 0x7, 0x2, 0x19, 0xa, 0x2, 0xc, 0x2, 0xe, 0x2, 
    0x1c, 0xb, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x5, 0x4, 0x21, 0xa, 0x4, 
    0x3, 0x4, 0x7, 0x4, 0x24, 0xa, 0x4, 0xc, 0x4, 0xe, 0x4, 0x27, 0xb, 0x4, 
    0x3, 0x5, 0x3, 0x5, 0x3, 0x5, 0x5, 0x5, 0x2c, 0xa, 0x5, 0x3, 0x6, 0x3, 
    0x6, 0x5, 0x6, 0x30, 0xa, 0x6, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 
    0x5, 0x7, 0x36, 0xa, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x3, 0x7, 0x5, 
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
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, 0x2, 0x2, 0x3a, 0x3c, 0x5, 0x12, 
    0xa, 0x2, 0x3b, 0x38, 0x3, 0x2, 0x2, 0x2, 0x3b, 0x39, 0x3, 0x2, 0x2, 
    0x2, 0x3b, 0x3a, 0x3, 0x2, 0x2, 0x2, 0x3c, 0x3d, 0x3, 0x2, 0x2, 0x2, 
    0x3d, 0x3e, 0x7, 0xb, 0x2, 0x2, 0x3e, 0xd, 0x3, 0x2, 0x2, 0x2, 0x3f, 
    0x42, 0x7, 0xf, 0x2, 0x2, 0x40, 0x42, 0x5, 0x12, 0xa, 0x2, 0x41, 0x3f, 
    0x3, 0x2, 0x2, 0x2, 0x41, 0x40, 0x3, 0x2, 0x2, 0x2, 0x42, 0xf, 0x3, 
    0x2, 0x2, 0x2, 0x43, 0x44, 0x7, 0xe, 0x2, 0x2, 0x44, 0x11, 0x3, 0x2, 
    0x2, 0x2, 0x45, 0x47, 0x7, 0xf, 0x2, 0x2, 0x46, 0x45, 0x3, 0x2, 0x2, 
    0x2, 0x46, 0x47, 0x3, 0x2, 0x2, 0x2, 0x47, 0x49, 0x3, 0x2, 0x2, 0x2, 
    0x48, 0x4a, 0x9, 0x4, 0x2, 0x2, 0x49, 0x48, 0x3, 0x2, 0x2, 0x2, 0x49, 
    0x4a, 0x3, 0x2, 0x2, 0x2, 0x4a, 0x4b, 0x3, 0x2, 0x2, 0x2, 0x4b, 0x4c, 
    0x7, 0x10, 0x2, 0x2, 0x4c, 0x13, 0x3, 0x2, 0x2, 0x2, 0xc, 0x1a, 0x20, 
    0x25, 0x2b, 0x2f, 0x35, 0x3b, 0x41, 0x46, 0x49, 
812
813
814
815
816
817
818
819
820
821
822
823
824
  };

  atn::ATNDeserializer deserializer;
  _atn = deserializer.deserialize(_serializedATN);

  size_t count = _atn.getNumberOfDecisions();
  _decisionToDFA.reserve(count);
  for (size_t i = 0; i < count; i++) { 
    _decisionToDFA.emplace_back(_atn.getDecisionState(i), i);
  }
}

PauliOperatorParser::Initializer PauliOperatorParser::_init;