#ifndef TOKEN_H #define TOKEN_H enum tokentype { Txxx, /* Just so we don't have a token with value 0 */ /* keywords */ Tvoid, Tint, Treturn, /* values from source */ Tident, Tconstant, /* syntax/operators */ Tlparen, Trparen, Tlbrace, Trbrace, Tsemicolon, Ntok, }; struct location { usize lineno; usize column; }; struct token { /* location */ struct location loc; /* token type */ enum tokentype type; /* string value, if any */ char *str; }; char* tokname(enum tokentype); enum tokentype findkeyword(char *name); #endif