1
2 make_token:
3 procedure;
4
5
6
7
8
9
10 token_length = source_index - token_start;
11
12 if token_type = identifier & token_length > max_identifier_length
13 then call print_error (2, "Identifier too long.", token_start);
14
15 tokenx = tokenx + 1;
16 if tokenx >= replacement_token_index
17 then call print_error (4, "Too many tokens.", token_start);
18
19 token (tokenx).type = token_type;
20 token (tokenx).string_size = token_length;
21 token (tokenx).string_ptr, token_ptr = addr (source_string_array (token_start));
22 token (tokenx).created = "0"b;
23 token (tokenx).pct_type = pct_type;
24 token (tokenx).replace_by = none;
25
26 end make_token;
27
28 make_replacement_token:
29 procedure (alias_index);
30
31 declare alias_index fixed binary;
32
33 tokenx = tokenx + 1;
34 if tokenx >= replacement_token_index
35 then call print_error (4, "Too many tokens.", token_start);
36
37 token (tokenx) = token (alias_index);
38 if token (tokenx).replace_by = alias_index
39 then token (tokenx).replace_by = none;
40
41 end make_replacement_token;
42