OpenASIP
2.0
|
#include <CmdLineOptionParser.hh>
Public Member Functions | |
CmdLineOptionParser (std::string name, std::string desc, std::string alias, bool hidden=false) | |
virtual | ~CmdLineOptionParser () |
virtual OptionValue * | copy () const =0 |
std::string | longName () const |
std::string | shortName () const |
std::string | description () const |
virtual bool | parseValue (std::string arguments, std::string prefix)=0 |
Pure virtual function that parses the value of option. More... | |
bool | isHidden () |
bool | isDefined () |
virtual int | integer (int index=0) const |
virtual unsigned | unsignedInteger (int index=0) const |
virtual std::string | String (int index=0) const |
virtual double | real () const |
virtual bool | isFlagOn () const |
virtual bool | isFlagOff () const |
virtual int | listSize () const |
Protected Member Functions | |
void | setDefined () |
Private Member Functions | |
CmdLineOptionParser (const CmdLineOptionParser &) | |
Copying not allowed. More... | |
CmdLineOptionParser & | operator= (const CmdLineOptionParser &) |
Assignment not allowed. More... | |
Private Attributes | |
std::string | longName_ |
The full name of an option. More... | |
std::string | shortName_ |
The optional alias (shorter name). More... | |
std::string | desc_ |
The description of option. More... | |
bool | hidden_ = false |
The hidden flag. If set, no entry is printed in the normal help text. More... | |
bool | defined_ |
Is the value of this option set in the parsed command line? More... | |
Abstract base class for modeling command line options and their built-in mini-parser.
All option types have a set of properties that identify the option: name, description and short name (alias). Possible concrete types of options are: Boolean, real, integer, and character string.
Definition at line 56 of file CmdLineOptionParser.hh.
CmdLineOptionParser::CmdLineOptionParser | ( | std::string | name, |
std::string | desc, | ||
std::string | alias, | ||
bool | hidden = false |
||
) |
Constructor.
name | The name of the option. |
desc | The description of the option. |
alias | The short name of the option. |
Definition at line 62 of file CmdLineOptionParser.cc.
|
virtual |
|
private |
Copying not allowed.
|
pure virtual |
Implemented in StringListCmdLineOptionParser, IntegerListCmdLineOptionParser, BoolCmdLineOptionParser, RealCmdLineOptionParser, OptionalStringCmdLineOptionParser, StringCmdLineOptionParser, UnsignedIntegerCmdLineOptionParser, and IntegerCmdLineOptionParser.
Referenced by CmdLineParser::storeOptions().
std::string CmdLineOptionParser::description | ( | ) | const |
Referenced by CmdLineOptions::printHelp().
|
virtual |
This implementation should never be called.
WrongSubclass | Called for a wrong subclass. |
Reimplemented in IntegerListCmdLineOptionParser, and IntegerCmdLineOptionParser.
Definition at line 84 of file CmdLineOptionParser.cc.
References __func__.
Referenced by ExplorerCmdLineOptions::applicationIDToRemove(), SchedulerCmdLineOptions::bypassDistance(), ProGeCmdLineOptions::clockFrequency(), ExplorerCmdLineOptions::configurationToWrite(), PIGCmdLineOptions::dataMemoryWidthInMAUs(), TestHDBCmdLineOptions::fuEntryID(), SchedulerCmdLineOptions::ifConversionThreshold(), SchedulerCmdLineOptions::lowMemModeThreshold(), SchedulerCmdLineOptions::noDreBypassDistance(), SchedulerCmdLineOptions::operandShareDistance(), LLVMTCECmdLineOptions::optLevel(), TestHDBCmdLineOptions::rfEntryID(), SchedulerCmdLineOptions::schedulingWindowSize(), DumperCmdLineOptions::sectionId(), ProGeCmdLineOptions::simulationRuntime(), and ExplorerCmdLineOptions::startConfiguration().
bool CmdLineOptionParser::isDefined | ( | ) |
Returns true if the option was defined in the command line.
Definition at line 169 of file CmdLineOptionParser.cc.
References defined_.
Referenced by ExplorerCmdLineOptions::adfFile(), ExplorerCmdLineOptions::adfOutFile(), LLVMTCECmdLineOptions::analyzeInstructionPatterns(), LLVMTCECmdLineOptions::assumeADFStackAlignment(), ExplorerCmdLineOptions::compilerOptions(), PIGCmdLineOptions::dataMemoryWidthInMAUs(), LLVMTCECmdLineOptions::disableAddressSpaceAA(), LLVMTCECmdLineOptions::disableDelaySlotFiller(), LLVMTCECmdLineOptions::disableHWLoops(), LLVMTCECmdLineOptions::disableLLVMAA(), LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), ExplorerCmdLineOptions::idfFile(), LLVMTCECmdLineOptions::isDataStartAddressSet(), TestHDBCmdLineOptions::isFUEntryIDGiven(), LLVMTCECmdLineOptions::isInitialStackPointerValueSet(), SchedulerCmdLineOptions::isLoopOptDefined(), SchedulerCmdLineOptions::isMachineFileDefined(), LLVMTCECmdLineOptions::isOptLevelDefined(), SchedulerCmdLineOptions::isOutputFileDefined(), TestHDBCmdLineOptions::isRFEntryIDGiven(), LLVMTCECmdLineOptions::isStandardEmulationLibDefined(), CmdLineOptions::isVerboseSpamSwitchDefined(), LLVMTCECmdLineOptions::isVerboseSwitchDefined(), CmdLineOptions::isVerboseSwitchDefined(), LLVMTCECmdLineOptions::isWorkItemAAFileDefined(), DumperCmdLineOptions::onlyLogicalInfo(), CmdLineOptions::optionGiven(), DisasmCmdLineOptions::outputFileDefined(), DumperCmdLineOptions::printFileHeaders(), DumperCmdLineOptions::printMemoryInfo(), DumperCmdLineOptions::printRelocations(), DumperCmdLineOptions::printSectionHeaders(), ExplorerCmdLineOptions::printSummary(), DumperCmdLineOptions::printSymbols(), LLVMTCECmdLineOptions::saveBackendPlugin(), SchedulerCmdLineOptions::schedulingWindowSize(), LLVMTCECmdLineOptions::useBubbleFish2Scheduler(), LLVMTCECmdLineOptions::useBUScheduler(), LLVMTCECmdLineOptions::useOldBackendSources(), SchedulerCmdLineOptions::useRestrictedAliasAnalyzer(), LLVMTCECmdLineOptions::useTDScheduler(), LLVMTCECmdLineOptions::useVectorBackend(), and ExplorerCmdLineOptions::writeOutBestConfiguration().
|
virtual |
This implementation should never be called.
WrongSubclass | Called for a wrong subclass. |
Reimplemented in BoolCmdLineOptionParser, and OptionalStringCmdLineOptionParser.
Definition at line 138 of file CmdLineOptionParser.cc.
References __func__.
|
virtual |
This implementation should never be called.
WrongSubclass | Called for a wrong subclass. |
Reimplemented in BoolCmdLineOptionParser, and OptionalStringCmdLineOptionParser.
Definition at line 126 of file CmdLineOptionParser.cc.
References __func__.
Referenced by ProGeCmdLineOptions::asyncReset(), SimulatorCmdLineOptions::backendType(), SimulatorCmdLineOptions::debugMode(), SchedulerCmdLineOptions::dumpIfConversionCFGs(), SchedulerCmdLineOptions::enableOffsetAA(), SchedulerCmdLineOptions::enableStackAA(), DisasmCmdLineOptions::flatFile(), ProGeCmdLineOptions::forceOutputDirectory(), PIGCmdLineOptions::generateDataImages(), PIGCmdLineOptions::generateDecompressor(), ProGeCmdLineOptions::generateTestbench(), BuildOpsetOptions::ignore(), SchedulerCmdLineOptions::killDeadResults(), TTAUnitTesterCmdLineOptions::leaveDirty(), TestHDBCmdLineOptions::leaveDirty(), DisasmCmdLineOptions::lineNumbers(), ProGeCmdLineOptions::listAvailableIntegrators(), EstimatorCmdLineOptions::longestPath(), ExplorerCmdLineOptions::numberOfConfigurations(), ProGeCmdLineOptions::preferHDLGeneration(), ExplorerCmdLineOptions::printApplications(), ExplorerCmdLineOptions::printPlugins(), SchedulerCmdLineOptions::printResourceConstraints(), DisasmCmdLineOptions::printToStdout(), SchedulerCmdLineOptions::renameRegisters(), ProGeCmdLineOptions::resetAllRegisters(), LLVMTCECmdLineOptions::saveBackendPlugin(), PIGCmdLineOptions::showCompressors(), ProGeCmdLineOptions::syncReset(), EstimatorCmdLineOptions::totalArea(), EstimatorCmdLineOptions::totalEnergy(), ProGeCmdLineOptions::useAbsolutePaths(), TTAUnitTesterCmdLineOptions::verbose(), and TestHDBCmdLineOptions::verbose().
|
inline |
Definition at line 75 of file CmdLineOptionParser.hh.
References hidden_.
Referenced by CmdLineOptions::printHelp().
|
virtual |
This implementation should never be called.
WrongSubclass | Called for a wrong subclass. |
Reimplemented in StringListCmdLineOptionParser, and IntegerListCmdLineOptionParser.
Definition at line 150 of file CmdLineOptionParser.cc.
References __func__.
Referenced by ExplorerCmdLineOptions::applicationIDToRemoveCount(), ExplorerCmdLineOptions::compilerOptionsString(), PIGCmdLineOptions::compressorParameterCount(), ExplorerCmdLineOptions::explorerPluginParameterCount(), ExplorerCmdLineOptions::hdbFileNameCount(), ExplorerCmdLineOptions::hdbFileNames(), SchedulerCmdLineOptions::noaliasFunctions(), ExplorerCmdLineOptions::numberOfConfigurationsToWrite(), LLVMTCECmdLineOptions::primaryFunctions(), DumperCmdLineOptions::sectionIdCount(), ExplorerCmdLineOptions::testApplicationDirectoryCount(), PIGCmdLineOptions::tpefFileCount(), and ExplorerCmdLineOptions::writeOutConfiguration().
std::string CmdLineOptionParser::longName | ( | ) | const |
Referenced by IntegerCmdLineOptionParser::parseValue(), UnsignedIntegerCmdLineOptionParser::parseValue(), RealCmdLineOptionParser::parseValue(), BoolCmdLineOptionParser::parseValue(), IntegerListCmdLineOptionParser::parseValue(), StringListCmdLineOptionParser::parseValue(), and CmdLineOptions::printHelp().
|
private |
Assignment not allowed.
|
pure virtual |
Pure virtual function that parses the value of option.
Implemented in StringListCmdLineOptionParser, IntegerListCmdLineOptionParser, BoolCmdLineOptionParser, RealCmdLineOptionParser, OptionalStringCmdLineOptionParser, StringCmdLineOptionParser, UnsignedIntegerCmdLineOptionParser, and IntegerCmdLineOptionParser.
Referenced by CmdLineOptions::parseAll(), and CmdLineParser::parseAll().
|
virtual |
This implementation should never be called.
WrongSubclass | Called for a wrong subclass. |
Reimplemented in RealCmdLineOptionParser.
Definition at line 114 of file CmdLineOptionParser.cc.
References __func__.
|
protected |
Sets the CmdLineOptionParser to be defined in the parsed command line.
Definition at line 159 of file CmdLineOptionParser.cc.
References defined_.
Referenced by IntegerCmdLineOptionParser::parseValue(), UnsignedIntegerCmdLineOptionParser::parseValue(), StringCmdLineOptionParser::parseValue(), OptionalStringCmdLineOptionParser::parseValue(), RealCmdLineOptionParser::parseValue(), BoolCmdLineOptionParser::parseValue(), IntegerListCmdLineOptionParser::parseValue(), and StringListCmdLineOptionParser::parseValue().
std::string CmdLineOptionParser::shortName | ( | ) | const |
Referenced by CmdLineOptions::printHelp().
|
virtual |
This implementation should be never called.
WrongSubclass | Called for a wrong subclass. |
Reimplemented in StringListCmdLineOptionParser, OptionalStringCmdLineOptionParser, and StringCmdLineOptionParser.
Definition at line 102 of file CmdLineOptionParser.cc.
References __func__.
Referenced by TTAUnitTesterCmdLineOptions::adfFileName(), ExplorerCmdLineOptions::adfFileName(), ExplorerCmdLineOptions::adfOutFileName(), LLVMTCECmdLineOptions::backendCacheDir(), PIGCmdLineOptions::bemFile(), ProGeCmdLineOptions::bemFile(), ProGeCmdLineOptions::commaSeparatedList(), ExplorerCmdLineOptions::compilerOptionsString(), PIGCmdLineOptions::compressorParameter(), PIGCmdLineOptions::compressorPlugin(), PIGCmdLineOptions::dataImageOutputFormat(), ProGeCmdLineOptions::deviceFamilyName(), ProGeCmdLineOptions::deviceName(), ProGeCmdLineOptions::dmemType(), PIGCmdLineOptions::entityName(), ProGeCmdLineOptions::entityName(), ExplorerCmdLineOptions::explorerPlugin(), ExplorerCmdLineOptions::explorerPluginParameter(), LLVMTCECmdLineOptions::getLLVMargv(), ExplorerCmdLineOptions::hdbFileName(), ProGeCmdLineOptions::hdl(), ProGeCmdLineOptions::idfFile(), ExplorerCmdLineOptions::idfFileName(), ProGeCmdLineOptions::imemType(), ProGeCmdLineOptions::integratorName(), SchedulerCmdLineOptions::machineFile(), SimulatorCmdLineOptions::machineFile(), SchedulerCmdLineOptions::noaliasFunctions(), ProGeCmdLineOptions::outputDirectory(), BEMGeneratorCmdLineOptions::outputFile(), SchedulerCmdLineOptions::outputFile(), DisasmCmdLineOptions::outputFile(), MachInfoCmdLineOptions::outputFileNameSuffix(), MachInfoCmdLineOptions::outputFormat(), ExplorerCmdLineOptions::paretoSetValues(), ExplorerCmdLineOptions::pluginInfo(), ProGeCmdLineOptions::pluginParametersQuery(), LLVMTCECmdLineOptions::primaryFunctions(), PIGCmdLineOptions::progeOutputDirectory(), SimulatorCmdLineOptions::programFile(), PIGCmdLineOptions::programImageOutputFormat(), SimulatorCmdLineOptions::scriptString(), ProGeCmdLineOptions::sharedOutputDirectory(), BuildOpsetOptions::sourceDir(), LLVMTCECmdLineOptions::standardEmulationLib(), ExplorerCmdLineOptions::summaryOrdering(), LLVMTCECmdLineOptions::tempDir(), ExplorerCmdLineOptions::testApplicationDirectory(), EstimatorCmdLineOptions::TPEF(), PIGCmdLineOptions::tpefFile(), ProGeCmdLineOptions::tpefName(), EstimatorCmdLineOptions::traceDB(), TTAUnitTesterCmdLineOptions::vhdlSim(), TestHDBCmdLineOptions::vhdlSim(), and LLVMTCECmdLineOptions::workItemAAFile().
|
virtual |
Reimplemented in UnsignedIntegerCmdLineOptionParser.
Definition at line 90 of file CmdLineOptionParser.cc.
References __func__.
Referenced by LLVMTCECmdLineOptions::dataStartAddress(), and LLVMTCECmdLineOptions::initialStackPointerValue().
|
private |
Is the value of this option set in the parsed command line?
Definition at line 106 of file CmdLineOptionParser.hh.
Referenced by isDefined(), and setDefined().
|
private |
The description of option.
Definition at line 101 of file CmdLineOptionParser.hh.
|
private |
The hidden flag. If set, no entry is printed in the normal help text.
Definition at line 103 of file CmdLineOptionParser.hh.
Referenced by isHidden().
|
private |
The full name of an option.
Definition at line 97 of file CmdLineOptionParser.hh.
|
private |
The optional alias (shorter name).
Definition at line 99 of file CmdLineOptionParser.hh.