BashSpark
Loading...
Searching...
No Matches
bs::shell_node Class Reference

Base class for all parser nodes. More...

#include <shell_node.h>

Inheritance diagram for bs::shell_node:

Public Member Functions

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.
 

Protected Member Functions

 shell_node (const shell_node_type nType, const std::size_t nPos)
 Protected constructor used by derived classes.
 

Protected Attributes

const shell_node_type m_nType
 Node type.
 
const std::size_t m_nPos
 Position in the input stream.
 

Detailed Description

Base class for all parser nodes.

Holds the node type and its position in the source stream. It is an abstract base for both expandable and evaluable node kinds.

Constructor & Destructor Documentation

◆ shell_node()

bs::shell_node::shell_node ( const shell_node_type  nType,
const std::size_t  nPos 
)
inlineprotected

Protected constructor used by derived classes.

Parameters
nTypeNode type.
nPosPosition in source stream (character offset).

Member Function Documentation

◆ get_pos()

std::size_t bs::shell_node::get_pos ( ) const
inlinenoexcept

Get node position in the original input stream.

Returns
std::size_t Character offset where node was created.

◆ get_type()

shell_node_type bs::shell_node::get_type ( ) const
inlinenoexcept

Get the node type.

Returns
shell_node_type The node's type.

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