Modifications to Unix C compiler
NEVILLE%umass-cs.csnet at csnet-relay.arpa
NEVILLE%umass-cs.csnet at csnet-relay.arpa
Fri Jul 12 15:02:49 AEST 1985
i am in the (very) early stages of some modifications to the portable
("machine-independent part") of the Unix C compiler. Actually, for reasons
already hashed out locally, the changes will be implemented as a filter
inserted between the pre-processor and the compiler. This filter must
recognize a number of new storage classes, scoping of variables, etc., and
thus must be in effect a compiler-sans-code-generator.
i have been digging around in the compiler source to try to understand
the data structures used, symbol table access, and all that rot but
reading lex/yacc generated code with such a proliferation of global
variables is difficult at best.
If anyone who is familiar with the compiler source could help on this,
it would be sure to save a great deal of time and coffee. What i need to
do isn't that complicated :
Having built in a new storage class (say, CLASS_3),
1. Parse the program, noting when a variable of class CLASS_3
is referenced (for either read OR write)
2. Replace the variable reference with a pre-defined macro expansion
3. Copy all other text onto the output stream
Of course, there will be a little footwork required to generate/copy text
while working at both the character and token levels, but that's not all
that difficult.
As i doubt that the rest of the folks on the net would be interested in
replies to this posting, you can respond directly to me.
ThanX,
Neville D. Newman
newman at umass-cs (CSnet)
More information about the Comp.unix.wizards
mailing list