cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Data Fields | Private Member Functions | Private Attributes
Parser Class Reference

#include <parser.h>

Collaboration diagram for Parser:
Collaboration graph
[legend]

Public Member Functions

 Parser (void)
 
 Parser (const CloudyCommand *commands)
 
bool getline (void)
 
void setline (const char *const card)
 
void set_point (long int ipnt)
 
const char * nWord (const char *chKey) const
 
long int GetElem (void) const
 
double FFmtRead (void)
 
double getNumberPlain (const char *chDesc)
 
double getNumberCheck (const char *chDesc)
 
double getNumberDefault (const char *chDesc, double fdef)
 
double getNumberCheckLogLinNegImplLog (const char *chDesc)
 
double getNumberCheckAlwaysLog (const char *chDesc)
 
double getNumberCheckAlwaysLogLim (const char *chDesc, double flim)
 
double getNumberDefaultAlwaysLog (const char *chDesc, double fdef)
 
double getNumberDefaultNegImplLog (const char *chDesc, double fdef)
 
bool lgEOL (void) const
 
void setEOL (bool val)
 
NORETURN void NoNumb (const char *chDesc) const
 
bool nMatch (const char *chKey) const
 
bool GetParam (const char *chKey, double *val)
 
bool GetRange (const char *chKey, double *val1, double *val2)
 
bool nMatchErase (const char *chKey)
 
int strcmp (const char *s2)
 
bool Command (const char *name, OptionParser doOpts)
 
bool isComment (void) const
 
bool isCommandComment (void) const
 
bool isVar (void) const
 
std::string getVarName (void)
 
void doSetVar (void)
 
void echo (void) const
 
bool last (void) const
 
int PrintLine (FILE *fp) const
 
NORETURN void CommandError (void) const
 
int GetQuote (char *chLabel, bool lgABORT)
 
const char * StandardEnergyUnit (void) const
 
string StandardFluxUnit (void) const
 
string getCommand (long i)
 
string getRawTail ()
 
void help (FILE *fp) const
 
double getWave ()
 
double getWaveOpt ()
 
void getLineID (char *LabelBuf, realnum *wave)
 

Data Fields

long int m_nqh
 
long int m_nInitFile
 
bool m_lgDSet
 
bool m_lgEOF
 

Private Member Functions

void init (void)
 
void newlineProcess (void)
 
char chPoint (void) const
 
int nMatch1 (const char *chKey) const
 

Private Attributes

char m_card [INPUT_LINE_LENGTH]
 
char m_card_raw [INPUT_LINE_LENGTH]
 
long int m_len
 
const char * m_ptr
 
bool m_lgEOL
 
const CloudyCommand *const m_Commands
 
std::map< string, double > m_symtab
 

Detailed Description

Parser class holds pointer to string currently being analysed

Definition at line 31 of file parser.h.

Constructor & Destructor Documentation

Parser::Parser ( void  )
inlineexplicit

Definition at line 44 of file parser.h.

References init().

Here is the call graph for this function:

Parser::Parser ( const CloudyCommand commands)
inlineexplicit

Definition at line 48 of file parser.h.

References init().

Here is the call graph for this function:

Member Function Documentation

char Parser::chPoint ( void  ) const
inlineprivate

Definition at line 83 of file parser.h.

References m_ptr.

Referenced by getWaveOpt().

bool Parser::Command ( const char *  name,
OptionParser  doOpts 
)
inline

Definition at line 187 of file parser.h.

References strcmp().

Referenced by ParseCommands().

Here is the call graph for this function:

NORETURN void Parser::CommandError ( void  ) const

Definition at line 154 of file parser.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, ioQQQ, m_card, and PrintLine().

Referenced by ParseCommands().

Here is the call graph for this function:

void Parser::doSetVar ( void  )

Definition at line 119 of file parser.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, FFmtRead(), getVarName(), ioQQQ, m_ptr, and m_symtab.

Referenced by ParseCommands().

Here is the call graph for this function:

void Parser::echo ( void  ) const

Definition at line 147 of file parser.cpp.

