home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume3
/
totri
/
README
< prev
next >
Wrap
Text File
|
1989-02-03
|
1KB
|
21 lines
The DRAFT ANSI C standard specifies that all conforming compilers must
support "trigraphs" as an alternate means of writing certain characters
(which are absent from the international ISO 646 repertoire).
Personally, I think that trigraphs are UGLY, and absolutely the WRONG
way to solve this problem. Certainly I believe that trigraph processing
does not belong in the C compiler, but would be better specified as
an external facility.
In any case, since the standard specifies that the conversion from
trigraphs takes place in the very first processing phase, it is
easy to implement trigraphs as a simple preprocessor. I have written
two programs: one that removes (translates) all trigraph sequences
into the more usual ASCII representation, and the second, which
does the reverse (converts US-ASCII into trigraphs).
I hope someone finds these useful. I have donated the source code
to the public domain. Both programs are implemented as filters,
but it would be easy to change the interface by rewriting main.
The functions that do the work take input and outfile "FILE *"
descriptors.