home *** CD-ROM | disk | FTP | other *** search
- From: Lutz Prechelt <prechelt@ira.uka.de>
- Subject: v02i014: crefine - (Ver. 3.0) C language extension, Part01/06
- Newsgroups: comp.sources.reviewed
- Approved: csr@calvin.dgbt.doc.ca
-
- Submitted-by: Lutz Prechelt <prechelt@ira.uka.de>
- Posting-number: Volume 2, Issue 14
- Archive-name: crefine/part01
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: README MANIFEST INSTALL COPYING TO_DO Makefile ccr std.h
- # cr_decl.h cr_texts.h getargs.h patchlevel.h
- # Wrapped by prechelt@Sansibar on Fri Jun 12 13:13:43 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(3790 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- X
- X>>>>> This is README for C-Refine Version 3.0 <<<<<
- X
- XC-Refine is a preprocessor for programs written in C or C++ or a similar
- Xlanguage. It introduces an additional language construct called 'refinement'
- Xwhich allows further decomposition with symbolic names inside functions.
- XThis makes programs much easier to read and modify and is very comfortable
- Xfor programming.
- X
- XWe also call these extended languages C-Refine (or C++-Refine, and so on).
- XThe C-Refine preprocessor converts program written in C-Refine into plain C,
- Xand programs written in C++-Refine into normal C++, and programs
- Xwritten in Objective-C-Refine into normal Objective-C, and so on.
- XThe preprocessor is much faster than a C compiler, so it will not
- Xunbearably slow down the overall compilation process.
- X
- XThe installed system consists of a single executable file (crefine) and one
- XUnix Manualpage (crefine.1). An additional driver shell script (ccr) plus
- XManualpage are also provided.
- XNo further data files or libraries except the standard C library are needed.
- X
- X------------------------------------------------------------------------------
- X
- XPortability:
- X------------
- XC-Refine is completely portable to all machines that have a standard
- XC library.
- XIt should readily compile at least on all ANSI-C machines, all
- Xstandard BSD-Unix machines and standard System V machines.
- X
- XIf #include <strings.h> fails, change it to #include <string.h>
- XIf #include <string.h> fails, change it to #include <strings.h>
- X
- X------------------------------------------------------------------------------
- X
- XCompilation:
- X------------
- X
- XUsually, no changes in the Makefile are required.
- X
- XTo generate C-Refine (which is bootstrapped, i.e. written in C-Refine)
- Xyou must first compile the preprocessed version of the files.
- X
- XThis is done with the command
- X make crefine
- Xwhich should compile from the *.c files.
- XIf this doesn't work, please issue a
- X touch *.c
- Xand try again.
- XThe *.c files have to be newer than the *.cr files or else make will try
- Xto call crefine to transform *.cr files into *.c files, which of course
- Xis not possible for you in the beginning, if you don't already have crefine.
- X
- XIf you have a working version of C-Refine you can bootstrap it via
- X make completely_clean crefine
- X
- XWhat you see then is no error: C-Refine works extremely fast; you will
- Xhardly notice the time it takes for running crefine before the compiler is
- Xstarted on each source file.
- X
- XThe Makefile is a bit simple-minded.
- X
- X------------------------------------------------------------------------------
- X
- XEnvironments where C-Refine already once worked:
- X
- XMachine Operating System (and perhaps Compiler)
- X------- ---------------------------------------
- XApollo DN3xxx DOMAIN/OS SR10.3 BSD (ANSI C 6.8)
- XApollo series 400 DOMAIN/OS SR10.3 BSD (ANSI C 6.8)
- XAtari ST OS-9/68000 V2.3
- XAT/386 ISC Unix 3.2.2 (GNU C 1.39)
- XAT/386 SCO Unix 3.2.2 (cc or GNU C 1.40 without optimization)
- XAT&T 3B2 System V
- XCommodore Amiga AmigaOS 1.3 (DICE 2.06.33)
- XConvex C2 Convex OS
- XDECstation 3100 Ultrix 4.1
- XDG Aviion 4620 System V r4.1
- XNext 68040 NextStep 2.0
- XOpus System PM-417 System V r3.2
- XPC etc. MS-DOS 3.2 (Microsoft C 5.0)
- XPC etc. OS/2 Vers. 1.3 (Microsoft C 6.0)
- XPCS (type???) some System V
- XSequent Symmetry DYNIX 3.1.4
- XSun3 SUN-OS 3.5
- XSun3,Sun4 SUN-OS 4.03
- XSun3,Sun4 SUN-OS 4.1
- XVAXstation 3250 Ultrix-32 V3.1
- X
- X------------------------------------------------------------------------------
- X
- XC-Refine was designed and implemented by
- X Lutz Prechelt, Universitaet Karlsruhe, Germany
- X prechelt@ira.uka.de
- X
- XC-Refine is distributed under the GNU general public licence ("Copyleft").
- XSee the file COPYING for details.
- END_OF_FILE
- if test 3790 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(240 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- XCOPYING
- XINSTALL
- XMANIFEST
- XMakefile
- XREADME
- XTO_DO
- Xccr
- Xccr.1
- Xccr.man
- Xcr_decl.h
- Xcr_getln.c
- Xcr_getln.cr
- Xcr_talk.c
- Xcr_talk.cr
- Xcr_texts.h
- Xcrefine.1
- Xcrefine.c
- Xcrefine.cr
- Xcrefine.man
- Xerato.c
- Xerato.cr
- Xgetargs.c
- Xgetargs.cr
- Xgetargs.h
- Xpatchlevel.h
- Xstd.h
- END_OF_FILE
- if test 240 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'INSTALL' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'INSTALL'\"
- else
- echo shar: Extracting \"'INSTALL'\" \(321 characters\)
- sed "s/^X//" >'INSTALL' <<'END_OF_FILE'
- XTo install crefine just put the stripped executable file "crefine" into
- Xa directory where executables reside (such as "/usr/local/bin" or
- X"/tools/bin" under Unix) and put the Manualpage into a directory where
- XManpages reside such as "/usr/local/man/man1" or "/tools/man/man1".
- X
- XThat's all.
- X
- XFor compilation, see README.
- X
- END_OF_FILE
- if test 321 -ne `wc -c <'INSTALL'`; then
- echo shar: \"'INSTALL'\" unpacked with wrong size!
- fi
- # end of 'INSTALL'
- fi
- if test -f 'COPYING' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'COPYING'\"
- else
- echo shar: Extracting \"'COPYING'\" \(12488 characters\)
- sed "s/^X//" >'COPYING' <<'END_OF_FILE'
- X
- X GNU GENERAL PUBLIC LICENSE
- X Version 1, February 1989
- X
- X Copyright (C) 1989 Free Software Foundation, Inc.
- X 675 Mass Ave, Cambridge, MA 02139, USA
- X Everyone is permitted to copy and distribute verbatim copies
- X of this license document, but changing it is not allowed.
- X
- X Preamble
- X
- X The license agreements of most software companies try to keep users
- Xat the mercy of those companies. By contrast, our General Public
- XLicense is intended to guarantee your freedom to share and change free
- Xsoftware--to make sure the software is free for all its users. The
- XGeneral Public License applies to the Free Software Foundation's
- Xsoftware and to any other program whose authors commit to using it.
- XYou can use it for your programs, too.
- X
- X When we speak of free software, we are referring to freedom, not
- Xprice. Specifically, the General Public License is designed to make
- Xsure that you have the freedom to give away or sell copies of free
- Xsoftware, that you receive source code or can get it if you want it,
- Xthat you can change the software or use pieces of it in new free
- Xprograms; and that you know you can do these things.
- X
- X To protect your rights, we need to make restrictions that forbid
- Xanyone to deny you these rights or to ask you to surrender the rights.
- XThese restrictions translate to certain responsibilities for you if you
- Xdistribute copies of the software, or if you modify it.
- X
- X For example, if you distribute copies of a such a program, whether
- Xgratis or for a fee, you must give the recipients all the rights that
- Xyou have. You must make sure that they, too, receive or can get the
- Xsource code. And you must tell them their rights.
- X
- X We protect your rights with two steps: (1) copyright the software, and
- X(2) offer you this license which gives you legal permission to copy,
- Xdistribute and/or modify the software.
- X
- X Also, for each author's protection and ours, we want to make certain
- Xthat everyone understands that there is no warranty for this free
- Xsoftware. If the software is modified by someone else and passed on, we
- Xwant its recipients to know that what they have is not the original, so
- Xthat any problems introduced by others will not reflect on the original
- Xauthors' reputations.
- X
- X The precise terms and conditions for copying, distribution and
- Xmodification follow.
- X
- X GNU GENERAL PUBLIC LICENSE
- X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- X
- X 0. This License Agreement applies to any program or other work which
- Xcontains a notice placed by the copyright holder saying it may be
- Xdistributed under the terms of this General Public License. The
- X"Program", below, refers to any such program or work, and a "work based
- Xon the Program" means either the Program or any work containing the
- XProgram or a portion of it, either verbatim or with modifications. Each
- Xlicensee is addressed as "you".
- X
- X 1. You may copy and distribute verbatim copies of the Program's source
- Xcode as you receive it, in any medium, provided that you conspicuously and
- Xappropriately publish on each copy an appropriate copyright notice and
- Xdisclaimer of warranty; keep intact all the notices that refer to this
- XGeneral Public License and to the absence of any warranty; and give any
- Xother recipients of the Program a copy of this General Public License
- Xalong with the Program. You may charge a fee for the physical act of
- Xtransferring a copy.
- X
- X 2. You may modify your copy or copies of the Program or any portion of
- Xit, and copy and distribute such modifications under the terms of Paragraph
- X1 above, provided that you also do the following:
- X
- X a) cause the modified files to carry prominent notices stating that
- X you changed the files and the date of any change; and
- X
- X b) cause the whole of any work that you distribute or publish, that
- X in whole or in part contains the Program or any part thereof, either
- X with or without modifications, to be licensed at no charge to all
- X third parties under the terms of this General Public License (except
- X that you may choose to grant warranty protection to some or all
- X third parties, at your option).
- X
- X c) If the modified program normally reads commands interactively when
- X run, you must cause it, when started running for such interactive use
- X in the simplest and most usual way, to print or display an
- X announcement including an appropriate copyright notice and a notice
- X that there is no warranty (or else, saying that you provide a
- X warranty) and that users may redistribute the program under these
- X conditions, and telling the user how to view a copy of this General
- X Public License.
- X
- X d) You may charge a fee for the physical act of transferring a
- X copy, and you may at your option offer warranty protection in
- X exchange for a fee.
- X
- XMere aggregation of another independent work with the Program (or its
- Xderivative) on a volume of a storage or distribution medium does not bring
- Xthe other work under the scope of these terms.
- X
- X 3. You may copy and distribute the Program (or a portion or derivative of
- Xit, under Paragraph 2) in object code or executable form under the terms of
- XParagraphs 1 and 2 above provided that you also do one of the following:
- X
- X a) accompany it with the complete corresponding machine-readable
- X source code, which must be distributed under the terms of
- X Paragraphs 1 and 2 above; or,
- X
- X b) accompany it with a written offer, valid for at least three
- X years, to give any third party free (except for a nominal charge
- X for the cost of distribution) a complete machine-readable copy of the
- X corresponding source code, to be distributed under the terms of
- X Paragraphs 1 and 2 above; or,
- X
- X c) accompany it with the information you received as to where the
- X corresponding source code may be obtained. (This alternative is
- X allowed only for noncommercial distribution and only if you
- X received the program in object code or executable form alone.)
- X
- XSource code for a work means the preferred form of the work for making
- Xmodifications to it. For an executable file, complete source code means
- Xall the source code for all modules it contains; but, as a special
- Xexception, it need not include source code for modules which are standard
- Xlibraries that accompany the operating system on which the executable
- Xfile runs, or for standard header files or definitions files that
- Xaccompany that operating system.
- X
- X 4. You may not copy, modify, sublicense, distribute or transfer the
- XProgram except as expressly provided under this General Public License.
- XAny attempt otherwise to copy, modify, sublicense, distribute or transfer
- Xthe Program is void, and will automatically terminate your rights to use
- Xthe Program under this License. However, parties who have received
- Xcopies, or rights to use copies, from you under this General Public
- XLicense will not have their licenses terminated so long as such parties
- Xremain in full compliance.
- X
- X 5. By copying, distributing or modifying the Program (or any work based
- Xon the Program) you indicate your acceptance of this license to do so,
- Xand all its terms and conditions.
- X
- X 6. Each time you redistribute the Program (or any work based on the
- XProgram), the recipient automatically receives a license from the original
- Xlicensor to copy, distribute or modify the Program subject to these
- Xterms and conditions. You may not impose any further restrictions on the
- Xrecipients' exercise of the rights granted herein.
- X
- X 7. The Free Software Foundation may publish revised and/or new versions
- Xof the General Public License from time to time. Such new versions will
- Xbe similar in spirit to the present version, but may differ in detail to
- Xaddress new problems or concerns.
- X
- XEach version is given a distinguishing version number. If the Program
- Xspecifies a version number of the license which applies to it and "any
- Xlater version", you have the option of following the terms and conditions
- Xeither of that version or of any later version published by the Free
- XSoftware Foundation. If the Program does not specify a version number of
- Xthe license, you may choose any version ever published by the Free Software
- XFoundation.
- X
- X 8. If you wish to incorporate parts of the Program into other free
- Xprograms whose distribution conditions are different, write to the author
- Xto ask for permission. For software which is copyrighted by the Free
- XSoftware Foundation, write to the Free Software Foundation; we sometimes
- Xmake exceptions for this. Our decision will be guided by the two goals
- Xof preserving the free status of all derivatives of our free software and
- Xof promoting the sharing and reuse of software generally.
- X
- X NO WARRANTY
- X
- X 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
- XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
- XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
- XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
- XREPAIR OR CORRECTION.
- X
- X 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
- XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
- XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
- XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
- XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
- XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
- XPOSSIBILITY OF SUCH DAMAGES.
- X
- X END OF TERMS AND CONDITIONS
- X
- X Appendix: How to Apply These Terms to Your New Programs
- X
- X If you develop a new program, and you want it to be of the greatest
- Xpossible use to humanity, the best way to achieve this is to make it
- Xfree software which everyone can redistribute and change under these
- Xterms.
- X
- X To do so, attach the following notices to the program. It is safest to
- Xattach them to the start of each source file to most effectively convey
- Xthe exclusion of warranty; and each file should have at least the
- X"copyright" line and a pointer to where the full notice is found.
- X
- X <one line to give the program's name and a brief idea of what it does.>
- X Copyright (C) 19yy <name of author>
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 1, or (at your option)
- X any later version.
- X
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X
- XAlso add information on how to contact you by electronic and paper mail.
- X
- XIf the program is interactive, make it output a short notice like this
- Xwhen it starts in an interactive mode:
- X
- X Gnomovision version 69, Copyright (C) 19xx name of author
- X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- X This is free software, and you are welcome to redistribute it
- X under certain conditions; type `show c' for details.
- X
- XThe hypothetical commands `show w' and `show c' should show the
- Xappropriate parts of the General Public License. Of course, the
- Xcommands you use may be called something other than `show w' and `show
- Xc'; they could even be mouse-clicks or menu items--whatever suits your
- Xprogram.
- X
- XYou should also get your employer (if you work as a programmer) or your
- Xschool, if any, to sign a "copyright disclaimer" for the program, if
- Xnecessary. Here a sample; alter the names:
- X
- X Yoyodyne, Inc., hereby disclaims all copyright interest in the
- X program `Gnomovision' (a program to direct compilers to make passes
- X at assemblers) written by James Hacker.
- X
- X <signature of Ty Coon>, 1 April 1989
- X Ty Coon, President of Vice
- X
- XThat's all there is to it!
- END_OF_FILE
- if test 12488 -ne `wc -c <'COPYING'`; then
- echo shar: \"'COPYING'\" unpacked with wrong size!
- fi
- # end of 'COPYING'
- fi
- if test -f 'TO_DO' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'TO_DO'\"
- else
- echo shar: Extracting \"'TO_DO'\" \(1136 characters\)
- sed "s/^X//" >'TO_DO' <<'END_OF_FILE'
- X
- X ==========================
- X Things to do to C-Refine
- X ==========================
- X
- X-- Lutz Prechelt, 08.05.92
- X Improve ccr to allow direct option passing to crefine.
- X Be careful not to get dependent on which options the C compiler
- X recognizes.
- X
- X-- Lutz Prechelt, 08.05.92
- X Improve ccr to allow calling the preprocessor before running crefine.
- X
- X-- Lutz Prechelt, 08.05.92
- X Write a manpage for ccr.
- X
- X-- Lutz Prechelt, 08.05.92
- X Write an Emacs editing mode 'C-Refine mode', based on 'C mode'.
- X
- X-- Lutz Prechelt, 08.05.92
- X Extend the idea to other languages, e.g. Lisp, Scheme, Eiffel, Sather
- X It is difficult to do it as simple as C-Refine now is for a language
- X that does not have something equivalent to #line (except if the
- X language is interpretive instead of compiled).
- X
- X-- Lutz Prechelt, 08.05.92
- X Use GNU-style option processing.
- X
- X-- Lutz Prechelt, 12.06.92
- X Write a concept paper, explaining more deeply how C-Refine works and
- X why and what it is good for.
- X
- X-- Lutz Prechelt, 12.06.92
- X Make all buffers fully dynamic (autoexpanding) to avoid the need
- X for the options selecting their size.
- X
- X
- END_OF_FILE
- if test 1136 -ne `wc -c <'TO_DO'`; then
- echo shar: \"'TO_DO'\" unpacked with wrong size!
- fi
- # end of 'TO_DO'
- fi
- if test -f 'Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile'\"
- else
- echo shar: Extracting \"'Makefile'\" \(3679 characters\)
- sed "s/^X//" >'Makefile' <<'END_OF_FILE'
- X#Makefile for C-Refine
- X#Author: Lutz Prechelt, Karlsruhe, Germany
- X#Date : 12.06.92
- X
- X# Usage:
- X# Perhaps change the macro CC below if you want to use a different compiler.
- X# Then call
- X# make crefine
- X# to get a version of crefine that is at first made from
- X# the unC-Refine'd sources of C-Refine.
- X# With this version of C-Refine you can then bootstrap C-Refine by
- X# 'touch'ing the .cr files and again executing
- X# make crefine
- X# You should normally remove the -n0 option from CRFLAGS so to get only such
- X# messages from your compiler that point to the .cr file instead of to
- X# the .c file
- X#
- X# Translation is done in two phases with separate rules:
- X# First from .cr to .c if the .cr file is newer,
- X# then from .c to .o
- X# In the makefiles of bigger projects I usually prefer to hold all the
- X# .c files in some tmp directory, so that they don't clobber your working
- X# directory and to have a single rule going from .cr to .o
- X# Be careful and keep a copy of 'crefine' when experimenting
- X# with changes!
- X#
- X# Installation can be performed by
- X# make install
- X# which copies the crefine binary, ccr shell script to the directory given
- X# by the BINDESTDIR variable and copies the crefine.1 manpage to the
- X# directory given by the MANDESTDIR variable. Please check and perhaps
- X# change these variables first.
- X#
- X
- X#-----constants
- X
- XCLD= getargs.o crefine.o cr_talk.o cr_getln.o
- XCS= getargs.c crefine.c cr_talk.c cr_getln.c
- XHS= getargs.h crefine.h cr_talk.h cr_getln.h std.h cr_texts.h
- X
- XCR=crefine
- XCRFLAGS= -ac -s- -T8
- XCC=cc
- XCFLAGS= -I"." -DNDEBUG=1 -Ddebug=0 -Dms_dos=0 -Ddeutsch=0
- XLDFLAGS=
- XBINDESTDIR=/usr/local/bin
- XMANDESTDIR=/usr/man/man1
- X
- X
- X#-----rules
- X
- X.SUFFIXES: .o .c .cr
- X
- X.cr.c:
- X $(CR) $(CRFLAGS) $*.cr
- X
- X.c.o:
- X $(CC) $(CFLAGS) -c $<
- X
- X#-----program
- X
- Xcrefine: $(CLD)
- X $(CC) $(LDFLAGS) -o crefine $(CLD)
- X
- Xgetargs.o: getargs.h std.h
- X
- Xcrefine.o: cr_decl.h getargs.h std.h
- X
- Xcr_talk.o: cr_decl.h cr_texts.h std.h
- X
- Xcr_getln.o: cr_decl.h std.h
- X
- X#-----documentation
- X
- Xcrefine.man: crefine.1
- X nroff -man crefine.1 | col -b >crefine.man
- X
- Xccr.man: ccr.1
- X nroff -man ccr.1 | col -b >ccr.man
- X
- X#-----cleanup
- X
- Xclean:
- X -rm -f core *~ *.o
- X -strip crefine
- X
- Xcompletely_clean: clean
- X -rm -f *.c crefine
- X
- X#-----installation
- X
- Xinstall:
- X -strip crefine
- X cp crefine ccr $(BINDESTDIR)
- X chmod a=rx $(BINDESTDIR)/crefine $(BINDESTDIR)/ccr
- X cp crefine.1 $(MANDESTDIR)
- X chmod a=r $(MANDESTDIR)/crefine.1
- X @echo "C-Refine installed successfully"
- X
- X#-----packaging for delivery
- X
- XTARFILE=crefine.3.0.tar
- XZOOFILE=crefine.zoo
- XFILES1=README MANIFEST INSTALL COPYING TO_DO Makefile ccr \
- X std.h cr_decl.h cr_texts.h getargs.h patchlevel.h
- XFILES_man=crefine.man crefine.1 ccr.man ccr.1
- XFILES_cr=$(FILES_cr_1) $(FILES_cr_2)
- XFILES_cr_1=crefine.cr
- XFILES_cr_2=cr_getln.cr cr_talk.cr erato.cr getargs.cr
- XFILES_c=$(FILES_c_1) $(FILES_c_2)
- XFILES_c_1=crefine.c
- XFILES_c_2=cr_getln.c cr_talk.c erato.c getargs.c
- XALL_FILES=$(FILES1) $(FILES_man) $(FILES_cr) $(FILES_c)
- X
- Xrelease: shar $(TARFILE) $(ZOOFILE)
- X
- Xshar: $(ALL_FILES) MANIFEST
- X shar $(FILES1) >crefine.1.shar
- X shar $(FILES_man) >crefine.2.shar
- X shar $(FILES_cr_1) >crefine.3.shar
- X shar $(FILES_cr_2) >crefine.4.shar
- X shar $(FILES_c_1) >crefine.5.shar
- X shar $(FILES_c_2) >crefine.6.shar
- X
- Xtar: $(TARFILE)
- X
- Xzoo: $(ZOOFILE)
- X
- XMANIFEST: Makefile
- X /bin/ls $(ALL_FILES) >MANIFEST
- X
- Xc_files.stamp: $(FILES_c)
- X crefine -qac -s- -n0 -T8 $(FILES_cr)
- X touch c_files.stamp
- X
- X$(TARFILE): $(FILES1) $(FILES_man) $(FILES_cr) c_files.stamp
- X tar cvf $(TARFILE) $(ALL_FILES)
- X yes "y" | compress -v $(TARFILE)
- X
- X$(ZOOFILE): $(FILES1) $(FILES_man) $(FILES_cr) c_files.stamp
- X# actually, the C files should have LF -> CR LF filtering before they
- X# are packed into a zoo file.
- END_OF_FILE
- if test 3679 -ne `wc -c <'Makefile'`; then
- echo shar: \"'Makefile'\" unpacked with wrong size!
- fi
- # end of 'Makefile'
- fi
- if test -f 'ccr' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ccr'\"
- else
- echo shar: Extracting \"'ccr'\" \(1757 characters\)
- sed "s/^X//" >'ccr' <<'END_OF_FILE'
- X#!/bin/sh
- X# Date: 92/05/07 Lutz Prechelt, Karlsruhe
- X# Version: 1.0
- X#
- X# cc-like front-end to C-Refine.
- X# Sends one or several files through crefine first, then through cc.
- X# All options are passed on to cc, i.e. no options can be specified for
- X# crefine on the command line, but may be given in the environment variable
- X# CREFINEOPTIONS.
- X# If any error occurs during any crefine run, cc is not called.
- X#
- X# If you want to have an equivalent script for any other compiler or
- X# C-type language, just make a copy and adapt the values of
- X# $CC and $suffix accordingly, e.g. CC=g++; suffix=".ccr"
- X# Rename the script and change the usage message appropriately.
- X#
- X
- Xif test $# -eq 0 ; then
- X echo "Usage: ccr [cc-options] [file.c[r] | file.o]..."
- X exit 1
- Xfi
- X
- X
- XCC="cc" # compiler executable program
- XCREFINE=crefine # C-Refine executable program
- Xsuffix=".cr" # Suffix of C-Refine source program file names
- Xcrefineoptions=${CREFINEOPTIONS:-""} # options to call $CREFINE with
- X
- Xcc_params=""
- Xto_delete=""
- Xerrors=0
- X
- X#----- scan parameters and execute crefine for every .cr file
- Xwhile test $# -gt 0 ; do
- X full_name=$1
- X base_name=`basename $1 $suffix`
- X result_name=`basename $1 "r"` #what comes out of crefine
- X if test $full_name = $base_name ; then
- X cc_params="$cc_params $full_name"
- X else
- X $CREFINE $crefineoptions $full_name
- X exit=$?
- X if test $exit -gt 0 ; then
- X errors=1
- X else
- X cc_params="$cc_params $result_name"
- X to_delete="$to_delete $result_name"
- X fi
- X fi
- X shift
- Xdone
- X
- X#----- call $CC
- Xif test $errors -eq 0 ; then
- X $CC $cc_params
- X errors=$?
- Xfi
- X
- X#----- perhaps delete files generated by $CREFINE
- Xrm $to_delete # comment this out if you don't want it
- X
- X#----- exit
- Xexit $errors
- X
- END_OF_FILE
- if test 1757 -ne `wc -c <'ccr'`; then
- echo shar: \"'ccr'\" unpacked with wrong size!
- fi
- chmod +x 'ccr'
- # end of 'ccr'
- fi
- if test -f 'std.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'std.h'\"
- else
- echo shar: Extracting \"'std.h'\" \(2016 characters\)
- sed "s/^X//" >'std.h' <<'END_OF_FILE'
- X/*************************************************************************
- XModule : Header file: mothers little helpers --- bool, assert, prototype args
- XAuthor : Lutz Prechelt, Karlsruhe
- XDate : 08.05.92
- XCompiler: ANSI C, K&R C
- X**************************************************************************
- X/*
- X Copyright (C) 1988 by Lutz Prechelt, Karlsruhe
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 1, or (at your option)
- X any later version.
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X*/
- X
- X#ifndef stdh_
- X#define stdh_
- X
- X#if __STDC__
- X#define A(a) a
- X#else
- X#define A(a) ()
- X#endif
- X
- Xtypedef int bool; /* or 'enum' but some debuggers don't like that */
- X#define true 1
- X#define false 0
- X
- X#ifndef NDEBUG
- X
- X#define _assert_str "\nOOPS !! Assertion failed: file \"%s\", line %d\
- X (CR to continue)"
- Xstatic char _assert_string[] = _assert_str;
- X#define _avoid_str "\nOOPS !! %d happened in file \"%s\", line %d\
- X (CR to continue)"
- Xstatic char _avoid_string[] = _avoid_str;
- X
- X#define assert(e) \
- X (!(e) ? ( \
- X fprintf(stderr, _assert_string, __FILE__, __LINE__), \
- X fgetc (stdin) \
- X ) \
- X : 1 \
- X )
- X
- X#define avoid(e,u) \
- X ((e)!=(u) ? ( \
- X fprintf(stderr, _avoid_string, (e), __FILE__, __LINE__), \
- X fgetc (stdin) \
- X ) \
- X : 1 \
- X )
- X
- X#else
- X
- X#define assert(e) 1
- X#define avoid(e,u) 1
- X
- X#endif /* NDEBUG */
- X
- X
- X#endif
- END_OF_FILE
- if test 2016 -ne `wc -c <'std.h'`; then
- echo shar: \"'std.h'\" unpacked with wrong size!
- fi
- # end of 'std.h'
- fi
- if test -f 'cr_decl.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cr_decl.h'\"
- else
- echo shar: Extracting \"'cr_decl.h'\" \(5988 characters\)
- sed "s/^X//" >'cr_decl.h' <<'END_OF_FILE'
- X/*************************************************************************
- XProject : C-Refine Precompiler
- XModule : Declarations for global Functions, Types and Data
- XAuthor : Lutz Prechelt, Karlsruhe
- XDate : 12.06.92 Version 17
- XCompiler: ANSI C
- X**************************************************************************/
- X/*
- X Copyright (C) 1988,89,90,91 by Lutz Prechelt, Karlsruhe
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 1, or (at your option)
- X any later version.
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X*/
- X
- X/*************************************************************************
- X*********************** C - R e f i n e **********************************
- X**************************************************************************/
- X
- X#include "std.h"
- X
- X#if BSD
- X#include <strings.h>
- X#else
- X#include <string.h>
- X#endif
- X
- X/***************** globale Typen und Konstanten **************************/
- X
- X#define normal_line 1 /* Types for LINE_INFO */
- X#define empty_line 2 /* empty line */
- X#define refcall_line 3 /* refinement call */
- X#define refcallr_line 4 /* dito with "removed semicolon" */
- X#define refdecl_line 5 /* refinement declaration */
- X#define leave_line 6 /* leave construct */
- X
- X#define TAB 9 /* ASCII Tabulator has to be recognized */
- X
- X#if ms_dos
- X#define std_refinementsymbol 175 /* IBM: Double arrow to the right */
- X#else
- X#define std_refinementsymbol 96 /* ASCII: back quote */
- X#endif
- X
- X#if ms_dos
- X#define STD_MAXLINELENGTH 500
- X#define STD_MAXLINE 800 /* max. nr of lines per function */
- X#define STD_MAXREF 100 /* max. nr of refinements per function */
- X#define STD_S_SIZE 60000 /* wanted size of line buffer in bytes */
- X#else
- X#define STD_MAXLINELENGTH 500
- X#define STD_MAXLINE 2500
- X#define STD_MAXREF 200
- X#define STD_S_SIZE 150000
- X#endif
- X#define STD_MAXERRORS 20
- X#define STD_MAXWARNINGS 30
- X
- Xtypedef char *charp; /* Needed: the SUN-OS Compiler is a fool */
- X
- Xtypedef struct { int type, /* see #defines */
- X indent, /* indent+length = width of line */
- X level, /* Level at beginning of line */
- X line_no, /* line number in source file */
- X length; /* stored length in bytes */
- X charp start;
- X } LINE_INFO;
- X
- Xtypedef struct { charp name;
- X int firstentry, /* pointer into LINE_INFO array */
- X calls, /* nr of usages of this refinement */
- X semicolons; /* nr of statements in body */
- X unsigned active:1, /* we are just in it ? */
- X leave_it:1; /* there is a 'leave' for it ? */
- X } REF_INFO;
- X
- Xtypedef LINE_INFO *LINES;
- X
- Xtypedef REF_INFO *REFS;
- X
- X/************************* External Functions ****************************/
- X
- X/***** crefine *****/
- Xextern void copy_with_doubled_backslashes A((char *string, char *copy));
- X/***** cr_getln *****/
- Xextern void init_scanner A(());
- Xextern void get_line A((FILE*, LINE_INFO*, int*));
- X/***** cr_talk *****/
- Xextern void cout A((int));
- Xextern void error A((charp[], charp, int));
- Xextern void fatal_error A((charp[], charp, int));
- Xextern void warning A((charp[], charp, int, int));
- X
- X/************************ globale Daten **********************************/
- X
- X
- X/* Meldungstexte */
- Xextern charp
- X usagestring[],
- X versionstring[],
- X Tlistline[],
- X Tnear[],
- X Wempty_function[],
- X Wlong_ref[],
- X Wref_often_used[],
- X Wref_unused[],
- X Wref_empty[],
- X Wcol0[],
- X Wnesting[],
- X Wmuch_indent[],
- X Wlong_string[],
- X Wlong_char[],
- X Eopen[],
- X Ereadinput[],
- X Ewriteoutput[],
- X Emissing_r[],
- X Elevel0_ref[],
- X Elines_in_func[],
- X Ebytes_in_func[],
- X Eref_not_decl[],
- X Erecursive_ref[],
- X Eunknown_leave[],
- X Eunterminated[],
- X Eleave_unpresent[],
- X Eref_multi_decl[],
- X Ememory[],
- X Eeof_brace[],
- X Eeof_comment[],
- X Eeof_string[],
- X Eeof_char[],
- X Erefdecl_syntax[],
- X Erefdecl_nested[],
- X Emany_braces[],
- X Erefname_missing[],
- X Emany_errors[],
- X Emany_warnings[];
- X
- X#ifdef DATA_HERE
- X#define extern
- X#endif
- X/***** Control *****/
- Xextern bool option_anyway,
- X option_comment,
- X option_indent,
- X option_ibmchars,
- X option_list,
- X option_cplusplus,
- X option_verbose,
- X option_small,
- X stop_processing;
- X
- Xextern int refinementsymbol,
- X tabsize,
- X numbering_level,
- X feedback_interval,
- X msg_type,
- X warning_level,
- X maxerrors,
- X maxwarnings;
- X
- X/***** Buffer *****/
- Xextern charp b, /* Puffer fuer eine Zeile */
- X s, /* Naechste freie Position im Zeilenspeicher */
- X s_root; /* Beginn des Zeilenspeichers */
- Xextern unsigned
- X maxline,
- X maxref,
- X b_size, /* Groesse des Puffers fuer eine Zeile */
- X s_size; /* Gesamtgroesse des Zeilenspeichers */
- X
- X/***** Status *****/
- Xextern int errors, warnings, /* numbers of ...*/
- X line_no, /* current (virtual) line number */
- X commanded_line_no; /* line_no according to last line_cmd */
- X
- Xextern bool error_in_this_function;
- Xextern char name_in[200], /* filenames: input or virtual input */
- X modified_name_in[200], /* (with doubled backslashes) */
- X name_out[200]; /* output */
- X
- X#ifdef DATA_HERE
- X#undef extern
- X#endif
- END_OF_FILE
- if test 5988 -ne `wc -c <'cr_decl.h'`; then
- echo shar: \"'cr_decl.h'\" unpacked with wrong size!
- fi
- # end of 'cr_decl.h'
- fi
- if test -f 'cr_texts.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cr_texts.h'\"
- else
- echo shar: Extracting \"'cr_texts.h'\" \(10945 characters\)
- sed "s/^X//" >'cr_texts.h' <<'END_OF_FILE'
- X/*************************************************************************
- XProject : C-Refine Precompiler
- XModule : Message texts
- XAuthor : Lutz Prechelt, Karlsruhe
- XDate : 12.06.92 Version 17
- XCompiler: ANSI C
- X**************************************************************************/
- X/*
- X Copyright (C) 1988,89,90,91 by Lutz Prechelt, Karlsruhe
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 1, or (at your option)
- X any later version.
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X*/
- X
- Xcharp
- X usagestring [] = {
- X "[option | eingabedatei]...",
- X "[options | inputfile]...",
- X "[option | eingabedatei]...",
- X "[options | inputfile]..."
- X },
- X versionstring [] = {
- X "Version 3.0 Juni '92",
- X "Version 3.0 June '92",
- X "Version 3.0 Juniieh '92",
- X "Version three-dot-ooh June '92"
- X },
- X Terror [] = {
- X "Fehler",
- X "error",
- X "Faehler",
- X "erorr"
- X },
- X Twarning [] = {
- X "Warnung",
- X "warning",
- X "Warnung",
- X "warning"
- X },
- X Tfatal_error [] = {
- X "Fataler Fehler",
- X "fatal error",
- X "fatal, fatal",
- X "!@#$^&*(;*^"
- X },
- X Tlistline [] = {
- X " /* %s (Ebene %d) */",
- X " /* %s (Level %d) */",
- X " /* %s (Ebene %d) */",
- X " /* %s (Level %d) */"
- X },
- X Tnear [] = {
- X "bei",
- X "near",
- X "bei",
- X "near"
- X },
- X Wempty_function [] = {
- X "Leere Funktion (aber mit Refinements)",
- X "function is empty (but has refinements)",
- X "Viel Gelaber und nix dahinter",
- X "You are refining NOTHING"
- X },
- X Wlong_ref [] = {
- X "Sehr langes Refinement",
- X "very long refinement",
- X "Ist das Refinement nicht a bisserl arg lang ?",
- X "veeeryyy looong reeefiiineeemeeent"
- X },
- X Wref_often_used [] = {
- X "Refinement ueber 5 mal benutzt",
- X "refinement used more than 5 times",
- X "hektisches ich-bin-ueberall-Refinement",
- X "Superman-refinement (is almost everywhere at the same time)"
- X },
- X Wref_unused [] = {
- X "Refinement wird nicht benutzt",
- X "refinement unused",
- X "ein Refinement steht im Walde....",
- X "I feel sohoho looooooonely, nobody wants me!"
- X
- X },
- X Wref_empty [] = {
- X "Leeres Refinement",
- X "refinement is empty",
- X "Was will uns dieses Refinement sagen ?",
- X "the set of statements in this refinement is the empty set"
- X },
- X Wcol0 [] = {
- X "Unerwartete Zeichen in Spalte 0",
- X "unexpected character in column 0",
- X "Was tobt denn da in Spalte 0 rum ?",
- X "Hmm ? Such stuff in column 0 ? Awkward!",
- X },
- X Wnesting [] = {
- X "Sehr tiefe Blockverschachtelung",
- X "deep block-nesting",
- X "SCHEISS STIL. Verschachtele doch nicht so tief",
- X "You damn brain-dead C programmer: THOU SHALT NOT NEST DEEP !"
- X
- X },
- X Wmuch_indent [] = {
- X "Einrueckung evtl. nicht mehr darstellbar",
- X "perhaps indentation will be reduced",
- X "Das koennte ueber meinen (rechten) Horizont gehen",
- X "Uff, maybe I won't be able to indent that right-wing stuff as you want."
- X
- X },
- X Wlong_string [] = {
- X "Langer Stringdenoter hier zu Ende",
- X "end of long string denoter here",
- X "Laaaaaanger Stringdenoter hoert hier auf (na endlich)",
- X "I really thought this string denoter would never end..."
- X },
- X Wlong_char [] = {
- X "Langer Character-Denoter hier zu Ende",
- X "end of long character denoter here",
- X "Laaaaanger Character-Denoter hoert hier auf",
- X "The thing ending here is quite long for a single character..."
- X },
- X Eopen [] = {
- X "\nKann Datei \"%s\" nicht oeffnen\n",
- X "\nerror opening \"%s\"\n",
- X "\nNa wo isse denn, die Datei \"%s\" ?\n",
- X "\nAm I blind? Where is \"%s\"\n"
- X },
- X Ereadinput [] = {
- X "Kann Eingabedatei nicht lesen",
- X "can't read inputfile",
- X "akutes Eingabedateileseunvermoegen",
- X "Sudden analphabetism: can't read inputfile"
- X },
- X Ewriteoutput [] = {
- X "Kann Ausgabedatei nicht beschreiben",
- X "can't write outputfile",
- X "akute Ausgabedateischreiblaehmung",
- X "Sudden dyslexia: can't write outputfile",
- X },
- X Emissing_r [] = {
- X "Eingabedatei %s mit unerlaubtem Namen (kein 'r' am Ende) wird ignoriert\n",
- X "inputfile %s with illegal name (no trailing 'r') is ignored\n",
- X "Wie soll ich denn ein r von %s entfernen, wenn gar keins da ist ?\n",
- X "How shall I drop a trailing 'r' from '%s', if there is none ??? Haeh?\n"
- X },
- X Elevel0_ref [] = {
- X "Refinements ausserhalb einer Funktion gibts nicht",
- X "refinements illegal outside functions",
- X "Ein Refinement ? Hier draussen in der Wueste ?",
- X "Once upon a time, a little refinement stood alone in the functionless desert"
- X },
- X Elines_in_func [] = {
- X "Funktion hat zuviele Zeilen",
- X "too many lines in function",
- X "Soooo viele Zeilen in einer Funktion haelt ja kein Computer aus",
- X "Can't stand thaaat many lines in a single function"
- X },
- X Ebytes_in_func [] = {
- X "Funktion zu lang (in Bytes)",
- X "too many bytes in function",
- X "Tolle Funktion. Aber, in Bytes betrachtet, entschieden zu gross.",
- X "Can't stand thaaat many bytes in a single function"
- X },
- X Eref_not_decl [] = {
- X "Refinement nicht deklariert",
- X "undeclared refinement",
- X "Wer oder was soll das sein ?",
- X "Hmm. I swear I don't know about this refinement"
- X },
- X Erecursive_ref [] = {
- X "Rekursiver Refinementaufruf",
- X "recursive call to refinement",
- X#define _rum_und_rum "und rum und rum und rum und rum und rum und rum\
- X und rum und rum (rekursives Refinement)",
- X _rum_und_rum
- X "recursive call to recursive call to recursive call to rec.... to refinement"
- X },
- X Eunknown_leave [] = {
- X "zu verlassendes Refinement unbekannt",
- X "refinement to leave is unknown",
- X "WAS soll da verlassen werden ???",
- X "WHAT do you want to leave ???"
- X },
- X Eunterminated [] = {
- X "Schliessendes Anfuehrungszeichen fehlt",
- X "Closing double quotes missing",
- X "Huch, schon zu Ende ? Wo sind die anderen Quotes ?",
- X "(in a begging voice:) Please, give closing quotes for a poor string"
- X },
- X Eleave_unpresent [] = {
- X#define _unpresent "Wir sind nicht in diesem Refinement, also kann es\
- X auch nicht verlassen werden",
- X _unpresent
- X "you are not within this refinement, thus it's impossible to leave it",
- X#define _wenn_du "Wenn Du denkst zu sein, wo ich denke (und du\
- X schreibst), dass du zu sein denkst, denkst du falsch.",
- X _wenn_du
- X "You are not where you think you are. Thus you cannot leave from there."
- X },
- X Eref_multi_decl [] = {
- X "Refinement mehrfach deklariert",
- X "refinement declared more than once",
- X "Langweilig! Das Refinement gibts doch laengst",
- X "Bah! Old stuff! I've long before known this refinement already",
- X },
- X Ememory [] = {
- X "\n***** Speichermangel *****\n",
- X "\n***** not enough memory *****\n",
- X "\n Des Bissele Speische is mi abe zu wenisch !\n",
- X "\n***** memory claustrophobia *****\n",
- X },
- X Eeof_brace [] = {
- X "Dateiende bei offener geschweifter Klammer",
- X "EOF within block",
- X "In der U-Bahn geboren, oder was ? Mach erst mal alle Bloecke zu.",
- X "Born in an underground train, or what ? Close your blocks, please",
- X },
- X Eeof_comment [] = {
- X "Dateiende im Kommentar",
- X "EOF in comment",
- X#define _so_toll "So toll sind Deine Kommentare nun auch nicht, dass\
- X sie bis ans Dateiende gehen sollten",
- X _so_toll
- X "I do not think you should continue this comment all the rest of your life."
- X },
- X Eeof_string [] = {
- X "Dateiende im Stringdenoter",
- X "EOF in string denoter",
- X "Hoerst Du immer mitten im Satz auf ? Da ist noch ein String offen",
- X "Oops! End of file, but no closing quotes for this string ?"
- X },
- X Eeof_char [] = {
- X "Dateiende im Character-Denoter",
- X "EOF in character denoter",
- X "EOF in Character-Denoter. Demnaechst halbieren sie noch die Bits....",
- X "EOF in character denoter. It won't be long until they half the bits",
- X },
- X Erefdecl_syntax [] = {
- X "falsche Syntax fuer Refinementdeklaration",
- X "illegal syntax for refinement declaration",
- X "Es begann wie eine Refinementdeklaration. Aber dann.....",
- X "First it looked like a refinement declaration, but then..."
- X },
- X Erefdecl_nested [] = {
- X "Mehr als ein Block offen bei Refinementdeklaration",
- X "refinement declaration in nested block",
- X#define _du_bist "Du bist an dieser Stelle viel zu tief in dein Programm\
- X verstrickt, um ein Refinement zu deklarieren",
- X _du_bist
- X#define _unblock "A block in a block blocks refinement declarations.\
- X Unblock the blocked refinement declarations by closing a block first"
- X _unblock
- X },
- X Emany_braces [] = {
- X "Zuviel schliessende Blockklammern",
- X "too many closing braces",
- X#define _aufmachen "Wenn Du jetzt noch eine Blockklammer aufmachst,\
- X dann sind gar keine mehr offen",
- X _aufmachen
- X "If you open one more block now, none will be open at all..."
- X },
- X Erefname_missing [] = {
- X "Refinementsymbol ohne Refinementname",
- X "refinement symbol found without refinement name",
- X "Das Refinementsymbol fuehlt sich einsam so ganz ohne Name",
- X "This refinement symbol will fell rather alone without a refinement name"
- X },
- X Emany_errors [] = {
- X "Zu viele Fehler. Uebersetzung wird abgebrochen.",
- X "too many errors, compilation stopped",
- X "Fiel zufiele Feeler",
- X "I will now stop this horrorful compilation"
- X },
- X Emany_warnings [] = {
- X "Zu viele Warnungen. Uebersetzung wird abgebrochen",
- X "too many warnings, compilation stopped",
- X "(So viele Warnungen sind mir nicht geheuer)",
- X "Summing up, things look really a bit doubtful in this file."
- X };
- X
- X
- END_OF_FILE
- if test 10945 -ne `wc -c <'cr_texts.h'`; then
- echo shar: \"'cr_texts.h'\" unpacked with wrong size!
- fi
- # end of 'cr_texts.h'
- fi
- if test -f 'getargs.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'getargs.h'\"
- else
- echo shar: Extracting \"'getargs.h'\" \(2035 characters\)
- sed "s/^X//" >'getargs.h' <<'END_OF_FILE'
- X/*************************************************************************
- XModule : getargs -- command line option processor
- XAuthor : Lutz Prechelt, Karlsruhe
- XDate : 15.11.91 Version 3
- X**************************************************************************/
- X/*
- X Copyright (C) 1988,91 by Lutz Prechelt, Karlsruhe
- X
- X This program is free software; you can redistribute it and/or modify
- X it under the terms of the GNU General Public License as published by
- X the Free Software Foundation; either version 1, or (at your option)
- X any later version.
- X This program is distributed in the hope that it will be useful,
- X but WITHOUT ANY WARRANTY; without even the implied warranty of
- X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X GNU General Public License for more details.
- X You should have received a copy of the GNU General Public License
- X along with this program; if not, write to the Free Software
- X Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X*/
- X
- X/************************************************************************
- X*********************** g e t a r g s ***********************************
- X*************************************************************************/
- X
- X#define INTEGER 0
- X#define BOOLEAN 1
- X#define CHARACTER 2
- X#define STRING 3
- X
- Xtypedef struct {
- X char arg;
- X char type;
- X int *variable;
- X char *errmsg;
- X } ARG;
- X
- X#define ARGTABSIZE(a) (sizeof (a) / sizeof (ARG))
- X
- Xextern int getargs A((int *argc, char ***argvp, ARG argtab[], int argtabsize));
- Xextern void print_usage A((char *progname, char *usage,
- X ARG tabp[], int argtabsize));
- X
- X#if 0
- X
- XExample or template:
- X
- X/* Definition global (Initialization of Array) ! */
- X
- Xstatic ARG argtab[] = {
- X {'x', TYPE, &var_x, "function of option x" },
- X .
- X .
- X};
- X
- X/* Call : */
- X
- X if (getargs (&argc, &argv, argtab, ARGTABSIZE (argtab)) || argc != 3)
- X print_usage (argv[0], "[options] inputfile outputfile [options]",
- X argtab, ARGTABSIZE (argtab));
- X
- X#endif
- X
- END_OF_FILE
- if test 2035 -ne `wc -c <'getargs.h'`; then
- echo shar: \"'getargs.h'\" unpacked with wrong size!
- fi
- # end of 'getargs.h'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(139 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X/* This file is not really used. Please look into cr_texts.h */
- X
- X#define version "C-Refine Version 3.0"
- X#define patchlevel "Patchlevel 1"
- END_OF_FILE
- if test 139 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- echo shar: End of shell archive.
- exit 0
-
- exit 0 # Just in case...
-