The programs generated by Lex handle
character I/O only through the routines
input,
output,
and
unput.
Thus the character representation
provided in these routines
is accepted by Lex and employed to return
values in
yytext.
For internal use
a character is represented as a small integer
which, if the standard library is used,
has a value equal to the integer value of the bit
pattern representing the character on the host computer.
Normally, the letter
a
is represented as the same form as the character constant
'a'.
If this interpretation is changed, by providing I/O
routines which translate the characters,
Lex must be told about
it, by giving a translation table.
This table must be in the definitions section,
and must be bracketed by lines containing only
``%T''.
The table contains lines of the form
center;
l.
{integer} {character string}
which indicate the value associated with each character.
Thus the next example
center;
l l.
%T
1 Aa
2 Bb
...
26 Zz
27 \n
28 +
29 -
30 0
31 1
...
39 9
%T