CRLSConfigParser.cpp

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

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