LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
|
Extracts a number for a string on the stack using a regular expression: ARG1 regexp(S) More...
#include <KernelActions.hpp>
Public Member Functions | |
extractNumber (const std::string s) | |
void | execute (void) |
std::string | name (void) const |
Public Member Functions inherited from loos::internal::Action | |
Action (const std::string s) | |
void | setStack (ValueStack *) |
void | setAtom (pAtom &) |
Additional Inherited Members | |
Protected Member Functions inherited from loos::internal::Action | |
int | binComp (void) |
Compare the top two items on the stack... | |
bool | negativeOperand (void) |
void | binaryFalseResult (void) |
void | requireAtom (void) |
Check to make sure an atom has been set... | |
Protected Attributes inherited from loos::internal::Action | |
ValueStack * | stack |
Pointer to the data stack. | |
pAtom | atom |
Pointer to the atom we'll be working on... | |
std::string | my_name |
Record of command-name (for printing) | |
Extracts a number for a string on the stack using a regular expression: ARG1 regexp(S)
Compiles the passed string into a regex pattern at instantiation. At execution, examines each matched capture for the first one that converts to an integer and pushes that value onto the data stack. If no match is found (or no numeric conversion works), then "-1" is pushed onto the stack.
|
virtual |
Implements loos::internal::Action.
|
virtual |
Reimplemented from loos::internal::Action.