References called, ioQQQ, t_called::lgTalk, m_card, m_card_raw, and nMatch().

Referenced by ParseAbundances(), ParseCommands(), and ParseInterp().

Here is the call graph for this function:

double Parser::FFmtRead ( void  )

Definition at line 353 of file parser.cpp.

References DEBUG_ENTRY, getVarName(), ioQQQ, m_card, m_len, m_lgEOL, m_ptr, m_symtab, and ParseExpr().

Referenced by doSetVar(), getNumberCheck(), getNumberDefault(), getNumberDefaultAlwaysLog(), getNumberDefaultNegImplLog(), getNumberPlain(), GetOptColDen(), GetOptLineInt(), GetOptTemp(), GetParam(), GetRange(), getWaveOpt(), parse_save_average(), parse_save_colden(), Parse_Save_Line_RT(), ParseAbsMag(), ParseAbundances(), ParseAge(), ParseAgn(), ParseAperture(), ParseAtom(), ParseAtomH2(), ParseAtomISO(), ParseBackgrd(), ParseBlackbody(), ParseBremsstrahlung(), ParseCaseB(), ParseCExtra(), ParseCMBOuter(), ParseCompile(), ParseConstant(), ParseCoronal(), ParseCosmicRays(), ParseCosmology(), ParseCovering(), ParseCrashDo(), ParseCylinder(), ParseDiffuse(), ParseDistance(), ParseDLaw(), ParseEden(), ParseElement(), ParseEnergy(), ParseExtinguish(), ParseF_nu(), ParseFail(), ParseFill(), ParseFluc(), ParseForceTemperature(), ParseFudge(), ParseGlobule(), ParseGrain(), ParseGravity(), ParseGrid(), ParseHDEN(), ParseHExtra(), ParseIlluminate(), ParseIntensity(), ParseInterp(), ParseIonPar(), ParseIterations(), ParseLaser(), ParseLuminosity(), ParseMap(), ParseMetal(), ParseMonitorResults(), ParseNeutrons(), ParseNorm(), ParseOptimize(), ParsePhi(), ParsePlotRangeContin(), ParsePlotRangeOption(), ParsePowerlawContinuum(), ParsePrint(), ParseQH(), ParseRadius(), ParseRangeOption(), ParseRatio(), ParseSave(), ParseSet(), ParseSphere(), ParseStop(), ParseTable(), ParseTauMin(), ParseTLaw(), ParseTrace(), ParseTurbulence(), and ParseVLaw().

Here is the call graph for this function:

string Parser::getCommand ( long  i)
inline
long int Parser::GetElem ( void  ) const

Definition at line 209 of file parser.cpp.

References t_elementnames::chElementNameShort, DEBUG_ENTRY, elementnames, LIMELM, and nMatch().

Referenced by parse_save_average(), ParseAtomISO(), ParseElement(), ParseMonitorResults(), ParsePrint(), ParseSave(), ParseSet(), and ParseTrace().

Here is the call graph for this function:

bool Parser::getline ( void  )
void Parser::getLineID ( char *  LabelBuf,
realnum wave 
)

Definition at line 446 of file parser.cpp.

References getCommand(), and getWaveOpt().

Referenced by parse_save_line().

Here is the call graph for this function:

double Parser::getNumberCheck ( const char *  chDesc)

Definition at line 273 of file parser.cpp.

References FFmtRead(), lgEOL(), and NoNumb().

Referenced by getNumberCheckAlwaysLog(), getNumberCheckAlwaysLogLim(), getNumberCheckLogLinNegImplLog(), ParseAtomFeII(), ParseDynaWind(), and ParseMagnet().

Here is the call graph for this function:

double Parser::getNumberCheckAlwaysLog ( const char *  chDesc)

Definition at line 308 of file parser.cpp.

References getNumberCheck().

Referenced by ParseDarkMatter(), ParseDynaTime(), and ParseMagnet().

Here is the call graph for this function:

double Parser::getNumberCheckAlwaysLogLim ( const char *  chDesc,
double  flim 
)

