blob: d50a46da67cbed6ff2dd771ec831fd308233fa7a (
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
27
28
29
30
|
#ifndef re2c_token_h
#define re2c_token_h
#include "substr.h"
typedef struct Token {
Str text;
unsigned int line;
} Token;
static void Token_init(Token *, SubStr, unsigned int);
static Token *Token_new(SubStr, unsigned int);
static void
Token_init(Token *r, SubStr t, unsigned int l)
{
Str_copy(&r->text, &t);
r->line = l;
}
static Token *
Token_new(SubStr t, unsigned int l)
{
Token *r = malloc(sizeof(Token));
Str_init(&r->text, &t);
r->line = l;
return r;
}
#endif
|