CMtuAdaptiveConfigParser.cpp

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

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