#include <algorithm>
#include <iostream>
#include <regex>
#include <string>
#include <utility>
#include <vector>

using namespace std;

enum POSES // Deliminators
{
	EQUALS,
	OPEN,
	CLOSE,
	SPACE,
	EOL,
	RETURN,
	TAB,
	COMMENT,
	POSES_SIZE
};

int main() {
	const auto input = "#Comment\n\nshow_position = { x=-9 y =78 }"s;
	vector<pair<POSES, string>> tokens;
	const regex re{ "\\s*(?:\n|(#[^\n]*)|(\\{)|(\\})|(=)|([^{}= \t\r\n]+))" };

	for_each(sregex_iterator(cbegin(input), cend(input), re), sregex_iterator(), [&](const auto& i) {
		if (i[1].length() > 0U) {
			tokens.emplace_back(COMMENT, i[1]);
		} else if (i[2].length() > 0U) {
			tokens.emplace_back(OPEN, "{"s);
		} else if (i[3].length() > 0U) {
			tokens.emplace_back(CLOSE, "}"s);
		} else if (i[4].length() > 0U) {
			tokens.emplace_back(EQUALS, "="s);
		} else if (i[5].length() > 0U) {
			tokens.emplace_back(POSES_SIZE, i[5]);
		}
	});

	for (const auto& i : tokens) {
		switch (i.first) {
		case EQUALS:
			cout << "EQUALS:     =\n";
			break;
		case OPEN:
			cout << "OPEN:       {\n";
			break;
		case CLOSE:
			cout << "CLOSE:      }\n";
			break;
		case COMMENT:
			cout << "COMMENT:    " << i.second << endl;
			break;
		case POSES_SIZE:
			cout << "POSES_SIZE: " << i.second << endl;
		}
	}
}