1 /* BEGIN INCLUDE FILE ... pl1_macro_token_procs.incl.pl1 */
 2 make_token:
 3      procedure;
 4 
 5 /* Make a Token.    Conventions:
 6           token_type          set to the correct type
 7           token_start         set to index of first character of token
 8           source_index        set to index of first character after token */
 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;      /* INPUT: index of token to be copied */
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 /* END INCLUDE FILE pl1_macro_token_procs.incl.pl1 */