home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource5
/
329_01
/
read.me
< prev
next >
Wrap
Text File
|
1990-11-29
|
3KB
|
92 lines
CSUBST version 2.5
This is a programme for extracting or changing the names of
identifiers and strings in C source code.
It can help you adapt a programme so that its English messages
can be changed to Italian, for example.
It can be easily adapted to other programming languages than C
because the C dependent part is written in Lex. It can even
be worthwhile to apply it unchanged to English text.
Usage: CSUBST -S subst_file source_files...
in substitution mode
Note: the "-S" is redundant.
or CSUBST -X cfiles ...
in extraction mode,
or CSUBST -F workfile -X
or CSUBST -ntruncation_length -Mignore_file source_file
where:
* cfiles is the name of a C source file.
* subst_file is a file with pairs of identifiers or strings separated
by spaces or newlines.
* workfile is the name of a file in which there are filenames
* truncation_length is a positive integer
* ignore_file is a file containing list of names not to be truncated
The following few lines are the beginning of a
substitution file:
root racine
node noeud
"Hello world"
"Salut la terre"
"Goodbye cruel world"
"Au revoir, O monde cruel"
...
Be careful! Other tokens are either ignored or not allowed.
In substitution mode the source file is read and identifiers
are replaced if they appear as the left part of a substitution
in the subst_file. They are replaced by the corresponding
right hand identifier. The result is sent to the standard output
and can therefore be redirected to a file.
If you look at the sources you will see that the variable Mode will start
as READ_SUBSTS and then switch to APPLY_SUBSTS.
In extraction mode the source file is scanned and a sorted table of
the identifiers is sent to the standard output. The purpose of this is
to help you write a substitution file.
The last feature to have been added concerns printing
files while truncating identifiers. By way of example consider:
csubst -n8 -Mmacnames.dat foo.c
will print foo.c truncating identifier names to 8 characters (or whatever
you supply) except for those names that figure in macnames.dat.
In macnames you would probably want to put all the names of the
macros that are defined outside foo.c. csubst is not yet "smart" enough
to look up the include files so as to tell what identifiers are macros
but it will recognise those that are defined in the current file (foo.c).
The source files are
csubst.l -- the lex file for the programme
lexyy.c -- a file generated by flex from csubst.l
cs_main.c -- the file containing the main()
cs_hash.c -- the module that handles the list of substitutions
makefile.tbc -- a makefile for Turbo C on MSDOS
makefile.mwc -- a makefile for Mark Williams C on Atari TOS
makefile.ztc -- a makefile for Zortech C on DOS
csubst.mak -- a makefile for Quick C
read.me -- this file
cs_xtrct.c -- the code for handling extraction mode.
csubst.h -- manifest constants
skeleton.h -- include file for lexyy.c
skelcom.h -- include file for lexyy.c
st_lexyy.c -- lexyy.c for atari ST
You won't need lex or flex unless you modify csubst.l.
This programme is shareware, but almost freeware:
If you found this programme useful then send me a colourful postcard
with the words "Happy Birthday" (or equivalent) so that it arrives
at my address around the first of January 1991. After that date
this is public domain.
Henri de Feraudy
27 rue Chef de Ville
92140 Clamart
France