Definition at line 314 of file parser.cpp.

References getNumberCheck(), and ioQQQ.

Referenced by ParseDynaTime().

Here is the call graph for this function:

double Parser::getNumberCheckLogLinNegImplLog ( const char *  chDesc)

Definition at line 291 of file parser.cpp.

References getNumberCheck(), and nMatch().

Referenced by abund_starburst().

Here is the call graph for this function:

double Parser::getNumberDefault ( const char *  chDesc,
double  fdef 
)

Definition at line 282 of file parser.cpp.

References FFmtRead(), and lgEOL().

Referenced by diatomics::H2_ParseSave(), ParseDynaWind(), and ParseMagnet().

Here is the call graph for this function:

double Parser::getNumberDefaultAlwaysLog ( const char *  chDesc,
double  fdef 
)

Definition at line 327 of file parser.cpp.

References FFmtRead(), and lgEOL().

Referenced by ParseDarkMatter(), and ParseDynaTime().

Here is the call graph for this function:

double Parser::getNumberDefaultNegImplLog ( const char *  chDesc,
double  fdef 
)

Definition at line 336 of file parser.cpp.

References FFmtRead(), and lgEOL().

Referenced by diatomics::H2_ParseSave().

Here is the call graph for this function:

double Parser::getNumberPlain ( const char *  chDesc)

Definition at line 269 of file parser.cpp.

References FFmtRead().

Referenced by ParseDynaWind().

Here is the call graph for this function:

bool Parser::GetParam ( const char *  chKey,
double *  val 
)
inline

Definition at line 139 of file parser.h.

References FFmtRead(), and nMatch1().

Referenced by ParseMonitorResults().

Here is the call graph for this function:

int Parser::GetQuote ( char *  chLabel,
bool  lgABORT 
)
inline

Definition at line 209 of file parser.h.

References GetQuote().

Referenced by ParseAtom(), ParseCompile(), ParseGrain(), ParseInit(), ParseMonitorResults(), ParseNorm(), ParseOptimize(), ParseSave(), ParseSet(), ParseState(), ParseStop(), ParseTable(), and ParseTitle().

Here is the call graph for this function:

bool Parser::GetRange ( const char *  chKey,
double *  val1,
double *  val2 
)
inline

Definition at line 148 of file parser.h.

References FFmtRead(), and nMatch1().

Referenced by ParseMonitorResults().

Here is the call graph for this function:

string Parser::getRawTail ( )
inline

Definition at line 220 of file parser.h.

Referenced by ParseBackgrd(), and ParseTitle().

std::string Parser::getVarName ( void  )

Definition at line 106 of file parser.cpp.

References m_ptr.

Referenced by doSetVar(), and FFmtRead().

double Parser::getWave ( )

Definition at line 260 of file parser.cpp.

References getWaveOpt(), lgEOL(), and NoNumb().

Referenced by ParseMonitorResults(), and ParseNorm().

Here is the call graph for this function:

double Parser::getWaveOpt ( )

Definition at line 244 of file parser.cpp.

References chPoint(), and FFmtRead().

Referenced by getLineID(), GetOptLineInt(), getWave(), ParsePrint(), ParsePrtLineSum(), and ParseStop().

Here is the call graph for this function:

void Parser::help ( FILE *  fp) const

Definition at line 182 of file parser.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_SUCCESS, and m_Commands.

Referenced by ParseHelp().

void Parser::init ( void  )
inlineprivate

Definition at line 53 of file parser.h.

References setline().

Referenced by Parser().

Here is the call graph for this function:

bool Parser::isCommandComment ( void  ) const

Definition at line 97 of file parser.cpp.

References isComment(), and m_card.

Referenced by ParseCommands().

Here is the call graph for this function:

bool Parser::isComment ( void  ) const

Definition at line 93 of file parser.cpp.

References lgInputComment(), and m_card.

Referenced by isCommandComment(), ParseAbundances(), and ParseInterp().

Here is the call graph for this function:

bool Parser::isVar ( void  ) const

Definition at line 102 of file parser.cpp.

References m_ptr.

