MakeInputConfParser Class Reference

#include <MakeInputConfParser.hpp>

Inheritance diagram for MakeInputConfParser:

Inheritance graph
[legend]
Collaboration diagram for MakeInputConfParser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void initializeASTFactory (antlr::ASTFactory &factory)
 MakeInputConfParser (antlr::TokenBuffer &tokenBuf)
 MakeInputConfParser (antlr::TokenStream &lexer)
 MakeInputConfParser (const antlr::ParserSharedInputState &state)
int getNumTokens () const
const char * getTokenName (int type) const
const char *const * getTokenNames () const
void configentry ()
double numvalue ()
std::string stringvalue ()
bool boolvalue ()
void configfile ()
antlr::RefAST getAST ()

Public Attributes

double slowness
double omega
double sigma
int shift
double cc
double poisson
int nlayers
std::string outputbase
bool correlated
double dt
int npts

Protected Member Functions

 MakeInputConfParser (antlr::TokenBuffer &tokenBuf, int k)
 MakeInputConfParser (antlr::TokenStream &lexer, int k)

Protected Attributes

antlr::RefAST returnAST

Detailed Description

Definition at line 18 of file MakeInputConfParser.hpp.


Constructor & Destructor Documentation

MakeInputConfParser::MakeInputConfParser ( antlr::TokenBuffer &  tokenBuf,
int  k 
) [protected]

Definition at line 8 of file MakeInputConfParser.cpp.

00009 : antlr::LLkParser(tokenBuf,k)
00010 {
00011 }

MakeInputConfParser::MakeInputConfParser ( antlr::TokenBuffer &  tokenBuf  ) 

Definition at line 13 of file MakeInputConfParser.cpp.

00014 : antlr::LLkParser(tokenBuf,10)
00015 {
00016 }

MakeInputConfParser::MakeInputConfParser ( antlr::TokenStream &  lexer,
int  k 
) [protected]

Definition at line 18 of file MakeInputConfParser.cpp.

00019 : antlr::LLkParser(lexer,k)
00020 {
00021 }

MakeInputConfParser::MakeInputConfParser ( antlr::TokenStream &  lexer  ) 

Definition at line 23 of file MakeInputConfParser.cpp.

00024 : antlr::LLkParser(lexer,10)
00025 {
00026 }

MakeInputConfParser::MakeInputConfParser ( const antlr::ParserSharedInputState &  state  ) 

Definition at line 28 of file MakeInputConfParser.cpp.

00029 : antlr::LLkParser(state,10)
00030 {
00031 }


Member Function Documentation

void MakeInputConfParser::initializeASTFactory ( antlr::ASTFactory &  factory  ) 

Definition at line 286 of file MakeInputConfParser.cpp.

00287 {
00288 }

int MakeInputConfParser::getNumTokens (  )  const [inline]

Definition at line 48 of file MakeInputConfParser.hpp.

00049         {
00050                 return MakeInputConfParser::NUM_TOKENS;
00051         }

const char* MakeInputConfParser::getTokenName ( int  type  )  const [inline]

Definition at line 52 of file MakeInputConfParser.hpp.

00053         {
00054                 if( type > getNumTokens() ) return 0;
00055                 return MakeInputConfParser::tokenNames[type];
00056         }

const char* const* MakeInputConfParser::getTokenNames (  )  const [inline]

Definition at line 57 of file MakeInputConfParser.hpp.

00058         {
00059                 return MakeInputConfParser::tokenNames;
00060         }

void MakeInputConfParser::configentry (  ) 

Definition at line 33 of file MakeInputConfParser.cpp.

References boolvalue(), cc, CCT, correlated, CORRELATEDT, dt, DTT, EQUAL, nlayers, NLAYERST, npts, NPTST, numvalue(), omega, OMEGAT, outputbase, OUTPUTBASET, poisson, POISSONT, shift, SHIFTT, sigma, SIGMAT, slowness, SLOWNESST, and stringvalue().

Referenced by configfile().

00033                                       {
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 }

Here is the call graph for this function:

double MakeInputConfParser::numvalue (  ) 

Definition at line 132 of file MakeInputConfParser.cpp.

References NUMBER.

Referenced by configentry().

00132                                       {
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 }

std::string MakeInputConfParser::stringvalue (  ) 

Definition at line 158 of file MakeInputConfParser.cpp.

References STRING.

Referenced by configentry().

00158                                             {
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 }

bool MakeInputConfParser::boolvalue (  ) 

Definition at line 184 of file MakeInputConfParser.cpp.

References FALSE, and TRUE.

Referenced by configentry().

00184                                      {
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 }

void MakeInputConfParser::configfile (  ) 

Definition at line 230 of file MakeInputConfParser.cpp.

References COMMENT, configentry(), and EQUAL.

Referenced by MakeInputConf::GetData().

00230                                      {
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 }

Here is the call graph for this function:

antlr::RefAST MakeInputConfParser::getAST (  )  [inline]

Definition at line 67 of file MakeInputConfParser.hpp.

00068         {
00069                 return returnAST;
00070         }


Member Data Documentation

double MakeInputConfParser::slowness

Definition at line 25 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

double MakeInputConfParser::omega

Definition at line 26 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

double MakeInputConfParser::sigma

Definition at line 27 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

int MakeInputConfParser::shift

Definition at line 28 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

double MakeInputConfParser::cc

Definition at line 29 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

double MakeInputConfParser::poisson

Definition at line 30 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

int MakeInputConfParser::nlayers

Definition at line 31 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

std::string MakeInputConfParser::outputbase

Definition at line 32 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

bool MakeInputConfParser::correlated

Definition at line 33 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

double MakeInputConfParser::dt

Definition at line 34 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

int MakeInputConfParser::npts

Definition at line 35 of file MakeInputConfParser.hpp.

Referenced by configentry(), and MakeInputConf::GetData().

antlr::RefAST MakeInputConfParser::returnAST [protected]

Definition at line 73 of file MakeInputConfParser.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Nov 22 14:09:43 2007 for GPLIB++ by  doxygen 1.5.1