LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
Public Member Functions | List of all members
loos::internal::extractNumber Class Reference

Extracts a number for a string on the stack using a regular expression: ARG1 regexp(S) More...

#include <KernelActions.hpp>

Inheritance diagram for loos::internal::extractNumber:
Inheritance graph
[legend]
Collaboration diagram for loos::internal::extractNumber:
Collaboration graph
[legend]

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
ValueStackstack
 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)
 

Detailed Description

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.

Member Function Documentation

◆ execute()

void loos::internal::extractNumber::execute ( void )
virtual

◆ name()

std::string loos::internal::extractNumber::name ( void ) const
virtual

Reimplemented from loos::internal::Action.


The documentation for this class was generated from the following files: