MTMS main
Modern Turing Machine Simulator
Loading...
Searching...
No Matches
alphabet.cpp
Go to the documentation of this file.
1
12#include "alphabet.hpp"
13
14#include <ranges>
15
20void Alphabet::print(std::ostream &os) const noexcept
21{
22 os << "{";
23 for (auto [idx, s] : std::views::enumerate(this->set_))
24 {
25 s.print(os);
26 if (idx + 1 < this->size())
27 {
28 os << ", ";
29 }
30 }
31 os << "}";
32}
33
37std::ostream &operator<<(std::ostream &os, const Alphabet &alphabet) noexcept
38{
39 alphabet.print(os);
40 return os;
41}
std::ostream & operator<<(std::ostream &os, const Alphabet &alphabet) noexcept
Direct pipeline bridge forwarding stream requests toward the internal print interface.
Definition alphabet.cpp:37
Alphabet class to manage the collection of valid symbols for the Turing Machine.
Represents the formal alphabet ( or ) of a Turing Machine.
Definition alphabet.hpp:27
void print(std::ostream &os=std::cout) const noexcept
Prints the alphabet in mathematical set notation format (e.g., "{0, 1}").
Definition alphabet.cpp:20