BashSpark
Loading...
Searching...
No Matches
bs::shell_node_word Class Referencefinal

A plain word token node. More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node_word:
Collaboration diagram for bs::shell_node_word:

Public Member Functions

 shell_node_word (const std::size_t nPos, std::string sText)
 Construct a word node.
 
void expand (std::vector< std::string > &vTokens, shell_session &oSession, bool bSplit) const override
 Expand by appending the literal text as a token. Expand the node into textual tokens.
Parameters
vTokensVector where generated token strings will be appended.
oSessionSession context (used for variable/argument lookup, etc.).
bSplitWhen true apply word-splitting semantics; otherwise keep as single token.
.
 
std::string get_text () const noexcept
 Get the stored text.
 
- Public Member Functions inherited from bs::shell_node_expandable
 shell_node_expandable (const shell_node_type nType, const std::size_t nPos)
 Construct an expandable node.
 
- Public Member Functions inherited from bs::shell_node
virtual ~shell_node ()=default
 Virtual default destructor for polymorphic deletion.
 
shell_node_type get_type () const noexcept
 Get the node type.
 
std::size_t get_pos () const noexcept
 Get node position in the original input stream.
 

Additional Inherited Members

- Protected Member Functions inherited from bs::shell_node
 shell_node (const shell_node_type nType, const std::size_t nPos)
 Protected constructor used by derived classes.
 
- Protected Attributes inherited from bs::shell_node
const shell_node_type m_nType
 Node type.
 
const std::size_t m_nPos
 Position in the input stream.
 

Detailed Description

A plain word token node.

Contains raw text that will be appended as-is when expanded.

Constructor & Destructor Documentation

◆ shell_node_word()

bs::shell_node_word::shell_node_word ( const std::size_t  nPos,
std::string  sText 
)
inline

Construct a word node.

Parameters
nPosPosition in stream.
sTextThe literal word text (moved in).

Member Function Documentation

◆ expand()

void bs::shell_node_word::expand ( std::vector< std::string > &  vTokens,
shell_session oSession,
bool  bSplit 
) const
overridevirtual

Expand by appending the literal text as a token. Expand the node into textual tokens.

Parameters
vTokensVector where generated token strings will be appended.
oSessionSession context (used for variable/argument lookup, etc.).
bSplitWhen true apply word-splitting semantics; otherwise keep as single token.
.

Implements bs::shell_node_expandable.

◆ get_text()

std::string bs::shell_node_word::get_text ( ) const
inlinenoexcept

Get the stored text.

Returns
std::string Literal word content.

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