retdec
|
A generator of words as variable names. More...
#include <word_var_name_gen.h>
Public Member Functions | |
virtual std::string | getId () const override |
Returns the ID of the generator. More... | |
virtual void | restart () override |
Restarts the generator to start returning variable names from the beginning. More... | |
virtual std::string | getNextVarName () override |
Returns a next variable name. More... | |
![]() | |
virtual | ~VarNameGen ()=default |
const std::string & | getPrefix () const |
Returns the prefix used by the generator. More... | |
Static Public Member Functions | |
static UPtr< VarNameGen > | create (std::string prefix="") |
Creates a new WordVarNameGen object. More... | |
Private Member Functions | |
WordVarNameGen (std::string prefix) | |
Constructs a new WordVarNameGen object. More... | |
Private Attributes | |
std::size_t | nextWordIndex |
Index to the next word. More... | |
Additional Inherited Members | |
![]() | |
VarNameGen (std::string prefix="") | |
Constructs a new variable name generator. More... | |
![]() | |
const std::string | prefix |
The prefix of all returned variable names. More... | |
A generator of words as variable names.
Use create() to create instances.
At each call of getNextVarName(), a new English word is returned. Each returned variable name is prefixed with prefix
, where prefix
is the parameter of create(). When there are no available names to be returned, getNextVarName() starts returning the names from the beginning.
|
private |
Constructs a new WordVarNameGen object.
For more details, see create().
|
static |
Creates a new WordVarNameGen object.
[in] | prefix | Prefix of all returned variable names. |
|
overridevirtual |
Returns the ID of the generator.
Implements retdec::llvmir2hll::VarNameGen.
|
overridevirtual |
Returns a next variable name.
If there is no next variable name available, the generator starts generating names from the beginning.
Implements retdec::llvmir2hll::VarNameGen.
|
overridevirtual |
Restarts the generator to start returning variable names from the beginning.
Note that there is no requirement for this class to return variable names in the same order between consecutive calls to this function.
Implements retdec::llvmir2hll::VarNameGen.
|
private |
Index to the next word.