Code Monkey home page Code Monkey logo

compilers's Introduction

                             Program Disk 
                             to accompany
                     WRITING COMPILERS & INTERPRETERS
                          An Applied Approach

                             by Ronald Mak

               (c) 1991 by Ronald Mak.  All rights reserved.
                   Published by John Wiley & Sons, Inc.


INSTALLATION
============

The supplied disk contains the source code files for all the C 
programs found in this book along with several test files and 
Pascal programs.  The files have been compressed so that they 
could be delivered to you on a single 5 1/4" double density 
(360K) diskette.  The diskette is usable on any IBM PC or compat-
ible computer with a hard drive and a double- or high-density 
floppy drive.  The programs can be compiled using Microsoft Quick 
C and Quick Assembler, or with Borland's Turbo C (or C++) and 
Turbo Assembler.

It will be necessary for you to uncompress the files before you 
can begin using them.  Follow the instructions below:

To be able to uncompress the files, you  will need a hard disk 
with at least 2.2 megabytes of free space.  Please check to make 
sure that you have enough room on your hard disk before continu-
ing.

Start your system from the hard disk.  Place the Writing Compil-
ers and Interpreters Program Disk in drive A.  Since all the 
files should be put into their own subdirectory, we will have to 
first create a subdirectory.  You can make up your own name for 
it, but we'll use \SOURCE in this example.

		MD \SOURCE			[Press Enter]

That will create the subdirectory for you.  Once it's created, 
make it the current directory by entering this command:

		CD \SOURCE			[Press Enter]

Next copy all the files from the Program Disk into that subdirec-
tory be entering:

		COPY A:*.* C:\SOURCE	        [Press Enter]

Before you can actually start using the programs you will have to 
uncompress the files by running the "unpack" batch file by typ-
ing:

		UNPACK				[Press Enter]
                           
The batch file UNPACK.BAT will automatically do the following:

*  Create the subdirectories chap1, chap2, ... chap11, chap13, 
   and chap14.  (Chapters 12 and 15 of the book do not contain 
   any programs.)

*  Extract from sources.zip the source files for each of the 
   chapter subdirectories.

*  Copy the duplicate source files from one chapter subdirectory 
   to another.

Once the files have been uncompressed, you will be able to start 
using them.  Please refer to the READ.ME file found on the disk 
for programming instructions and last minute fixes.


HOW TO BUILD THE PROGRAMS
=========================

All of the programs can be built using Microsoft's Quick C and 
Quick Assembler, or with Borland's Turbo C (or C++) and Turbo 
Assembler.  You can also use Microsoft's Optimizing C compiler 
and Macro Assembler.

The programs were all written in "classic" C, so you must turn 
off any ANSI options.  All of the programs should be built with 
the "small" memory model, except for run3 (chapter 11) and compile2
(chapter 14) which should be built with the "medium" memory model.

The assembly language object programs generated by compile1 
(chapter 13) and compile2 should be built with the "small" memory 
model.  Each must be linked with paslib.obj, created by compiling 
paslib.c with the "small" memory model.

With the Microsoft products, you need to create a "program list" 
for each program.  Similarly, the Turbo products need a "project 
file" for each program.  The following table will help.  Please 
note that programs in chapters 6, 8, 9, and 11 require that you 
set macro flags.  Failing to set the flags will result in syntax 
errors during compilation or a program that executes incorrectly.  
In chapter 6, recompile all the source files to build syntax2.


The table also shows the test files and Pascal programs that you 
can use to check out the programs after you've built them.

==== ============ ====================================== ===========
CHAP PROGRAM      SOURCE FILES		                 TEST FILES
==== ============ ====================================== ===========
 1    list         list.c                                 newton.pas
---- ------------ -------------------------------------- -----------
 2    token1       token1.c                               token1.in
      token2       token2.c scanner.c error.c             comments.in
                                                          strings.in
                                                          specials.in
                                                          numbers.in
                                                          errors.in
                                                          hello.pas
      compact      compact.c scanner.c error.c            hello.pas
---- ------------ ------------------------------------- ------------
 3    xref         xref.c symtab.c scanner.c error.c      hello.pas
      crunch       crunch.c symtab.c scanner.c error.c    hello.pas
      uncrunch     uncrunch.c
---- ------------ -------------------------------------- -----------
 4    postfix      postfix.c scanner.c error.c            postfix.in
      calc         calc.c symtab.c scanner.c error.c      calc.in
---- ------------ -------------------------------------- -----------
 5    syntax1      syntax1.c stmt.c expr.c symtab.c       syntax1.in
		   scanner.c error.c
---- ------------ -------------------------------------- -----------
 6    analyze      analyze.c decl.c symtab.c scanner.c    analyze.in
		   error.c

      NOTE:  The "analyze" macro flag must be defined in header file
             parser.h for this program.  Either add the line "#define
             analyze" at the beginning of file parser.h, or use the
             compiler command line option /Danalyze.

      syntax2      syntax2.c decl.c stmt.c expr.c         syntax2.in
                   symtab.c scanner.c error.c

      NOTE:  The "analyze" macro flag must NOT be defined in header
             file parser.h for this program.
