1
0
Bifurcation 0
school/cs236/lexer/token.cpp

12 lignes
521 B
C++

#include "token.h"
token::token(string type, string character, int line_num) :
type(type), character(character), line_num(line_num) {}
ostream & operator<<(ostream & os, token tk) {
os << "(" << tk.type
<< ",\"" << tk.character
<< "\"," << tk.line_num << ")";
return os;
}