summaryrefslogtreecommitdiffhomepage
path: root/minicc.h
blob: 0500b8c0b61f203d231c72fd58895da777a78d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include <cstdlib>
#include <vector>
#include <string>
#include <iostream>

using index_t = size_t;

std::vector<std::string> split(std::string s);

struct Location {
 size_t line;
 size_t column;
};

bool operator==(const Location &a, const Location &b);

struct Token {
 std::string type;
 std::string value;
 Location location;
};

bool operator==(const Token &a, const Token &b);
std::ostream& operator<<(std::ostream& os, const Token& token);