MakeInputConfParser.cpp

Go to the documentation of this file.
00001 /* $ANTLR 2.7.6 (20070220): "MakeInputConf.g" -> "MakeInputConfParser.cpp"$ */
00002 #include "MakeInputConfParser.hpp"
00003 #include <antlr/NoViableAltException.hpp>
00004 #include <antlr/SemanticException.hpp>
00005 #include <antlr/ASTFactory.hpp>
00006 #line 1 "MakeInputConf.g"
00007 #line 8 "MakeInputConfParser.cpp"
00008 MakeInputConfParser::MakeInputConfParser(antlr::TokenBuffer& tokenBuf, int k)
00009 : antlr::LLkParser(tokenBuf,k)
00010 {
00011 }
00012 
00013 MakeInputConfParser::MakeInputConfParser(antlr::TokenBuffer& tokenBuf)
00014 : antlr::LLkParser(tokenBuf,10)
00015 {
00016 }
00017 
00018 MakeInputConfParser::MakeInputConfParser(antlr::TokenStream& lexer, int k)
00019 : antlr::LLkParser(lexer,k)
00020 {
00021 }
00022 
00023 MakeInputConfParser::MakeInputConfParser(antlr::TokenStream& lexer)
00024 : antlr::LLkParser(lexer,10)
00025 {
00026 }
00027 
00028 MakeInputConfParser::MakeInputConfParser(const antlr::ParserSharedInputState& state)
00029 : antlr::LLkParser(state,10)
00030 {
00031 }
00032 
00033 void MakeInputConfParser::configentry() {
00034         
00035         try {      // for error handling
00036                 {
00037                 switch ( LA(1)) {
00038                 case SLOWNESST:
00039                 {
00040                         match(SLOWNESST);
00041                         match(EQUAL);
00042                         slowness=numvalue();
00043                         break;
00044                 }
00045                 case OMEGAT:
00046                 {
00047                         match(OMEGAT);
00048                         match(EQUAL);
00049                         omega=numvalue();
00050                         break;
00051                 }
00052                 case SIGMAT:
00053                 {
00054                         match(SIGMAT);
00055                         match(EQUAL);
00056                         sigma=numvalue();
00057                         break;
00058                 }
00059                 case SHIFTT:
00060                 {
00061                         match(SHIFTT);
00062                         match(EQUAL);
00063                         shift=numvalue();
00064                         break;
00065                 }
00066                 case CCT:
00067                 {
00068                         match(CCT);
00069                         match(EQUAL);
00070                         cc=numvalue();
00071                         break;
00072                 }
00073                 case POISSONT:
00074                 {
00075                         match(POISSONT);
00076                         match(EQUAL);
00077                         poisson=numvalue();
00078                         break;
00079                 }
00080                 case NLAYERST:
00081                 {
00082                         match(NLAYERST);
00083                         match(EQUAL);
00084                         nlayers=numvalue();
00085                         break;
00086                 }
00087                 case OUTPUTBASET:
00088                 {
00089                         match(OUTPUTBASET);
00090                         match(EQUAL);
00091                         outputbase=stringvalue();
00092                         break;
00093                 }
00094                 case CORRELATEDT:
00095                 {
00096                         match(CORRELATEDT);
00097                         match(EQUAL);
00098                         correlated=boolvalue();
00099                         break;
00100                 }
00101                 case DTT:
00102                 {
00103                         match(DTT);
00104                         match(EQUAL);
00105                         dt=numvalue();
00106                         break;
00107                 }
00108                 case NPTST:
00109                 {
00110                         match(NPTST);
00111                         match(EQUAL);
00112                         npts=numvalue();
00113                         break;
00114                 }
00115                 default:
00116                 {
00117                         throw antlr::NoViableAltException(LT(1), getFilename());
00118                 }
00119                 }
00120                 }
00121         }
00122         catch (antlr::RecognitionException& ex) {
00123                 if( inputState->guessing == 0 ) {
00124                         reportError(ex);
00125                         recover(ex,_tokenSet_0);
00126                 } else {
00127                         throw;
00128                 }
00129         }
00130 }
00131 
00132 double  MakeInputConfParser::numvalue() {
00133 #line 55 "MakeInputConf.g"
00134         double r;
00135 #line 136 "MakeInputConfParser.cpp"
00136         antlr::RefToken  currvalue = antlr::nullToken;
00137         
00138         try {      // for error handling
00139                 currvalue = LT(1);
00140                 match(NUMBER);
00141                 if ( inputState->guessing==0 ) {
00142 #line 56 "MakeInputConf.g"
00143                         r = atof(currvalue->getText().c_str());
00144 #line 145 "MakeInputConfParser.cpp"
00145                 }
00146         }
00147         catch (antlr::RecognitionException& ex) {
00148                 if( inputState->guessing == 0 ) {
00149                         reportError(ex);
00150                         recover(ex,_tokenSet_0);
00151                 } else {
00152                         throw;
00153                 }
00154         }
00155         return r;
00156 }
00157 
00158 std::string  MakeInputConfParser::stringvalue() {
00159 #line 63 "MakeInputConf.g"
00160         std::string r;
00161 #line 162 "MakeInputConfParser.cpp"
00162         antlr::RefToken  currvalue = antlr::nullToken;
00163         
00164         try {      // for error handling
00165                 currvalue = LT(1);
00166                 match(STRING);
00167                 if ( inputState->guessing==0 ) {
00168 #line 64 "MakeInputConf.g"
00169                         r = currvalue->getText();
00170 #line 171 "MakeInputConfParser.cpp"
00171                 }
00172         }
00173         catch (antlr::RecognitionException& ex) {
00174                 if( inputState->guessing == 0 ) {
00175                         reportError(ex);
00176                         recover(ex,_tokenSet_0);
00177                 } else {
00178                         throw;
00179                 }
00180         }
00181         return r;
00182 }
00183 
00184 bool  MakeInputConfParser::boolvalue() {
00185 #line 59 "MakeInputConf.g"
00186         bool r;
00187 #line 188 "MakeInputConfParser.cpp"
00188         
00189         try {      // for error handling
00190                 {
00191                 switch ( LA(1)) {
00192                 case TRUE:
00193                 {
00194                         match(TRUE);
00195                         if ( inputState->guessing==0 ) {
00196 #line 60 "MakeInputConf.g"
00197                                 r = true;
00198 #line 199 "MakeInputConfParser.cpp"
00199                         }
00200                         break;
00201                 }
00202                 case FALSE:
00203                 {
00204                         match(FALSE);
00205                         if ( inputState->guessing==0 ) {
00206 #line 60 "MakeInputConf.g"
00207                                 r = false;
00208 #line 209 "MakeInputConfParser.cpp"
00209                         }
00210                         break;
00211                 }
00212                 default:
00213                 {
00214                         throw antlr::NoViableAltException(LT(1), getFilename());
00215                 }
00216                 }
00217                 }
00218         }
00219         catch (antlr::RecognitionException& ex) {
00220                 if( inputState->guessing == 0 ) {
00221                         reportError(ex);
00222                         recover(ex,_tokenSet_0);
00223                 } else {
00224                         throw;
00225                 }
00226         }
00227         return r;
00228 }
00229 
00230 void MakeInputConfParser::configfile() {
00231 #line 50 "MakeInputConf.g"
00232         
00233         
00234 #line 235 "MakeInputConfParser.cpp"
00235         
00236         try {      // for error handling
00237                 { // ( ... )+
00238                 int _cnt48=0;
00239                 for (;;) {
00240                         if ((_tokenSet_1.member(LA(1)))) {
00241                                 configentry();
00242                                 {
00243                                 if ((LA(1) == COMMENT) && (_tokenSet_0.member(LA(2))) && (LA(3) == antlr::Token::EOF_TYPE || LA(3) == EQUAL || LA(3) == COMMENT) && (_tokenSet_2.member(LA(4))) && (_tokenSet_0.member(LA(5))) && (_tokenSet_3.member(LA(6))) && (_tokenSet_4.member(LA(7))) && (_tokenSet_5.member(LA(8))) && (_tokenSet_3.member(LA(9))) && (_tokenSet_6.member(LA(10)))) {
00244                                         match(COMMENT);
00245                                 }
00246                                 else if ((_tokenSet_0.member(LA(1))) && (LA(2) == antlr::Token::EOF_TYPE || LA(2) == EQUAL || LA(2) == COMMENT) && (_tokenSet_2.member(LA(3))) && (_tokenSet_0.member(LA(4))) && (_tokenSet_3.member(LA(5))) && (_tokenSet_4.member(LA(6))) && (_tokenSet_5.member(LA(7))) && (_tokenSet_3.member(LA(8))) && (_tokenSet_6.member(LA(9))) && (_tokenSet_6.member(LA(10)))) {
00247                                 }
00248                                 else {
00249                                         throw antlr::NoViableAltException(LT(1), getFilename());
00250                                 }
00251                                 
00252                                 }
00253                         }
00254                         else {
00255                                 if ( _cnt48>=1 ) { goto _loop48; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00256                         }
00257                         
00258                         _cnt48++;
00259                 }
00260                 _loop48:;
00261                 }  // ( ... )+
00262                 { // ( ... )*
00263                 for (;;) {
00264                         if ((LA(1) == COMMENT)) {
00265                                 match(COMMENT);
00266                         }
00267                         else {
00268                                 goto _loop50;
00269                         }
00270                         
00271                 }
00272                 _loop50:;
00273                 } // ( ... )*
00274                 match(antlr::Token::EOF_TYPE);
00275         }
00276         catch (antlr::RecognitionException& ex) {
00277                 if( inputState->guessing == 0 ) {
00278                         reportError(ex);
00279                         recover(ex,_tokenSet_7);
00280                 } else {
00281                         throw;
00282                 }
00283         }
00284 }
00285 
00286 void MakeInputConfParser::initializeASTFactory( antlr::ASTFactory& )
00287 {
00288 }
00289 const char* MakeInputConfParser::tokenNames[] = {
00290         "<0>",
00291         "EOF",
00292         "<2>",
00293         "NULL_TREE_LOOKAHEAD",
00294         "SLOWNESST",
00295         "EQUAL",
00296         "NUMBER",
00297         "OMEGAT",
00298         "SIGMAT",
00299         "SHIFTT",
00300         "CCT",
00301         "POISSONT",
00302         "NLAYERST",
00303         "OUTPUTBASET",
00304         "STRING",
00305         "CORRELATEDT",
00306         "DTT",
00307         "NPTST",
00308         "COMMENT",
00309         "TRUE",
00310         "FALSE",
00311         "WS",
00312         "NEWLINE",
00313         "REAL",
00314         "INT",
00315         "DIGIT",
00316         "CHAR",
00317         "OTHER",
00318         0
00319 };
00320 
00321 const unsigned long MakeInputConfParser::_tokenSet_0_data_[] = { 507794UL, 0UL, 0UL, 0UL };
00322 // EOF SLOWNESST OMEGAT SIGMAT SHIFTT CCT POISSONT NLAYERST OUTPUTBASET 
00323 // CORRELATEDT DTT NPTST COMMENT 
00324 const antlr::BitSet MakeInputConfParser::_tokenSet_0(_tokenSet_0_data_,4);
00325 const unsigned long MakeInputConfParser::_tokenSet_1_data_[] = { 245648UL, 0UL, 0UL, 0UL };
00326 // SLOWNESST OMEGAT SIGMAT SHIFTT CCT POISSONT NLAYERST OUTPUTBASET CORRELATEDT 
00327 // DTT NPTST 
00328 const antlr::BitSet MakeInputConfParser::_tokenSet_1(_tokenSet_1_data_,4);
00329 const unsigned long MakeInputConfParser::_tokenSet_2_data_[] = { 1851458UL, 0UL, 0UL, 0UL };
00330 // EOF NUMBER STRING COMMENT TRUE FALSE 
00331 const antlr::BitSet MakeInputConfParser::_tokenSet_2(_tokenSet_2_data_,4);
00332 const unsigned long MakeInputConfParser::_tokenSet_3_data_[] = { 507826UL, 0UL, 0UL, 0UL };
00333 // EOF SLOWNESST EQUAL OMEGAT SIGMAT SHIFTT CCT POISSONT NLAYERST OUTPUTBASET 
00334 // CORRELATEDT DTT NPTST COMMENT 
00335 const antlr::BitSet MakeInputConfParser::_tokenSet_3(_tokenSet_3_data_,4);
00336 const unsigned long MakeInputConfParser::_tokenSet_4_data_[] = { 1851490UL, 0UL, 0UL, 0UL };
00337 // EOF EQUAL NUMBER STRING COMMENT TRUE FALSE 
00338 const antlr::BitSet MakeInputConfParser::_tokenSet_4(_tokenSet_4_data_,4);
00339 const unsigned long MakeInputConfParser::_tokenSet_5_data_[] = { 2097106UL, 0UL, 0UL, 0UL };
00340 // EOF SLOWNESST NUMBER OMEGAT SIGMAT SHIFTT CCT POISSONT NLAYERST OUTPUTBASET 
00341 // STRING CORRELATEDT DTT NPTST COMMENT TRUE FALSE 
00342 const antlr::BitSet MakeInputConfParser::_tokenSet_5(_tokenSet_5_data_,4);
00343 const unsigned long MakeInputConfParser::_tokenSet_6_data_[] = { 2097138UL, 0UL, 0UL, 0UL };
00344 // EOF SLOWNESST EQUAL NUMBER OMEGAT SIGMAT SHIFTT CCT POISSONT NLAYERST 
00345 // OUTPUTBASET STRING CORRELATEDT DTT NPTST COMMENT TRUE FALSE 
00346 const antlr::BitSet MakeInputConfParser::_tokenSet_6(_tokenSet_6_data_,4);
00347 const unsigned long MakeInputConfParser::_tokenSet_7_data_[] = { 2UL, 0UL, 0UL, 0UL };
00348 // EOF 
00349 const antlr::BitSet MakeInputConfParser::_tokenSet_7(_tokenSet_7_data_,4);
00350 
00351 

Generated on Thu Nov 22 13:58:26 2007 for GPLIB++ by  doxygen 1.5.1