#include <EDIParser.hpp>
Inheritance diagram for EDIParser:


Public Member Functions | |
| void | initializeASTFactory (antlr::ASTFactory &factory) |
| EDIParser (antlr::TokenBuffer &tokenBuf) | |
| EDIParser (antlr::TokenStream &lexer) | |
| EDIParser (const antlr::ParserSharedInputState &state) | |
| int | getNumTokens () const |
| const char * | getTokenName (int type) const |
| const char *const * | getTokenNames () const |
| void | option () |
| double | lat_long () |
| double | datavalue () |
| void | option_list () |
| void | head_block () |
| void | info_block () |
| void | info_text () |
| void | emeas_block () |
| void | hmeas_block () |
| void | def_meas_section () |
| void | spectrasect_block () |
| void | spectra_block () |
| void | spectra_section () |
| void | mtsect_block () |
| void | mt_complex_data_block () |
| void | mt_real_data_block () |
| void | mt_section () |
| void | end_block () |
| void | edi_file () |
| antlr::RefAST | getAST () |
Public Attributes | |
| trealdata | frequency |
| trealdata | rotangles |
| CMTDataComp | DataXX |
| CMTDataComp | DataXY |
| CMTDataComp | DataYX |
| CMTDataComp | DataYY |
| CMTDataComp | DataZX |
| CMTDataComp | DataZY |
| double | latitude |
| double | longitude |
| double | elevation |
| double | azimuth |
| std::string | name |
| bool | tassigned |
| bool | zassigned |
| bool | rassigned |
Protected Member Functions | |
| EDIParser (antlr::TokenBuffer &tokenBuf, int k) | |
| EDIParser (antlr::TokenStream &lexer, int k) | |
Protected Attributes | |
| antlr::RefAST | returnAST |
Definition at line 20 of file EDIParser.hpp.
| EDIParser::EDIParser | ( | antlr::TokenBuffer & | tokenBuf, | |
| int | k | |||
| ) | [protected] |
| EDIParser::EDIParser | ( | antlr::TokenBuffer & | tokenBuf | ) |
| EDIParser::EDIParser | ( | antlr::TokenStream & | lexer, | |
| int | k | |||
| ) | [protected] |
| EDIParser::EDIParser | ( | antlr::TokenStream & | lexer | ) |
| EDIParser::EDIParser | ( | const antlr::ParserSharedInputState & | state | ) |
| void EDIParser::initializeASTFactory | ( | antlr::ASTFactory & | factory | ) |
| int EDIParser::getNumTokens | ( | ) | const [inline] |
| const char* EDIParser::getTokenName | ( | int | type | ) | const [inline] |
Definition at line 64 of file EDIParser.hpp.
00065 { 00066 if( type > getNumTokens() ) return 0; 00067 return EDIParser::tokenNames[type]; 00068 }
| const char* const* EDIParser::getTokenNames | ( | ) | const [inline] |
| void EDIParser::option | ( | ) |
Definition at line 33 of file EDIParser.cpp.
References azimuth, COLON, datavalue(), DATE, elevation, EQUAL, lat_long(), latitude, LITERAL_AZIMUTH, LITERAL_ELEVATION, LITERAL_LATITUDE, LITERAL_LONGITUDE, LITERAL_NFREQ, LITERAL_REFLAT, LITERAL_REFLONG, longitude, NUMBER, REAL, and STRING.
Referenced by option_list().
00033 { 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 { // for error handling 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 }
Here is the call graph for this function:

| double EDIParser::lat_long | ( | ) |
Definition at line 206 of file EDIParser.cpp.
References COLON, and datavalue().
Referenced by option().
00206 { 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 { // for error handling 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 }
Here is the call graph for this function:

| double EDIParser::datavalue | ( | ) |
Definition at line 242 of file EDIParser.cpp.
References NUMBER.
Referenced by lat_long(), mt_complex_data_block(), mt_real_data_block(), option(), and spectra_block().
00242 { 00243 #line 221 "EdiParser2.g" 00244 double r; 00245 #line 246 "EDIParser.cpp" 00246 antlr::RefToken currvalue = antlr::nullToken; 00247 00248 try { // for error handling 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 }
| void EDIParser::option_list | ( | ) |
Definition at line 268 of file EDIParser.cpp.
References DATE, EQUAL, LITERAL_NFREQ, NUMBER, option(), REAL, and STRING.
Referenced by def_meas_section(), emeas_block(), head_block(), hmeas_block(), info_block(), mt_complex_data_block(), mt_real_data_block(), mtsect_block(), spectra_block(), and spectrasect_block().
00268 { 00269 00270 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::head_block | ( | ) |
Definition at line 294 of file EDIParser.cpp.
References HEAD, and option_list().
Referenced by edi_file().
00294 { 00295 00296 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::info_block | ( | ) |
Definition at line 310 of file EDIParser.cpp.
References option_list().
Referenced by edi_file().
00310 { 00311 00312 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::info_text | ( | ) |
Definition at line 326 of file EDIParser.cpp.
References SPECIAL.
Referenced by edi_file().
00326 { 00327 00328 try { // for error handling 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 }
| void EDIParser::emeas_block | ( | ) |
Definition at line 353 of file EDIParser.cpp.
References option_list().
Referenced by def_meas_section().
00353 { 00354 00355 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::hmeas_block | ( | ) |
Definition at line 369 of file EDIParser.cpp.
References option_list().
Referenced by def_meas_section().
00369 { 00370 00371 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::def_meas_section | ( | ) |
Definition at line 385 of file EDIParser.cpp.
References emeas_block(), EQUAL, hmeas_block(), LITERAL_DEFINEMEAS, and option_list().
Referenced by edi_file().
00385 { 00386 00387 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::spectrasect_block | ( | ) |
Definition at line 425 of file EDIParser.cpp.
References EQUAL, INT, LITERAL_SPECTRASET, NUMBER, option_list(), and SPECIAL.
Referenced by spectra_section().
00425 { 00426 00427 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::spectra_block | ( | ) |
Definition at line 475 of file EDIParser.cpp.
References datavalue(), LITERAL_SPECTRA, NUMBER, option_list(), and SPECIAL.
Referenced by spectra_section().
00475 { 00476 00477 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::spectra_section | ( | ) |
Definition at line 507 of file EDIParser.cpp.
References LITERAL_SPECTRA, SPECIAL, spectra_block(), and spectrasect_block().
Referenced by edi_file().
00507 { 00508 00509 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::mtsect_block | ( | ) |
Definition at line 534 of file EDIParser.cpp.
References EQUAL, LITERAL_MTSECT, option_list(), and SPECIAL.
Referenced by mt_section().
00534 { 00535 00536 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::mt_complex_data_block | ( | ) |
Definition at line 552 of file EDIParser.cpp.
References datavalue(), DataXX, DataXY, DataYX, DataYY, DataZX, DataZY, NUMBER, option_list(), SLASH, and CMTDataComp::Z.
Referenced by mt_section().
00552 { 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 { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::mt_real_data_block | ( | ) |
Definition at line 737 of file EDIParser.cpp.
References datavalue(), DataXX, DataXY, DataYX, DataYY, DataZX, DataZY, CMTDataComp::dZ, frequency, KEYWORD, NUMBER, option_list(), rotangles, and SLASH.
Referenced by mt_section().
00737 { 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 { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::mt_section | ( | ) |
Definition at line 972 of file EDIParser.cpp.
References COMMENT, KEYWORD, mt_complex_data_block(), mt_real_data_block(), and mtsect_block().
Referenced by edi_file().
00972 { 00973 00974 try { // for error handling 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 }
Here is the call graph for this function:

| void EDIParser::end_block | ( | ) |
Definition at line 1090 of file EDIParser.cpp.
Referenced by edi_file().
01090 { 01091 01092 try { // for error handling 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 }
| void EDIParser::edi_file | ( | ) |
Definition at line 1105 of file EDIParser.cpp.
References azimuth, DataXX, DataXY, DataYX, DataYY, DataZX, DataZY, def_meas_section(), elevation, end_block(), EQUAL, head_block(), info_block(), info_text(), latitude, LITERAL_DEFINEMEAS, LITERAL_MTSECT, LITERAL_NFREQ, LITERAL_SPECTRASET, longitude, mt_section(), CMTDataComp::name, name, rassigned, REAL, SPECIAL, spectra_section(), tassigned, and zassigned.
01105 { 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 { // for error handling 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 }
Here is the call graph for this function:

| antlr::RefAST EDIParser::getAST | ( | ) | [inline] |
| trealdata EDIParser::frequency |
| trealdata EDIParser::rotangles |
Definition at line 34 of file EDIParser.hpp.
Referenced by edi_file(), mt_complex_data_block(), and mt_real_data_block().
Definition at line 35 of file EDIParser.hpp.
Referenced by edi_file(), mt_complex_data_block(), and mt_real_data_block().
Definition at line 36 of file EDIParser.hpp.
Referenced by edi_file(), mt_complex_data_block(), and mt_real_data_block().
Definition at line 37 of file EDIParser.hpp.
Referenced by edi_file(), mt_complex_data_block(), and mt_real_data_block().
Definition at line 38 of file EDIParser.hpp.
Referenced by edi_file(), mt_complex_data_block(), and mt_real_data_block().
Definition at line 39 of file EDIParser.hpp.
Referenced by edi_file(), mt_complex_data_block(), and mt_real_data_block().
| double EDIParser::latitude |
Definition at line 40 of file EDIParser.hpp.
Referenced by edi_file(), CMTStation::operator=(), option(), and CMTStation::WriteAsJ().
| double EDIParser::longitude |
Definition at line 41 of file EDIParser.hpp.
Referenced by edi_file(), CMTStation::operator=(), option(), and CMTStation::WriteAsJ().
| double EDIParser::elevation |
Definition at line 42 of file EDIParser.hpp.
Referenced by edi_file(), CMTStation::operator=(), option(), and CMTStation::WriteAsJ().
| double EDIParser::azimuth |
Definition at line 43 of file EDIParser.hpp.
Referenced by edi_file(), CMTStation::operator=(), option(), and CMTStation::WriteAsJ().
| std::string EDIParser::name |
Definition at line 44 of file EDIParser.hpp.
Referenced by edi_file(), CMTStation::operator=(), CMTStation::WriteAsJ(), CMTStation::WriteBack(), and CMTStation::WriteData().
| bool EDIParser::tassigned |
| bool EDIParser::zassigned |
| bool EDIParser::rassigned |
antlr::RefAST EDIParser::returnAST [protected] |
Definition at line 99 of file EDIParser.hpp.
1.5.1