Referenced by ParseCommands().

bool Parser::last ( void  ) const
inline

Definition at line 200 of file parser.h.

Referenced by ParseCommands(), and ParseInterp().

bool Parser::lgEOL ( void  ) const
inline
void Parser::newlineProcess ( void  )
inlineprivate

Definition at line 59 of file parser.h.

References caps(), INPUT_LINE_LENGTH, and m_card.

Referenced by getline(), and setline().

Here is the call graph for this function:

bool Parser::nMatch ( const char *  chKey) const
inline
int Parser::nMatch1 ( const char *  chKey) const
inlineprivate

Definition at line 108 of file parser.h.

References ASSERT, isBoundaryChar(), nMatch(), and nWord().

Referenced by GetParam(), GetRange(), nMatch(), and nMatchErase().

Here is the call graph for this function:

bool Parser::nMatchErase ( const char *  chKey)
inline

Definition at line 158 of file parser.h.

References nMatch1().

Referenced by ParseCompile(), ParseGrain(), ParseMonitorResults(), ParseSave(), and ParseTable().

Here is the call graph for this function:

NORETURN void Parser::NoNumb ( const char *  chDesc) const
const char * Parser::nWord ( const char *  chKey) const

Definition at line 30 of file parser.cpp.

References m_card, and nWord().

Referenced by nMatch1(), ParseAge(), and parserProcess().

Here is the call graph for this function:

int Parser::PrintLine ( FILE *  fp) const
inline
void Parser::set_point ( long int  ipnt)
inline

Definition at line 77 of file parser.h.

Referenced by ParseBackgrd(), ParseCMBOuter(), ParseRangeOption(), and ParseTest().

void Parser::setEOL ( bool  val)
inline

Definition at line 102 of file parser.h.

Referenced by ParseSet().

void Parser::setline ( const char *const  card)
inline

Definition at line 69 of file parser.h.

References ASSERT, INPUT_LINE_LENGTH, and newlineProcess().

Referenced by cdGetLineList(), init(), ParseAbundances(), ParseBackgrd(), ParseCMBOuter(), ParseDrive(), and ParseTest().

Here is the call graph for this function:

const char * Parser::StandardEnergyUnit ( void  ) const

Definition at line 174 of file parser.cpp.

References m_card, and StandardEnergyUnit().

Referenced by ChkUnits(), ParseOptimize(), ParseSave(), ParseSet(), and ParseStop().

Here is the call graph for this function:

string Parser::StandardFluxUnit ( void  ) const

Definition at line 178 of file parser.cpp.

References m_card, and StandardFluxUnit().

Referenced by ParseOptimize(), and ParseStop().

Here is the call graph for this function:

int Parser::strcmp ( const char *  s2)
inline

Field Documentation

char Parser::m_card[INPUT_LINE_LENGTH]
private
char Parser::m_card_raw[INPUT_LINE_LENGTH]
private

Definition at line 33 of file parser.h.

Referenced by echo(), getline(), and NoNumb().

const CloudyCommand* const Parser::m_Commands
private

Definition at line 38 of file parser.h.

Referenced by help().

long int Parser::m_len
private

Definition at line 35 of file parser.h.

Referenced by FFmtRead().

bool Parser::m_lgDSet

Definition at line 42 of file parser.h.

Referenced by ParseAbundances(), ParseCommands(), and ParseGrain().

bool Parser::m_lgEOF
bool Parser::m_lgEOL
private

Definition at line 37 of file parser.h.

Referenced by FFmtRead(), and lgEOL().

long int Parser::m_nInitFile

Definition at line 41 of file parser.h.

Referenced by ParseCommands(), and ParseInitCount().

long int Parser::m_nqh
const char* Parser::m_ptr
private

Definition at line 36 of file parser.h.

Referenced by chPoint(), doSetVar(), FFmtRead(), getVarName(), and isVar().

std::map<string,double> Parser::m_symtab
private

Definition at line 39 of file parser.h.

Referenced by doSetVar(), and FFmtRead().


The documentation for this class was generated from the following files: