Skip to content

bieber/pm0

Repository files navigation

PM/0 Project by Robert Bieber and Paul Gatterdam

 Compilation
-------------

The included makefile defaults to the target "all", which will compile all
sections of the project.  Simply running "make" in the project directory will
accomplish this. Specific instructions for building and running the individual
targets are provided below, updated as targets are added

 Virtual Machine
-----------------

Compiling the make target "vm" with the command "make vm" will build the PM/0 
virtual machine, with executable name "vm".  The virtual machine takes as
command line input the filename for the machine code file to run.  It can also
take an optional quiet mode flag, "-q", before the file name.  If the -q flag
is set, the VM will not print any diagnostic information, showing only output
generated by the user's program.  For instance, to run the sample input in 
quiet mode, use the command

   ./vm -q input

while in the project directory.


 Scanner
---------

Compiling the make target "scanner" with the command "make scanner" will build
the NA'VI/PL scanner, with executable name "scanner".  The scanner takes as 
command line input the filename for the NA'VI/PL file to scan.  It can also 
take an optional quiet mode flag, "-q", before the file name.  If the -q flag 
is set, the scanner will not print any diagnostic information, showing only 
output generated by the user's program.  For instance, to run the sample input 
with full output, use the command

  ./scanner input

while in the project directory.  The scanner will only accept the ASCII 
apostrophe character in input files, and will generate an error if it scans 
a unicode right single quotation character.  If any errors are encountered 
during scanning, the scanner will print error messages indicating the lexeme 
that failed and the line and character in the input file where it was found.  
The scanner will attempt to continue scanning the input file after recovering 
from an error, so erroneous files will generate output, but not necessarily 
what is expected.

 Parser
--------

Compiling the make target "parser" with the command "make parser" will build the
NA'VI/PL parser, with executable name "parser". The parser takes as command line
input either nothing, with the output from the scanner piped into the parser or
a single input file containing the quiet output of the scanner.  It can also 
take an optional quiet mode flag, "-q", before the file name. If the -q flag is
set, the parser will not print any diagnostic information, showing only the
output generated by the user's program. For instance, to run the sample input
with full output, use the command

  ./parser input
	or
  ./scanner -q input | ./parser

while in the project directory.

 Compiler
----------

The Compiler is a bash script that runs all the necessary programs to take a 
NA'VI/PL program and check its syntax and grammar. The script takes a single
command line input with the filename to be passed through the scanner and
parser. The compiler will exit if the scanner produces an error. A sample
input with the full output would use the command

  ./compiler input

while in the project directory. The output will be a token representation of
the input file, a symbolic representation of the input file, and the source file
along with the generated code. The output will then also be passed through the 
virtual machine and executed and the executed virtual machine code will be
displayed.

About

Semester project for Systems Software

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published