Extracts a number for a string on the stack using a regular expression: ARG1 regexp(S) More...
|extractNumber (const std::string s)|
|std::string||name (void) const|
|Public Member Functions inherited from loos::internal::Action|
|Action (const std::string s)|
|void||setStack (ValueStack *)|
|void||setAtom (pAtom &)|
|Protected Member Functions inherited from loos::internal::Action|
|Compare the top two items on the stack... |
|Check to make sure an atom has been set... |
|Protected Attributes inherited from loos::internal::Action|
|Pointer to the data stack. |
|Pointer to the atom we'll be working on... |
|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.