Bash++
Bash++ compiler internal documentation
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
ExpectationsStack Class Reference

A stack to manage ContextExpectations during AST traversal. More...

#include <ContextExpectations.h>

Collaboration diagram for ExpectationsStack:
Collaboration graph
[legend]

Public Member Functions

void push (const ContextExpectations &expectations)
 
void push (bool can_take_primitive, bool can_take_object)
 
void pop ()
 
ContextExpectations top () const
 
bool canTakePrimitive () const
 
bool canTakeObject () const
 

Private Attributes

std::stack< ContextExpectationsstack
 

Static Private Attributes

static constexpr ContextExpectations default_expectations = {true, false}
 

Detailed Description

A stack to manage ContextExpectations during AST traversal.

This class provides a stack-based mechanism to manage ContextExpectations as the parser traverses different contexts in the AST.

Member Function Documentation

◆ canTakeObject()

bool ExpectationsStack::canTakeObject ( ) const
inline

◆ canTakePrimitive()

bool ExpectationsStack::canTakePrimitive ( ) const
inline

◆ pop()

void ExpectationsStack::pop ( )
inline

◆ push() [1/2]

void ExpectationsStack::push ( bool  can_take_primitive,
bool  can_take_object 
)
inline

◆ push() [2/2]

void ExpectationsStack::push ( const ContextExpectations expectations)
inline

◆ top()

ContextExpectations ExpectationsStack::top ( ) const
inline

Member Data Documentation

◆ default_expectations

constexpr ContextExpectations ExpectationsStack::default_expectations = {true, false}
staticconstexprprivate

◆ stack

std::stack<ContextExpectations> ExpectationsStack::stack
private

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