cloudy trunk
Loading...
Searching...
No Matches
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() [1/2]

Parser::Parser ( void  )
inlineexplicit

Definition at line 44 of file parser.h.

References init().

Here is the call graph for this function:

◆ Parser() [2/2]

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

◆ chPoint()

char Parser::chPoint ( void  ) const
inlineprivate

Definition at line 83 of file parser.h.

References m_ptr.

Referenced by getWaveOpt().

◆ Command()

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:

◆ CommandError()

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:

◆ doSetVar()

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:

◆ echo()

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:

◆ FFmtRead()

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:

◆ getCommand()

string Parser::getCommand ( long  i)
inline

Definition at line 215 of file parser.h.

References m_card, and m_ptr.

Referenced by getLineID(), GetOptColDen(), GetOptLineInt(), GetOptTemp(), parse_save_colden(), and ParsePrtLineSum().

◆ GetElem()

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:

◆ getline()

bool Parser::getline ( void  )

◆ getLineID()

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

Definition at line 446 of file parser.cpp.

References getCommand(), and getWaveOpt().

Referenced by cdGetLineList(), and parse_save_line().

Here is the call graph for this function:

◆ getNumberCheck()

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:

◆ getNumberCheckAlwaysLog()

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:

◆ getNumberCheckAlwaysLogLim()

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:

◆ getNumberCheckLogLinNegImplLog()

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:

◆ getNumberDefault()

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:

◆ getNumberDefaultAlwaysLog()

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:

◆ getNumberDefaultNegImplLog()

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:

◆ getNumberPlain()

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:

◆ GetParam()

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

Definition at line 139 of file parser.h.

References FFmtRead(), m_card, m_ptr, and nMatch1().

Referenced by ParseMonitorResults().

Here is the call graph for this function:

◆ GetQuote()

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

◆ GetRange()

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

Definition at line 148 of file parser.h.

References FFmtRead(), m_card, m_ptr, and nMatch1().

Referenced by ParseMonitorResults().

Here is the call graph for this function:

◆ getRawTail()

string Parser::getRawTail ( )
inline

Definition at line 220 of file parser.h.

References m_card, m_card_raw, and m_ptr.

Referenced by ParseBackgrd(), and ParseTitle().

◆ getVarName()

std::string Parser::getVarName ( void  )

Definition at line 106 of file parser.cpp.

References m_ptr.

Referenced by doSetVar(), and FFmtRead().

◆ getWave()

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:

◆ getWaveOpt()

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:

◆ help()

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().

◆ init()

void Parser::init ( void  )
inlineprivate

Definition at line 53 of file parser.h.

References m_lgDSet, m_lgEOF, m_nInitFile, m_nqh, and setline().

Referenced by Parser().

Here is the call graph for this function:

◆ isCommandComment()

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:

◆ isComment()

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:

◆ isVar()

bool Parser::isVar ( void  ) const

Definition at line 102 of file parser.cpp.

References m_ptr.

Referenced by ParseCommands().

◆ last()

bool Parser::last ( void  ) const
inline

Definition at line 200 of file parser.h.

References m_card, and m_lgEOF.

Referenced by ParseCommands(), and ParseInterp().

◆ lgEOL()

bool Parser::lgEOL ( void  ) const
inline

◆ newlineProcess()

void Parser::newlineProcess ( void  )
inlineprivate

Definition at line 59 of file parser.h.

References caps(), INPUT_LINE_LENGTH, m_card, m_card_raw, m_len, m_lgEOL, and m_ptr.

Referenced by getline(), and setline().

Here is the call graph for this function:

◆ nMatch()

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

◆ nMatch1()

int Parser::nMatch1 ( const char *  chKey) const
inlineprivate

Definition at line 108 of file parser.h.

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

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

Here is the call graph for this function:

◆ nMatchErase()

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

Definition at line 158 of file parser.h.

References m_card, and nMatch1().

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

Here is the call graph for this function:

◆ NoNumb()

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

◆ nWord()

const char * Parser::nWord ( const char *  chKey) const

Definition at line 30 of file parser.cpp.

References m_card.

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

◆ PrintLine()

int Parser::PrintLine ( FILE *  fp) const
inline

◆ set_point()

void Parser::set_point ( long int  ipnt)
inline

Definition at line 77 of file parser.h.

References m_card, and m_ptr.

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

◆ setEOL()

void Parser::setEOL ( bool  val)
inline

Definition at line 102 of file parser.h.

References m_lgEOL.

Referenced by ParseSet().

◆ setline()

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

Definition at line 69 of file parser.h.

References ASSERT, INPUT_LINE_LENGTH, m_card_raw, and newlineProcess().

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

Here is the call graph for this function:

◆ StandardEnergyUnit()

const char * Parser::StandardEnergyUnit ( void  ) const

Definition at line 174 of file parser.cpp.

References m_card.

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

◆ StandardFluxUnit()

string Parser::StandardFluxUnit ( void  ) const

Definition at line 178 of file parser.cpp.

References m_card.

Referenced by ParseOptimize(), and ParseStop().

◆ strcmp()

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

Field Documentation

◆ m_card

char Parser::m_card[INPUT_LINE_LENGTH]
private

◆ m_card_raw

char Parser::m_card_raw[INPUT_LINE_LENGTH]
private

Definition at line 34 of file parser.h.

Referenced by echo(), getline(), GetQuote(), getRawTail(), newlineProcess(), NoNumb(), PrintLine(), and setline().

◆ m_Commands

const CloudyCommand* const Parser::m_Commands
private

Definition at line 38 of file parser.h.

Referenced by help().

◆ m_len

long int Parser::m_len
private

Definition at line 35 of file parser.h.

Referenced by FFmtRead(), and newlineProcess().

◆ m_lgDSet

bool Parser::m_lgDSet

Definition at line 42 of file parser.h.

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

◆ m_lgEOF

bool Parser::m_lgEOF

◆ m_lgEOL

bool Parser::m_lgEOL
private

Definition at line 37 of file parser.h.

Referenced by FFmtRead(), lgEOL(), newlineProcess(), and setEOL().

◆ m_nInitFile

long int Parser::m_nInitFile

Definition at line 41 of file parser.h.

Referenced by init(), ParseCommands(), and ParseInitCount().

◆ m_nqh

long int Parser::m_nqh

◆ m_ptr

const char* Parser::m_ptr
private

◆ m_symtab

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: