Skip to content

thomaswatters/pl-0-Compiler-VM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

// TEAM

// Names: Darian Smalley
//        Thomas Watters


To compile program:

    1.  Navigate to root folder of project (the folder containing this readme)
    2.  Run make (type make into console press enter)
    3.  This will generate a program called "compile" within this directory

Required files:
	input.txt	- source code file

To Run program:

	The program assumes a default input file (file containing pl/0) to be in
	the current working directory and titled input.txt. You may pass another file
	name via command line parameters

-l Print the list of lexemes/tokens (scanner output) to the screen

-a Print the generated assembly code (parser/codegen output) to the screen

-v Print virtual machine execution trace (virtual machine output) to the screen

Example commands:

./compile –l –a –v Print all types of output to the console

./compile –v Print only the VM execution trace to the console

./compile Print nothing to the console except for “in” and “out” instructions.

./compile test.txt	Compiles the file called test.txt rather then default


The program will perform all operations on every run:

	1. Perform Lexical Analysis / Generate Lexeme List
	2. Parse lexeme list and generate intermediate code
	3. Run the program within the vm
		The vm will output and read from console as necessary
	4. The program generates the following files
		cleaninput.txt	-	source code without comments
		lexemelist.txt	-	list token represenation
		lexemetable.txt	-	detailed view of lexeme tokens
		mcode.txt	-	assembly code generated by parser
		stacktrace.txt	-	the stacktrace of the program as it ran through the vm
		output.txt	-	file containing original source code, machine code, and a stacktrace

Directory structure
	src/	- folder containing source code
	extras/		-a pdf view of the screenshots showing errors, and an example output.txt file for grading
	makefile	-makefile used for compilation
	input.txt	-example source code file
	readme.txt	-this readme file


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published