00001
00002 #include "CCalcRecConfParser.hpp"
00003 #include <antlr/NoViableAltException.hpp>
00004 #include <antlr/SemanticException.hpp>
00005 #include <antlr/ASTFactory.hpp>
00006 #line 1 "CCalcRecConf.g"
00007 #line 8 "CCalcRecConfParser.cpp"
00008 CCalcRecConfParser::CCalcRecConfParser(antlr::TokenBuffer& tokenBuf, int k)
00009 : antlr::LLkParser(tokenBuf,k)
00010 {
00011 }
00012
00013 CCalcRecConfParser::CCalcRecConfParser(antlr::TokenBuffer& tokenBuf)
00014 : antlr::LLkParser(tokenBuf,10)
00015 {
00016 }
00017
00018 CCalcRecConfParser::CCalcRecConfParser(antlr::TokenStream& lexer, int k)
00019 : antlr::LLkParser(lexer,k)
00020 {
00021 }
00022
00023 CCalcRecConfParser::CCalcRecConfParser(antlr::TokenStream& lexer)
00024 : antlr::LLkParser(lexer,10)
00025 {
00026 }
00027
00028 CCalcRecConfParser::CCalcRecConfParser(const antlr::ParserSharedInputState& state)
00029 : antlr::LLkParser(state,10)
00030 {
00031 }
00032
00033 void CCalcRecConfParser::configentry() {
00034
00035 try {
00036 {
00037 switch ( LA(1)) {
00038 case READMODELT:
00039 {
00040 match(READMODELT);
00041 match(EQUAL);
00042 readmodel=boolvalue();
00043 break;
00044 }
00045 case CCT:
00046 {
00047 match(CCT);
00048 match(EQUAL);
00049 cc=numvalue();
00050 break;
00051 }
00052 case OMEGAT:
00053 {
00054 match(OMEGAT);
00055 match(EQUAL);
00056 omega=numvalue();
00057 break;
00058 }
00059 case SIGMAT:
00060 {
00061 match(SIGMAT);
00062 match(EQUAL);
00063 sigma=numvalue();
00064 break;
00065 }
00066 case SHIFTT:
00067 {
00068 match(SHIFTT);
00069 match(EQUAL);
00070 shift=numvalue();
00071 break;
00072 }
00073 case BEFOREPT:
00074 {
00075 match(BEFOREPT);
00076 match(EQUAL);
00077 beforep=numvalue();
00078 break;
00079 }
00080 case BEFOREST:
00081 {
00082 match(BEFOREST);
00083 match(EQUAL);
00084 befores=numvalue();
00085 break;
00086 }
00087 case RECMETHODT:
00088 {
00089 match(RECMETHODT);
00090 match(EQUAL);
00091 recmethod=stringvalue();
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 bool CCalcRecConfParser::boolvalue() {
00112 #line 53 "CCalcRecConf.g"
00113 bool r;
00114 #line 115 "CCalcRecConfParser.cpp"
00115
00116 try {
00117 {
00118 switch ( LA(1)) {
00119 case TRUE:
00120 {
00121 match(TRUE);
00122 if ( inputState->guessing==0 ) {
00123 #line 54 "CCalcRecConf.g"
00124 r = true;
00125 #line 126 "CCalcRecConfParser.cpp"
00126 }
00127 break;
00128 }
00129 case FALSE:
00130 {
00131 match(FALSE);
00132 if ( inputState->guessing==0 ) {
00133 #line 54 "CCalcRecConf.g"
00134 r = false;
00135 #line 136 "CCalcRecConfParser.cpp"
00136 }
00137 break;
00138 }
00139 default:
00140 {
00141 throw antlr::NoViableAltException(LT(1), getFilename());
00142 }
00143 }
00144 }
00145 }
00146 catch (antlr::RecognitionException& ex) {
00147 if( inputState->guessing == 0 ) {
00148 reportError(ex);
00149 recover(ex,_tokenSet_0);
00150 } else {
00151 throw;
00152 }
00153 }
00154 return r;
00155 }
00156
00157 double CCalcRecConfParser::numvalue() {
00158 #line 49 "CCalcRecConf.g"
00159 double r;
00160 #line 161 "CCalcRecConfParser.cpp"
00161 antlr::RefToken currvalue = antlr::nullToken;
00162
00163 try {
00164 currvalue = LT(1);
00165 match(NUMBER);
00166 if ( inputState->guessing==0 ) {
00167 #line 50 "CCalcRecConf.g"
00168 r = atof(currvalue->getText().c_str());
00169 #line 170 "CCalcRecConfParser.cpp"
00170 }
00171 }
00172 catch (antlr::RecognitionException& ex) {
00173 if( inputState->guessing == 0 ) {
00174 reportError(ex);
00175 recover(ex,_tokenSet_0);
00176 } else {
00177 throw;
00178 }
00179 }
00180 return r;
00181 }
00182
00183 std::string CCalcRecConfParser::stringvalue() {
00184 #line 57 "CCalcRecConf.g"
00185 std::string r;
00186 #line 187 "CCalcRecConfParser.cpp"
00187 antlr::RefToken currvalue = antlr::nullToken;
00188
00189 try {
00190 currvalue = LT(1);
00191 match(STRING);
00192 if ( inputState->guessing==0 ) {
00193 #line 58 "CCalcRecConf.g"
00194 r = currvalue->getText();
00195 #line 196 "CCalcRecConfParser.cpp"
00196 }
00197 }
00198 catch (antlr::RecognitionException& ex) {
00199 if( inputState->guessing == 0 ) {
00200 reportError(ex);
00201 recover(ex,_tokenSet_0);
00202 } else {
00203 throw;
00204 }
00205 }
00206 return r;
00207 }
00208
00209 void CCalcRecConfParser::configfile() {
00210 #line 44 "CCalcRecConf.g"
00211
00212
00213 #line 214 "CCalcRecConfParser.cpp"
00214
00215 try {
00216 {
00217 int _cnt36=0;
00218 for (;;) {
00219 if ((_tokenSet_1.member(LA(1)))) {
00220 configentry();
00221 {
00222 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)))) {
00223 match(COMMENT);
00224 }
00225 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)))) {
00226 }
00227 else {
00228 throw antlr::NoViableAltException(LT(1), getFilename());
00229 }
00230
00231 }
00232 }
00233 else {
00234 if ( _cnt36>=1 ) { goto _loop36; } else {throw antlr::NoViableAltException(LT(1), getFilename());}
00235 }
00236
00237 _cnt36++;
00238 }
00239 _loop36:;
00240 }
00241 {
00242 for (;;) {
00243 if ((LA(1) == COMMENT)) {
00244 match(COMMENT);
00245 }
00246 else {
00247 goto _loop38;
00248 }
00249
00250 }
00251 _loop38:;
00252 }
00253 match(antlr::Token::EOF_TYPE);
00254 }
00255 catch (antlr::RecognitionException& ex) {
00256 if( inputState->guessing == 0 ) {
00257 reportError(ex);
00258 recover(ex,_tokenSet_7);
00259 } else {
00260 throw;
00261 }
00262 }
00263 }
00264
00265 void CCalcRecConfParser::initializeASTFactory( antlr::ASTFactory& )
00266 {
00267 }
00268 const char* CCalcRecConfParser::tokenNames[] = {
00269 "<0>",
00270 "EOF",
00271 "<2>",
00272 "NULL_TREE_LOOKAHEAD",
00273 "READMODELT",
00274 "EQUAL",
00275 "CCT",
00276 "NUMBER",
00277 "OMEGAT",
00278 "SIGMAT",
00279 "SHIFTT",
00280 "BEFOREPT",
00281 "BEFOREST",
00282 "RECMETHODT",
00283 "STRING",
00284 "COMMENT",
00285 "TRUE",
00286 "FALSE",
00287 "WS",
00288 "NEWLINE",
00289 "REAL",
00290 "INT",
00291 "DIGIT",
00292 "CHAR",
00293 "OTHER",
00294 0
00295 };
00296
00297 const unsigned long CCalcRecConfParser::_tokenSet_0_data_[] = { 48978UL, 0UL, 0UL, 0UL };
00298
00299
00300 const antlr::BitSet CCalcRecConfParser::_tokenSet_0(_tokenSet_0_data_,4);
00301 const unsigned long CCalcRecConfParser::_tokenSet_1_data_[] = { 16208UL, 0UL, 0UL, 0UL };
00302
00303 const antlr::BitSet CCalcRecConfParser::_tokenSet_1(_tokenSet_1_data_,4);
00304 const unsigned long CCalcRecConfParser::_tokenSet_2_data_[] = { 245890UL, 0UL, 0UL, 0UL };
00305
00306 const antlr::BitSet CCalcRecConfParser::_tokenSet_2(_tokenSet_2_data_,4);
00307 const unsigned long CCalcRecConfParser::_tokenSet_3_data_[] = { 49010UL, 0UL, 0UL, 0UL };
00308
00309
00310 const antlr::BitSet CCalcRecConfParser::_tokenSet_3(_tokenSet_3_data_,4);
00311 const unsigned long CCalcRecConfParser::_tokenSet_4_data_[] = { 245922UL, 0UL, 0UL, 0UL };
00312
00313 const antlr::BitSet CCalcRecConfParser::_tokenSet_4(_tokenSet_4_data_,4);
00314 const unsigned long CCalcRecConfParser::_tokenSet_5_data_[] = { 262098UL, 0UL, 0UL, 0UL };
00315
00316
00317 const antlr::BitSet CCalcRecConfParser::_tokenSet_5(_tokenSet_5_data_,4);
00318 const unsigned long CCalcRecConfParser::_tokenSet_6_data_[] = { 262130UL, 0UL, 0UL, 0UL };
00319
00320
00321 const antlr::BitSet CCalcRecConfParser::_tokenSet_6(_tokenSet_6_data_,4);
00322 const unsigned long CCalcRecConfParser::_tokenSet_7_data_[] = { 2UL, 0UL, 0UL, 0UL };
00323
00324 const antlr::BitSet CCalcRecConfParser::_tokenSet_7(_tokenSet_7_data_,4);
00325
00326