---- ------------- -------------------------------------- ----------
 7    syntax3      syntax3.c routine.c standard.c decl.c  scopeerr.pas
		   stmt.c expr.c symtab.c scanner.c       rtnerr.pas
		   error.c
---- ------------- -------------------------------------- -----------
 8    pprint       pprint.c ppdecl.c ppstmt.c routine.c   translat.pas
                   standard.c decl.c stmt.c expr.c
		   symtab.c scanner.c error.c

      NOTE:  The "analyze" macro flag must be defined in header file
             parser.h for this program.  Either add the line "#define
             analyze" at the beginning of file parser.h, or use the
             compiler command line option /Danalyze.
---- -------------- ------------------------------------- ----------
 9    run1         run1.c routine.c standard.c decl.c     assign.pas
		   stmt.c expr.c symtab.c scanner.c       arrparms.pas
		   executil.c execstmt.c execexpr.c       nested.pas
		   error.c				  range1.pas

      NOTE:  The "trace" macro flag must be defined in header file
             exec.h for this program.  Either add the line "#define
             trace" at the beginning of file exec.h, or use the
             compiler command line option /Dtrace.
---- -------------- -------------------------------------- ---------
 10   run2         run2.c routine.c standard.c decl.c     sieve.pas
                   stmt.c expr.c symtab.c scanner.c       newton.pas
		   executil.c execstd.c execstmt.c        translat.pas
		   execexpr.c error.c                     wolf.pas
                                                          xref.pas

      NOTE:  Files translat.in and wolf.in are input data files for
             translat.pas and wolf.pas, respectively.  Each should
             be read as the standard input file.  For example:  
             run2 wolf.pas < wolf.in
         
             File xref.pas is its own input file:
                   run2 xref.pas < xref.pas
---- -------------- -------------------------------------- ---------
 11   run3         run3.c routine.c standard.c decl.c     newton.pas
		   stmt.c expr.c symtab.c scanner.c
		   executil.c execstd.c execstmt.c
		   execexpr.c debug.c error.c

      NOTE:  The "trace" macro flag must be defined in header file
             exec.h for this program.  Either add the line "#define
             trace" at the beginning of file exec.h, or use the
	     compiler command line option /Dtrace.
---- -------------- -------------------------------------- ---------
 13   compile1     compile1.c routine.c standard.c decl.c simple.pas
		   stmt.c expr.c symtab.c scanner.c       asgn.pas
		   emitasm.c emitcode.c error.c           scopewr.pas
							  arrprmwr.pas
							  varprmwr.pas

      NOTE:  Compile file paslib.c to create the runtime library.  Then
             the assembly file generated from each test program should
             be assembled and then linked with the runtime library.

             The assembly files must be assembled in a way that preserves
             the case of the external names, such as with the /MX option.
---- --------------- -------------------------------------- --------
 14   compile2     compile2.c routine.c standard.c decl.c sieve.pas
		   stmt.c expr.c symtab.c scanner.c       newton.pas
		   emitasm.c emitcode.c error.c           translat.pas
							  wolf.pas
							  xref.pas

      NOTE:  The assembly files must be assembled in a way that preserves
             the case of the external names, such as with the /MX option.

             Files translat.in and wolf.in are input data files for
             translat.pas and wolf.pas, respectively.  File xref.pas is
             its own input file:   xref < xref.pas
========================================================================


BUG FIXES
=========

The source files on this diskette contain fixes to the following bugs:

(1)  The standard ord function cannot take a character argument.

     Fixed:  2/9/91
     Files:  standard.c in chapters 7-11 (same file) and 14

(2)  The interpreted FOR statement fails if the control variable is
     of a subrange of integer type.

     Fixed:  2/9/91
     Files:  execstmt.c in chapters 10 and 11 (same file)



DISCLAIMER
==========

The contents of this diskette is provided to you on an "as is" 
basis for instructional purposes only.  Therefore, there are no 
warranties, expressed or implied, with regards to the contents of 
the accompanying diskette.  The author and the publisher of these 
programs and Apropos Logic shall not be liable in any event for 
incidental or consequential damages in connection with, or aris-
ing out of, the furnishing, performance, or use of these pro-
grams.

If you have any technical questions, or discover a problem with a 
program, please write to: 

                	Apropos Logic
			4899 Bela Drive
			San Jose, CA  95129

and enclose any relevant listings.  In case of a defective disk,
please contact Wiley publishers.


To print the README file, simply type:

		PRINT README.TXT                [Press Enter]

at your DOS prompt.
�

compilers's People

Watchers

James Cloos avatar Gary Dohmeier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.