00001
00002 #include "EDIParser.hpp"
00003 #include <antlr/NoViableAltException.hpp>
00004 #include <antlr/SemanticException.hpp>
00005 #include <antlr/ASTFactory.hpp>
00006 #line 1 "EdiParser2.g"
00007 #line 8 "EDIParser.cpp"
00008 EDIParser::EDIParser(antlr::TokenBuffer& tokenBuf, int k)
00009 : antlr::LLkParser(tokenBuf,k)
00010 {
00011 }
00012
00013 EDIParser::EDIParser(antlr::TokenBuffer& tokenBuf)
00014 : antlr::LLkParser(tokenBuf,10)
00015 {
00016 }
00017
00018 EDIParser::EDIParser(antlr::TokenStream& lexer, int k)
00019 : antlr::LLkParser(lexer,k)
00020 {
00021 }
00022
00023 EDIParser::EDIParser(antlr::TokenStream& lexer)
00024 : antlr::LLkParser(lexer,10)
00025 {
00026 }
00027
00028 EDIParser::EDIParser(const antlr::ParserSharedInputState& state)
00029 : antlr::LLkParser(state,10)
00030 {
00031 }
00032
00033 void EDIParser::option() {
00034 antlr::RefToken a = antlr::nullToken;
00035 #line 50 "EdiParser2.g"
00036 double currvalue; bool isint = false; double *currdouble;
00037 #line 38 "EDIParser.cpp"
00038
00039 try {
00040 {
00041 switch ( LA(1)) {
00042 case LITERAL_NFREQ:
00043 {
00044 match(LITERAL_NFREQ);
00045 if ( inputState->guessing==0 ) {
00046 #line 52 "EdiParser2.g"
00047 isint = true; currdouble = NULL;
00048 #line 49 "EDIParser.cpp"
00049 }
00050 break;
00051 }
00052 case LITERAL_LATITUDE:
00053 {
00054 match(LITERAL_LATITUDE);
00055 if ( inputState->guessing==0 ) {
00056 #line 53 "EdiParser2.g"
00057 isint = false; currdouble = &latitude;
00058 #line 59 "EDIParser.cpp"
00059 }
00060 break;
00061 }
00062 case LITERAL_LONGITUDE:
00063 {
00064 match(LITERAL_LONGITUDE);
00065 if ( inputState->guessing==0 ) {
00066 #line 54 "EdiParser2.g"
00067 isint = false; currdouble = &longitude;
00068 #line 69 "EDIParser.cpp"
00069 }
00070 break;
00071 }
00072 case LITERAL_AZIMUTH:
00073 {
00074 match(LITERAL_AZIMUTH);
00075 if ( inputState->guessing==0 ) {
00076 #line 55 "EdiParser2.g"
00077 isint = false; currdouble = &azimuth;
00078 #line 79 "EDIParser.cpp"
00079 }
00080 break;
00081 }
00082 case LITERAL_ELEVATION:
00083 {
00084 match(LITERAL_ELEVATION);
00085 if ( inputState->guessing==0 ) {
00086 #line 56 "EdiParser2.g"
00087 isint = false; currdouble = &elevation;
00088 #line 89 "EDIParser.cpp"
00089 }
00090 break;
00091 }
00092 case LITERAL_REFLONG:
00093 {
00094 match(LITERAL_REFLONG);
00095 if ( inputState->guessing==0 ) {
00096 #line 57 "EdiParser2.g"
00097 isint = false; currdouble = &longitude;
00098 #line 99 "EDIParser.cpp"
00099 }
00100 break;
00101 }
00102 case LITERAL_REFLAT:
00103 {
00104 match(LITERAL_REFLAT);
00105 if ( inputState->guessing==0 ) {
00106 #line 58 "EdiParser2.g"
00107 isint = false; currdouble = &latitude;
00108 #line 109 "EDIParser.cpp"
00109 }
00110 break;
00111 }
00112 case STRING:
00113 {
00114 a = LT(1);
00115 match(STRING);
00116 if ( inputState->guessing==0 ) {
00117 #line 59 "EdiParser2.g"
00118 currdouble = NULL; isint = false;
00119 #line 120 "EDIParser.cpp"
00120 }
00121 break;
00122 }
00123 default:
00124 {
00125 throw antlr::NoViableAltException(LT(1), getFilename());
00126 }
00127 }
00128 }
00129 match(EQUAL);
00130 {
00131 switch ( LA(1)) {
00132 case DATE:
00133 {
00134 match(DATE);
00135 break;
00136 }
00137 case STRING:
00138 {
00139 match(STRING);
00140 break;
00141 }
00142 default:
00143 bool synPredMatched7 = false;
00144 if (((LA(1) == NUMBER) && (LA(2) == COLON) && (LA(3) == NUMBER) && (LA(4) == COLON) && (LA(5) == NUMBER) && ((LA(6) >= LITERAL_NFREQ && LA(6) <= REAL)) && (_tokenSet_0.member(LA(7))) && (_tokenSet_0.member(LA(8))) && (_tokenSet_0.member(LA(9))) && (_tokenSet_0.member(LA(10))))) {
00145 int _m7 = mark();
00146 synPredMatched7 = true;
00147 inputState->guessing++;
00148 try {
00149 {
00150 lat_long();
00151 }
00152 }
00153 catch (antlr::RecognitionException& pe) {
00154 synPredMatched7 = false;
00155 }
00156 rewind(_m7);
00157 inputState->guessing--;
00158 }
00159 if ( synPredMatched7 ) {
00160 currvalue=lat_long();
00161 }
00162 else {
00163 bool synPredMatched9 = false;
00164 if (((LA(1) == NUMBER) && ((LA(2) >= LITERAL_NFREQ && LA(2) <= REAL)) && (_tokenSet_0.member(LA(3))) && (_tokenSet_0.member(LA(4))) && (_tokenSet_0.member(LA(5))) && (_tokenSet_0.member(LA(6))) && (_tokenSet_0.member(LA(7))) && (_tokenSet_0.member(LA(8))) && (_tokenSet_0.member(LA(9))) && (_tokenSet_0.member(LA(10))))) {
00165 int _m9 = mark();
00166 synPredMatched9 = true;
00167 inputState->guessing++;
00168 try {
00169 {
00170 match(NUMBER);
00171 }
00172 }
00173 catch (antlr::RecognitionException& pe) {
00174 synPredMatched9 = false;
00175 }
00176 rewind(_m9);
00177 inputState->guessing--;
00178 }
00179 if ( synPredMatched9 ) {
00180 currvalue=datavalue();
00181 }
00182 else {
00183 throw antlr::NoViableAltException(LT(1), getFilename());
00184 }
00185 }}
00186 }
00187 if ( inputState->guessing==0 ) {
00188 #line 65 "EdiParser2.g"
00189 if (isint)
00190 { nfreq = int(currvalue);}
00191 else
00192 if (currdouble != NULL) *currdouble = currvalue;
00193 #line 194 "EDIParser.cpp"
00194 }
00195 }
00196 catch (antlr::RecognitionException& ex) {
00197 if( inputState->guessing == 0 ) {
00198 reportError(ex);
00199 recover(ex,_tokenSet_1);
00200 } else {
00201 throw;
00202 }
00203 }
00204 }
00205
00206 double EDIParser::lat_long() {
00207 #line 209 "EdiParser2.g"
00208 double r;
00209 #line 210 "EDIParser.cpp"
00210 #line 209 "EdiParser2.g"
00211 double v1=0; double v2=0; double v3=0;
00212 #line 213 "EDIParser.cpp"
00213
00214 try {
00215 v1=datavalue();
00216 match(COLON);
00217 v2=datavalue();
00218 match(COLON);
00219 v3=datavalue();
00220 if ( inputState->guessing==0 ) {
00221 #line 212 "EdiParser2.g"
00222
00223 if (v1 > 0)
00224 r = v1 + v2/60. + v3/3600.;
00225 else
00226 r = v1 - v2/60. - v3/3600.;
00227
00228 #line 229 "EDIParser.cpp"
00229 }
00230 }
00231 catch (antlr::RecognitionException& ex) {
00232 if( inputState->guessing == 0 ) {
00233 reportError(ex);
00234 recover(ex,_tokenSet_1);
00235 } else {
00236 throw;
00237 }
00238 }
00239 return r;
00240 }
00241
00242 double EDIParser::datavalue() {
00243 #line 221 "EdiParser2.g"
00244 double r;
00245 #line 246 "EDIParser.cpp"
00246 antlr::RefToken currvalue = antlr::nullToken;
00247
00248 try {
00249 currvalue = LT(1);
00250 match(NUMBER);
00251 if ( inputState->guessing==0 ) {
00252 #line 223 "EdiParser2.g"
00253 convert(currvalue->getText(),r);
00254 #line 255 "EDIParser.cpp"
00255 }
00256 }
00257 catch (antlr::RecognitionException& ex) {
00258 if( inputState->guessing == 0 ) {
00259 reportError(ex);
00260 recover(ex,_tokenSet_1);
00261 } else {
00262 throw;
00263 }
00264 }
00265 return r;
00266 }
00267
00268 void EDIParser::option_list() {
00269
00270 try {
00271 {
00272 for (;;) {
00273 if (((LA(1) >= LITERAL_NFREQ && LA(1) <= STRING)) && (LA(2) == EQUAL) && (LA(3) == STRING || LA(3) == DATE || LA(3) == NUMBER) && ((LA(4) >= LITERAL_NFREQ && LA(4) <= REAL)) && (_tokenSet_0.member(LA(5))) && (_tokenSet_0.member(LA(6))) && (_tokenSet_0.member(LA(7))) && (_tokenSet_0.member(LA(8))) && (_tokenSet_0.member(LA(9))) && (_tokenSet_0.member(LA(10)))) {
00274 option();
00275 }
00276 else {
00277 goto _loop12;
00278 }
00279
00280 }
00281 _loop12:;
00282 }
00283 }
00284 catch (antlr::RecognitionException& ex) {
00285 if( inputState->guessing == 0 ) {
00286 reportError(ex);
00287 recover(ex,_tokenSet_1);
00288 } else {
00289 throw;
00290 }
00291 }
00292 }
00293
00294 void EDIParser::head_block() {
00295
00296 try {
00297 match(HEAD);
00298 option_list();
00299 }
00300 catch (antlr::RecognitionException& ex) {
00301 if( inputState->guessing == 0 ) {
00302 reportError(ex);
00303 recover(ex,_tokenSet_1);
00304 } else {
00305 throw;
00306 }
00307 }
00308 }
00309
00310 void EDIParser::info_block() {
00311
00312 try {
00313 match(16);
00314 option_list();
00315 }
00316 catch (antlr::RecognitionException& ex) {
00317 if( inputState->guessing == 0 ) {
00318 reportError(ex);
00319 recover(ex,_tokenSet_1);
00320 } else {
00321 throw;
00322 }
00323 }
00324 }
00325
00326 void EDIParser::info_text() {
00327
00328 try {
00329 {
00330 for (;;) {
00331 if ((_tokenSet_2.member(LA(1)))) {
00332 matchNot(SPECIAL);
00333 }
00334 else {
00335 goto _loop17;
00336 }
00337
00338 }
00339 _loop17:;
00340 }
00341 match(SPECIAL);
00342 }
00343 catch (antlr::RecognitionException& ex) {
00344 if( inputState->guessing == 0 ) {
00345 reportError(ex);
00346 recover(ex,_tokenSet_3);
00347 } else {
00348 throw;
00349 }
00350 }
00351 }
00352
00353 void EDIParser::emeas_block() {
00354
00355 try {
00356 match(18);
00357 option_list();
00358 }
00359 catch (antlr::RecognitionException& ex) {
00360 if( inputState->guessing == 0 ) {
00361 reportError(ex);
00362 recover(ex,_tokenSet_4);
00363 } else {
00364 throw;
00365 }
00366 }
00367 }
00368
00369 void EDIParser::hmeas_block() {
00370
00371 try {
00372 match(19);
00373 option_list();
00374 }
00375 catch (antlr::RecognitionException& ex) {
00376 if( inputState->guessing == 0 ) {
00377 reportError(ex);
00378 recover(ex,_tokenSet_4);
00379 } else {
00380 throw;
00381 }
00382 }
00383 }
00384
00385 void EDIParser::def_meas_section() {
00386
00387 try {
00388 match(EQUAL);
00389 match(LITERAL_DEFINEMEAS);
00390 option_list();
00391 {
00392 int _cnt22=0;
00393 for (;;) {
00394 switch ( LA(1)) {
00395 case 18:
00396 {
00397 emeas_block();
00398 break;
00399 }
00400 case 19:
00401 {
00402 hmeas_block();
00403 break;
00404 }
00405 default:
00406 {
00407 if ( _cnt22>=1 ) { goto _loop22; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00408 }
00409 }
00410 _cnt22++;
00411 }
00412 _loop22:;
00413 }
00414 }
00415 catch (antlr::RecognitionException& ex) {
00416 if( inputState->guessing == 0 ) {
00417 reportError(ex);
00418 recover(ex,_tokenSet_5);
00419 } else {
00420 throw;
00421 }
00422 }
00423 }
00424
00425 void EDIParser::spectrasect_block() {
00426
00427 try {
00428 match(SPECIAL);
00429 match(EQUAL);
00430 match(LITERAL_SPECTRASET);
00431 option_list();
00432 {
00433 switch ( LA(1)) {
00434 case 22:
00435 {
00436 match(22);
00437 match(INT);
00438 break;
00439 }
00440 case NUMBER:
00441 {
00442 break;
00443 }
00444 default:
00445 {
00446 throw antlr::NoViableAltException(LT(1), getFilename());
00447 }
00448 }
00449 }
00450 {
00451 int _cnt26=0;
00452 for (;;) {
00453 if ((LA(1) == NUMBER)) {
00454 match(NUMBER);
00455 }
00456 else {
00457 if ( _cnt26>=1 ) { goto _loop26; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00458 }
00459
00460 _cnt26++;
00461 }
00462 _loop26:;
00463 }
00464 }
00465 catch (antlr::RecognitionException& ex) {
00466 if( inputState->guessing == 0 ) {
00467 reportError(ex);
00468 recover(ex,_tokenSet_5);
00469 } else {
00470 throw;
00471 }
00472 }
00473 }
00474
00475 void EDIParser::spectra_block() {
00476
00477 try {
00478 match(SPECIAL);
00479 match(LITERAL_SPECTRA);
00480 option_list();
00481 match(25);
00482 {
00483 int _cnt29=0;
00484 for (;;) {
00485 if ((LA(1) == NUMBER)) {
00486 datavalue();
00487 }
00488 else {
00489 if ( _cnt29>=1 ) { goto _loop29; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00490 }
00491
00492 _cnt29++;
00493 }
00494 _loop29:;
00495 }
00496 }
00497 catch (antlr::RecognitionException& ex) {
00498 if( inputState->guessing == 0 ) {
00499 reportError(ex);
00500 recover(ex,_tokenSet_5);
00501 } else {
00502 throw;
00503 }
00504 }
00505 }
00506
00507 void EDIParser::spectra_section() {
00508
00509 try {
00510 spectrasect_block();
00511 {
00512 for (;;) {
00513 if ((LA(1) == SPECIAL) && (LA(2) == LITERAL_SPECTRA)) {
00514 spectra_block();
00515 }
00516 else {
00517 goto _loop32;
00518 }
00519
00520 }
00521 _loop32:;
00522 }
00523 }
00524 catch (antlr::RecognitionException& ex) {
00525 if( inputState->guessing == 0 ) {
00526 reportError(ex);
00527 recover(ex,_tokenSet_5);
00528 } else {
00529 throw;
00530 }
00531 }
00532 }
00533
00534 void EDIParser::mtsect_block() {
00535
00536 try {
00537 match(SPECIAL);
00538 match(EQUAL);
00539 match(LITERAL_MTSECT);
00540 option_list();
00541 }
00542 catch (antlr::RecognitionException& ex) {
00543 if( inputState->guessing == 0 ) {
00544 reportError(ex);
00545 recover(ex,_tokenSet_6);
00546 } else {
00547 throw;
00548 }
00549 }
00550 }
00551
00552 void EDIParser::mt_complex_data_block() {
00553 #line 113 "EdiParser2.g"
00554 double ldnfreq; int lnfreq; double currvalue; int currindex = 0; pcompdata currvect;
00555 std::complex<double> localconv;
00556 #line 557 "EDIParser.cpp"
00557
00558 try {
00559 {
00560 switch ( LA(1)) {
00561 case 27:
00562 {
00563 match(27);
00564 if ( inputState->guessing==0 ) {
00565 #line 117 "EdiParser2.g"
00566 currvect = &DataXX.Z; localconv = convfactor;
00567 #line 568 "EDIParser.cpp"
00568 }
00569 break;
00570 }
00571 case 28:
00572 {
00573 match(28);
00574 if ( inputState->guessing==0 ) {
00575 #line 118 "EdiParser2.g"
00576 currvect = &DataXX.Z; localconv = I * convfactor;
00577 #line 578 "EDIParser.cpp"
00578 }
00579 break;
00580 }
00581 case 29:
00582 {
00583 match(29);
00584 if ( inputState->guessing==0 ) {
00585 #line 119 "EdiParser2.g"
00586 currvect = &DataXY.Z; localconv = convfactor;
00587 #line 588 "EDIParser.cpp"
00588 }
00589 break;
00590 }
00591 case 30:
00592 {
00593 match(30);
00594 if ( inputState->guessing==0 ) {
00595 #line 120 "EdiParser2.g"
00596 currvect = &DataXY.Z; localconv = I * convfactor;
00597 #line 598 "EDIParser.cpp"
00598 }
00599 break;
00600 }
00601 case 31:
00602 {
00603 match(31);
00604 if ( inputState->guessing==0 ) {
00605 #line 121 "EdiParser2.g"
00606 currvect = &DataYX.Z; localconv = convfactor;
00607 #line 608 "EDIParser.cpp"
00608 }
00609 break;
00610 }
00611 case 32:
00612 {
00613 match(32);
00614 if ( inputState->guessing==0 ) {
00615 #line 122 "EdiParser2.g"
00616 currvect = &DataYX.Z; localconv = I * convfactor;
00617 #line 618 "EDIParser.cpp"
00618 }
00619 break;
00620 }
00621 case 33:
00622 {
00623 match(33);
00624 if ( inputState->guessing==0 ) {
00625 #line 123 "EdiParser2.g"
00626 currvect = &DataYY.Z; localconv = convfactor;
00627 #line 628 "EDIParser.cpp"
00628 }
00629 break;
00630 }
00631 case 34:
00632 {
00633 match(34);
00634 if ( inputState->guessing==0 ) {
00635 #line 124 "EdiParser2.g"
00636 currvect = &DataYY.Z; localconv = I * convfactor;
00637 #line 638 "EDIParser.cpp"
00638 }
00639 break;
00640 }
00641 case 35:
00642 {
00643 match(35);
00644 if ( inputState->guessing==0 ) {
00645 #line 125 "EdiParser2.g"
00646 currvect = &DataZX.Z; localconv = convfactor;
00647 #line 648 "EDIParser.cpp"
00648 }
00649 break;
00650 }
00651 case 36:
00652 {
00653 match(36);
00654 if ( inputState->guessing==0 ) {
00655 #line 126 "EdiParser2.g"
00656 currvect = &DataZX.Z; localconv = I * convfactor;
00657 #line 658 "EDIParser.cpp"
00658 }
00659 break;
00660 }
00661 case 37:
00662 {
00663 match(37);
00664 if ( inputState->guessing==0 ) {
00665 #line 127 "EdiParser2.g"
00666 currvect = &DataZY.Z; localconv = convfactor;
00667 #line 668 "EDIParser.cpp"
00668 }
00669 break;
00670 }
00671 case 38:
00672 {
00673 match(38);
00674 if ( inputState->guessing==0 ) {
00675 #line 128 "EdiParser2.g"
00676 currvect = &DataZY.Z; localconv = I * convfactor;
00677 #line 678 "EDIParser.cpp"
00678 }
00679 break;
00680 }
00681 default:
00682 {
00683 throw antlr::NoViableAltException(LT(1), getFilename());
00684 }
00685 }
00686 }
00687 if ( inputState->guessing==0 ) {
00688 #line 129 "EdiParser2.g"
00689 if (currvect->empty()) currvect->assign(nfreq,0);
00690 #line 691 "EDIParser.cpp"
00691 }
00692 option_list();
00693 match(SLASH);
00694 match(SLASH);
00695 ldnfreq=datavalue();
00696 if ( inputState->guessing==0 ) {
00697 #line 130 "EdiParser2.g"
00698 lnfreq = int(ldnfreq);
00699 #line 700 "EDIParser.cpp"
00700 }
00701 if (!(lnfreq == nfreq))
00702 throw antlr::SemanticException("lnfreq == nfreq");
00703 {
00704 int _cnt37=0;
00705 for (;;) {
00706 if ((LA(1) == NUMBER)) {
00707 currvalue=datavalue();
00708 if ( inputState->guessing==0 ) {
00709 #line 133 "EdiParser2.g"
00710 currvect->at(currindex) += localconv * currvalue; currindex++;
00711 #line 712 "EDIParser.cpp"
00712 }
00713 }
00714 else {
00715 if ( _cnt37>=1 ) { goto _loop37; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00716 }
00717
00718 _cnt37++;
00719 }
00720 _loop37:;
00721 }
00722 if ( inputState->guessing==0 ) {
00723 #line 134 "EdiParser2.g"
00724 #line 725 "EDIParser.cpp"
00725 }
00726 }
00727 catch (antlr::RecognitionException& ex) {
00728 if( inputState->guessing == 0 ) {
00729 reportError(ex);
00730 recover(ex,_tokenSet_7);
00731 } else {
00732 throw;
00733 }
00734 }
00735 }
00736
00737 void EDIParser::mt_real_data_block() {
00738 antlr::RefToken k = antlr::nullToken;
00739 #line 136 "EdiParser2.g"
00740 double ldnfreq; int lnfreq; double currvalue; int currindex = 0; prealdata currvect;
00741 #line 742 "EDIParser.cpp"
00742
00743 try {
00744 {
00745 switch ( LA(1)) {
00746 case 40:
00747 {
00748 match(40);
00749 if ( inputState->guessing==0 ) {
00750 #line 139 "EdiParser2.g"
00751 currvect = &frequency;
00752 #line 753 "EDIParser.cpp"
00753 }
00754 break;
00755 }
00756 case 41:
00757 {
00758 match(41);
00759 if ( inputState->guessing==0 ) {
00760 #line 140 "EdiParser2.g"
00761 currvect = &DataXX.dZ;
00762 #line 763 "EDIParser.cpp"
00763 }
00764 break;
00765 }
00766 case 42:
00767 {
00768 match(42);
00769 if ( inputState->guessing==0 ) {
00770 #line 141 "EdiParser2.g"
00771 currvect = &DataXX.dZ;
00772 #line 773 "EDIParser.cpp"
00773 }
00774 break;
00775 }
00776 case 43:
00777 {
00778 match(43);
00779 if ( inputState->guessing==0 ) {
00780 #line 142 "EdiParser2.g"
00781 currvect = &DataXX.dZ;
00782 #line 783 "EDIParser.cpp"
00783 }
00784 break;
00785 }
00786 case 44:
00787 {
00788 match(44);
00789 if ( inputState->guessing==0 ) {
00790 #line 143 "EdiParser2.g"
00791 currvect = &DataXY.dZ;
00792 #line 793 "EDIParser.cpp"
00793 }
00794 break;
00795 }
00796 case 45:
00797 {
00798 match(45);
00799 if ( inputState->guessing==0 ) {
00800 #line 144 "EdiParser2.g"
00801 currvect = &DataXY.dZ;
00802 #line 803 "EDIParser.cpp"
00803 }
00804 break;
00805 }
00806 case 46:
00807 {
00808 match(46);
00809 if ( inputState->guessing==0 ) {
00810 #line 145 "EdiParser2.g"
00811 currvect = &DataXY.dZ;
00812 #line 813 "EDIParser.cpp"
00813 }
00814 break;
00815 }
00816 case 47:
00817 {
00818 match(47);
00819 if ( inputState->guessing==0 ) {
00820 #line 146 "EdiParser2.g"
00821 currvect = &DataYX.dZ;
00822 #line 823 "EDIParser.cpp"
00823 }
00824 break;
00825 }
00826 case 48:
00827 {
00828 match(48);
00829 if ( inputState->guessing==0 ) {
00830 #line 147 "EdiParser2.g"
00831 currvect = &DataYX.dZ;
00832 #line 833 "EDIParser.cpp"
00833 }
00834 break;
00835 }
00836 case 49:
00837 {
00838 match(49);
00839 if ( inputState->guessing==0 ) {
00840 #line 148 "EdiParser2.g"
00841 currvect = &DataYX.dZ;
00842 #line 843 "EDIParser.cpp"
00843 }
00844 break;
00845 }
00846 case 50:
00847 {
00848 match(50);
00849 if ( inputState->guessing==0 ) {
00850 #line 149 "EdiParser2.g"
00851 currvect = &DataYY.dZ;
00852 #line 853 "EDIParser.cpp"
00853 }
00854 break;
00855 }
00856 case 51:
00857 {
00858 match(51);
00859 if ( inputState->guessing==0 ) {
00860 #line 150 "EdiParser2.g"
00861 currvect = &DataYY.dZ;
00862 #line 863 "EDIParser.cpp"
00863 }
00864 break;
00865 }
00866 case 52:
00867 {
00868 match(52);
00869 if ( inputState->guessing==0 ) {
00870 #line 151 "EdiParser2.g"
00871 currvect = &DataYY.dZ;
00872 #line 873 "EDIParser.cpp"
00873 }
00874 break;
00875 }
00876 case 53:
00877 {
00878 match(53);
00879 if ( inputState->guessing==0 ) {
00880 #line 152 "EdiParser2.g"
00881 currvect = &DataZX.dZ;
00882 #line 883 "EDIParser.cpp"
00883 }
00884 break;
00885 }
00886 case 54:
00887 {
00888 match(54);
00889 if ( inputState->guessing==0 ) {
00890 #line 153 "EdiParser2.g"
00891 currvect = &DataZY.dZ;
00892 #line 893 "EDIParser.cpp"
00893 }
00894 break;
00895 }
00896 case 55:
00897 {
00898 match(55);
00899 if ( inputState->guessing==0 ) {
00900 #line 154 "EdiParser2.g"
00901 currvect = &rotangles;
00902 #line 903 "EDIParser.cpp"
00903 }
00904 break;
00905 }
00906 case KEYWORD:
00907 {
00908 k = LT(1);
00909 match(KEYWORD);
00910 if ( inputState->guessing==0 ) {
00911 #line 155 "EdiParser2.g"
00912 currvect = NULL;
00913 #line 914 "EDIParser.cpp"
00914 }
00915 break;
00916 }
00917 default:
00918 {
00919 throw antlr::NoViableAltException(LT(1), getFilename());
00920 }
00921 }
00922 }
00923 if ( inputState->guessing==0 ) {
00924 #line 156 "EdiParser2.g"
00925 if (currvect != NULL && currvect->empty()) currvect->assign(nfreq,0);
00926 #line 927 "EDIParser.cpp"
00927 }
00928 option_list();
00929 match(SLASH);
00930 match(SLASH);
00931 ldnfreq=datavalue();
00932 if ( inputState->guessing==0 ) {
00933 #line 157 "EdiParser2.g"
00934 lnfreq = int(ldnfreq);
00935 #line 936 "EDIParser.cpp"
00936 }
00937 {
00938 int _cnt41=0;
00939 for (;;) {
00940 if ((LA(1) == NUMBER)) {
00941 currvalue=datavalue();
00942 if ( inputState->guessing==0 ) {
00943 #line 159 "EdiParser2.g"
00944 if (currvect != NULL)
00945 if ((currvect != &frequency) && (currvect != &rotangles))
00946 currvect->at(currindex) = sqrt(currvalue);
00947 else
00948 currvect->at(currindex) = currvalue;
00949 currindex++;
00950 #line 951 "EDIParser.cpp"
00951 }
00952 }
00953 else {
00954 if ( _cnt41>=1 ) { goto _loop41; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00955 }
00956
00957 _cnt41++;
00958 }
00959 _loop41:;
00960 }
00961 }
00962 catch (antlr::RecognitionException& ex) {
00963 if( inputState->guessing == 0 ) {
00964 reportError(ex);
00965 recover(ex,_tokenSet_7);
00966 } else {
00967 throw;
00968 }
00969 }
00970 }
00971
00972 void EDIParser::mt_section() {
00973
00974 try {
00975 mtsect_block();
00976 {
00977 int _cnt46=0;
00978 for (;;) {
00979 if ((_tokenSet_6.member(LA(1)))) {
00980 {
00981 switch ( LA(1)) {
00982 case COMMENT:
00983 {
00984 match(COMMENT);
00985 break;
00986 }
00987 case 27:
00988 case 28:
00989 case 29:
00990 case 30:
00991 case 31:
00992 case 32:
00993 case 33:
00994 case 34:
00995 case 35:
00996 case 36:
00997 case 37:
00998 case 38:
00999 case 40:
01000 case 41:
01001 case 42:
01002 case 43:
01003 case 44:
01004 case 45:
01005 case 46:
01006 case 47:
01007 case 48:
01008 case 49:
01009 case 50:
01010 case 51:
01011 case 52:
01012 case 53:
01013 case 54:
01014 case 55:
01015 case KEYWORD:
01016 {
01017 break;
01018 }
01019 default:
01020 {
01021 throw antlr::NoViableAltException(LT(1), getFilename());
01022 }
01023 }
01024 }
01025 {
01026 switch ( LA(1)) {
01027 case 40:
01028 case 41:
01029 case 42:
01030 case 43:
01031 case 44:
01032 case 45:
01033 case 46:
01034 case 47:
01035 case 48:
01036 case 49:
01037 case 50:
01038 case 51:
01039 case 52:
01040 case 53:
01041 case 54:
01042 case 55:
01043 case KEYWORD:
01044 {
01045 mt_real_data_block();
01046 break;
01047 }
01048 case 27:
01049 case 28:
01050 case 29:
01051 case 30:
01052 case 31:
01053 case 32:
01054 case 33:
01055 case 34:
01056 case 35:
01057 case 36:
01058 case 37:
01059 case 38:
01060 {
01061 mt_complex_data_block();
01062 break;
01063 }
01064 default:
01065 {
01066 throw antlr::NoViableAltException(LT(1), getFilename());
01067 }
01068 }
01069 }
01070 }
01071 else {
01072 if ( _cnt46>=1 ) { goto _loop46; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
01073 }
01074
01075 _cnt46++;
01076 }
01077 _loop46:;
01078 }
01079 }
01080 catch (antlr::RecognitionException& ex) {
01081 if( inputState->guessing == 0 ) {
01082 reportError(ex);
01083 recover(ex,_tokenSet_5);
01084 } else {
01085 throw;
01086 }
01087 }
01088 }
01089
01090 void EDIParser::end_block() {
01091
01092 try {
01093 match(58);
01094 }
01095 catch (antlr::RecognitionException& ex) {
01096 if( inputState->guessing == 0 ) {
01097 reportError(ex);
01098 recover(ex,_tokenSet_8);
01099 } else {
01100 throw;
01101 }
01102 }
01103 }
01104
01105 void EDIParser::edi_file() {
01106 #line 184 "EdiParser2.g"
01107
01108 zassigned = false;
01109 rassigned = false;
01110 tassigned = false;
01111 latitude = 0;
01112 longitude =0;
01113 elevation = 0;
01114 azimuth = 0;
01115 nfreq = 0;
01116 convfactor = 1.;
01117 name = "default";
01118 DataXX.name = "zxx";
01119 DataXY.name = "zxy";
01120 DataYX.name = "zyx";
01121 DataYY.name = "zyy";
01122 DataZX.name = "tzx";
01123 DataZY.name = "tzy";
01124
01125 #line 1126 "EDIParser.cpp"
01126
01127 try {
01128 head_block();
01129 {
01130 if ((LA(1) == 16) && ((LA(2) >= LITERAL_NFREQ && LA(2) <= REAL)) && ((LA(3) >= LITERAL_NFREQ && LA(3) <= REAL)) && ((LA(4) >= LITERAL_NFREQ && LA(4) <= REAL)) && ((LA(5) >= LITERAL_NFREQ && LA(5) <= REAL)) && (_tokenSet_0.member(LA(6))) && (_tokenSet_0.member(LA(7))) && (_tokenSet_0.member(LA(8))) && (_tokenSet_0.member(LA(9))) && (_tokenSet_0.member(LA(10)))) {
01131 info_block();
01132 }
01133 else if (((LA(1) >= LITERAL_NFREQ && LA(1) <= REAL)) && ((LA(2) >= LITERAL_NFREQ && LA(2) <= REAL)) && ((LA(3) >= LITERAL_NFREQ && LA(3) <= REAL)) && ((LA(4) >= LITERAL_NFREQ && LA(4) <= REAL)) && (_tokenSet_0.member(LA(5))) && (_tokenSet_0.member(LA(6))) && (_tokenSet_0.member(LA(7))) && (_tokenSet_0.member(LA(8))) && (_tokenSet_0.member(LA(9))) && (_tokenSet_0.member(LA(10)))) {
01134 }
01135 else {
01136 throw antlr::NoViableAltException(LT(1), getFilename());
01137 }
01138
01139 }
01140 {
01141 if (((LA(1) >= LITERAL_NFREQ && LA(1) <= REAL)) && ((LA(2) >= LITERAL_NFREQ && LA(2) <= REAL)) && ((LA(3) >= LITERAL_NFREQ && LA(3) <= REAL)) && ((LA(4) >= LITERAL_NFREQ && LA(4) <= REAL)) && ((LA(5) >= LITERAL_NFREQ && LA(5) <= REAL)) && (_tokenSet_0.member(LA(6))) && (_tokenSet_0.member(LA(7))) && (_tokenSet_0.member(LA(8))) && (_tokenSet_0.member(LA(9))) && (_tokenSet_0.member(LA(10)))) {
01142 info_text();
01143 }
01144 else if ((LA(1) == EQUAL) && (LA(2) == LITERAL_DEFINEMEAS) && (_tokenSet_9.member(LA(3))) && (_tokenSet_10.member(LA(4))) && (_tokenSet_11.member(LA(5))) && (_tokenSet_12.member(LA(6))) && (_tokenSet_13.member(LA(7))) && (_tokenSet_14.member(LA(8))) && (_tokenSet_15.member(LA(9))) && (_tokenSet_16.member(LA(10)))) {
01145 }
01146 else {
01147 throw antlr::NoViableAltException(LT(1), getFilename());
01148 }
01149
01150 }
01151 def_meas_section();
01152 {
01153 for (;;) {
01154 if ((LA(1) == SPECIAL) && (LA(2) == EQUAL) && (LA(3) == LITERAL_SPECTRASET)) {
01155 spectra_section();
01156 }
01157 else if ((LA(1) == SPECIAL) && (LA(2) == EQUAL) && (LA(3) == LITERAL_MTSECT)) {
01158 mt_section();
01159 }
01160 else {
01161 goto _loop52;
01162 }
01163
01164 }
01165 _loop52:;
01166 }
01167 end_block();
01168 }
01169 catch (antlr::RecognitionException& ex) {
01170 if( inputState->guessing == 0 ) {
01171 reportError(ex);
01172 recover(ex,_tokenSet_8);
01173 } else {
01174 throw;
01175 }
01176 }
01177 }
01178
01179 void EDIParser::initializeASTFactory( antlr::ASTFactory& )
01180 {
01181 }
01182 const char* EDIParser::tokenNames[] = {
01183 "<0>",
01184 "EOF",
01185 "<2>",
01186 "NULL_TREE_LOOKAHEAD",
01187 "\"NFREQ\"",
01188 "\"LATITUDE\"",
01189 "\"LONGITUDE\"",
01190 "\"AZIMUTH\"",
01191 "\"ELEVATION\"",
01192 "\"REFLONG\"",
01193 "\"REFLAT\"",
01194 "STRING",
01195 "EQUAL",
01196 "DATE",
01197 "NUMBER",
01198 "HEAD",
01199 "\">INFO\"",
01200 "SPECIAL",
01201 "\">EMEAS\"",
01202 "\">HMEAS\"",
01203 "\"DEFINEMEAS\"",
01204 "\"SPECTRASET\"",
01205 "\"//\"",
01206 "INT",
01207 "\"SPECTRA\"",
01208 "\";\"",
01209 "\"MTSECT\"",
01210 "\">ZXXR\"",
01211 "\">ZXXI\"",
01212 "\">ZXYR\"",
01213 "\">ZXYI\"",
01214 "\">ZYXR\"",
01215 "\">ZYXI\"",
01216 "\">ZYYR\"",
01217 "\">ZYYI\"",
01218 "\">TXR.EXP\"",
01219 "\">TXI.EXP\"",
01220 "\">TYR.EXP\"",
01221 "\">TYI.EXP\"",
01222 "SLASH",
01223 "\">FREQ\"",
01224 "\">ZXXR.VAR\"",
01225 "\">ZXXI.VAR\"",
01226 "\">ZXX.VAR\"",
01227 "\">ZXYR.VAR\"",
01228 "\">ZXYI.VAR\"",
01229 "\">ZXY.VAR\"",
01230 "\">ZYXR.VAR\"",
01231 "\">ZYXI.VAR\"",
01232 "\">ZYX.VAR\"",
01233 "\">ZYYR.VAR\"",
01234 "\">ZYYI.VAR\"",
01235 "\">ZYY.VAR\"",
01236 "\">TXVAR.EXP\"",
01237 "\">TYVAR.EXP\"",
01238 "\">ZROT\"",
01239 "KEYWORD",
01240 "COMMENT",
01241 "\">END\"",
01242 "COLON",
01243 "WS",
01244 "EXKL",
01245 "DIGIT",
01246 "LETTER",
01247 "OTHER",
01248 "LEGAL_CHAR",
01249 "SIGN",
01250 "REAL",
01251 0
01252 };
01253
01254 const unsigned long EDIParser::_tokenSet_0_data_[] = { 4294967282UL, 4294967295UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL };
01255
01256
01257
01258
01259
01260
01261
01262
01263 const antlr::BitSet EDIParser::_tokenSet_0(_tokenSet_0_data_,8);
01264 const unsigned long EDIParser::_tokenSet_1_data_[] = { 4294967280UL, 4294967295UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL };
01265
01266
01267
01268
01269
01270
01271
01272
01273 const antlr::BitSet EDIParser::_tokenSet_1(_tokenSet_1_data_,8);
01274 const unsigned long EDIParser::_tokenSet_2_data_[] = { 4294836208UL, 4294967295UL, 15UL, 0UL, 0UL, 0UL, 0UL, 0UL };
01275
01276
01277
01278
01279
01280
01281
01282
01283 const antlr::BitSet EDIParser::_tokenSet_2(_tokenSet_2_data_,8);
01284 const unsigned long EDIParser::_tokenSet_3_data_[] = { 4096UL, 0UL, 0UL, 0UL };
01285
01286 const antlr::BitSet EDIParser::_tokenSet_3(_tokenSet_3_data_,4);
01287 const unsigned long EDIParser::_tokenSet_4_data_[] = { 917504UL, 67108864UL, 0UL, 0UL };
01288
01289 const antlr::BitSet EDIParser::_tokenSet_4(_tokenSet_4_data_,4);
01290 const unsigned long EDIParser::_tokenSet_5_data_[] = { 131072UL, 67108864UL, 0UL, 0UL };
01291
01292 const antlr::BitSet EDIParser::_tokenSet_5(_tokenSet_5_data_,4);
01293 const unsigned long EDIParser::_tokenSet_6_data_[] = { 4160749568UL, 67108735UL, 0UL, 0UL };
01294
01295
01296
01297
01298
01299 const antlr::BitSet EDIParser::_tokenSet_6(_tokenSet_6_data_,4);
01300 const unsigned long EDIParser::_tokenSet_7_data_[] = { 4160880640UL, 134217599UL, 0UL, 0UL };
01301
01302
01303
01304
01305
01306 const antlr::BitSet EDIParser::_tokenSet_7(_tokenSet_7_data_,4);
01307 const unsigned long EDIParser::_tokenSet_8_data_[] = { 2UL, 0UL, 0UL, 0UL };
01308
01309 const antlr::BitSet EDIParser::_tokenSet_8(_tokenSet_8_data_,4);
01310 const unsigned long EDIParser::_tokenSet_9_data_[] = { 790512UL, 0UL, 0UL, 0UL };
01311
01312
01313 const antlr::BitSet EDIParser::_tokenSet_9(_tokenSet_9_data_,4);
01314 const unsigned long EDIParser::_tokenSet_10_data_[] = { 925680UL, 67108864UL, 0UL, 0UL };
01315
01316
01317 const antlr::BitSet EDIParser::_tokenSet_10(_tokenSet_10_data_,4);
01318 const unsigned long EDIParser::_tokenSet_11_data_[] = { 950258UL, 67108864UL, 0UL, 0UL };
01319
01320
01321 const antlr::BitSet EDIParser::_tokenSet_11(_tokenSet_11_data_,4);
01322 const unsigned long EDIParser::_tokenSet_12_data_[] = { 70156274UL, 201326592UL, 0UL, 0UL };
01323
01324
01325
01326 const antlr::BitSet EDIParser::_tokenSet_12(_tokenSet_12_data_,4);
01327 const unsigned long EDIParser::_tokenSet_13_data_[] = { 4235100146UL, 268435327UL, 0UL, 0UL };
01328
01329
01330
01331
01332
01333
01334
01335 const antlr::BitSet EDIParser::_tokenSet_13(_tokenSet_13_data_,4);
01336 const unsigned long EDIParser::_tokenSet_14_data_[] = { 4243488754UL, 268435455UL, 0UL, 0UL };
01337
01338
01339
01340
01341
01342
01343
01344 const antlr::BitSet EDIParser::_tokenSet_14(_tokenSet_14_data_,4);
01345 const unsigned long EDIParser::_tokenSet_15_data_[] = { 4260265970UL, 268435455UL, 0UL, 0UL };
01346
01347
01348
01349
01350
01351
01352
01353 const antlr::BitSet EDIParser::_tokenSet_15(_tokenSet_15_data_,4);
01354 const unsigned long EDIParser::_tokenSet_16_data_[] = { 4293820402UL, 268435455UL, 0UL, 0UL };
01355
01356
01357
01358
01359
01360
01361
01362 const antlr::BitSet EDIParser::_tokenSet_16(_tokenSet_16_data_,4);
01363
01364