return(tok);
}
+struct token *token_new_from_char(const int line, const int col, const char chr)
+{
+ struct token *tok;
+
+ tok = token_new();
+
+ if(tok) {
+ char val[2];
+
+ val[0] = chr;
+ val[1] = 0;
+
+ token_setpos(tok, line, col);
+ assert(token_setvalue(tok, val) == 0);
+ }
+
+ return(tok);
+}
+
void token_free(struct token *tok)
{
free(tok);
struct token *token_new2(const int, const int, const char*);
struct token *token_new(void);
+struct token *token_new_from_char(const int, const int, const char);
void token_free(struct token*);
void token_setpos(struct token*, const int, const int);
int token_setvalue(struct token*, const char*);