26 #ifndef CORE_ARGSPARSER_H_ 27 #define CORE_ARGSPARSER_H_ 102 std::map<String, ArgTokenType> reservedWords;
110 void checkVisibility();
111 void checkIndependent();
120 void addLine(
const String &line);
155 virtual bool parse() = 0;
156 virtual void check(std::stringstream & errors) = 0;
164 void unexpectedToken(
String msg =
"");
180 virtual bool parse();
181 virtual void check(std::stringstream & errors)
186 bool acceptArguments(std::stringstream &errors,
size_t &argIndex, std::vector<const char *> &cmdArguments);
211 bool parseArgumentList();
212 virtual bool parse();
213 bool checkRequires(std::stringstream & errors,
ProgramDef *
prog);
214 virtual void check(std::stringstream & errors);
215 bool containsArgument(
const String & argName);
217 bool containsAlias(
const String & alias);
228 virtual bool parse();
229 virtual void check(std::stringstream & errors)
239 std::vector<ParamDef*> *exclusiveGroup;
254 virtual bool parse();
255 virtual void check(std::stringstream & errors);
259 const char * getParam(
const char * paramName,
size_t paramNumber = 0);
260 const char * getParam(
const char * paramName,
const char * subParam,
size_t paramNumber = 0);
262 void addParamRequires(
const String &name);
267 void read(
int argc,
const char ** argv,
bool reportErrors =
true);
ArgTokenType type
Type of the token.
std::vector< ParamDef * > * exclusiveGroup
std::vector< SectionDef * > sections
static const char * typeString(ArgTokenType type)
std::vector< String > StringVector
bool starred
Some special mark to tokens.
std::vector< ParamDef * > subParams
std::vector< const char * > cmdArguments
std::vector< ArgumentDef * > arguments
StringVector pendingRequires
This is for checking that requires names exists.
virtual void check(std::stringstream &errors)
virtual void check(std::stringstream &errors)
struct _parameter * param
std::vector< ParamDef * > params
All params defined for the program.
CommentList examples
examples of use
CommentList usageComments
comments of usage
int line
line where token was found
file read(std::istream &is)
int counter
for count the number of times it appears in command line
String nextToken(const String &str, size_t &i)
String lexeme
the string literal value of the token
std::map< String, ParamDef * > paramsMap
Dictionary with all params and alias names.
check(nparam, nf, nfsr, &Linfty, nineq, nineqn, neq, neqn, ncsrl, ncsrn, mode, &modem, eps, bgbnd, param)