aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--makefile1
-rw-r--r--pc.123
-rw-r--r--readme.txt41
3 files changed, 65 insertions, 0 deletions
diff --git a/makefile b/makefile
index 724d53f..41b6b49 100644
--- a/makefile
+++ b/makefile
@@ -57,4 +57,5 @@ tar: headers pc.y pc.l tree.c scope.c node.c pc.c sem_check.c gen_code.c
pascal_compiler/tree.h \
pascal_compiler/sem_check.c \
pascal_compiler/sem_check.h \
+ pascal_compiler/readme.txt \
pascal_compiler/makefile
diff --git a/pc.1 b/pc.1
new file mode 100644
index 0000000..9ce58aa
--- /dev/null
+++ b/pc.1
@@ -0,0 +1,23 @@
+.TH PC 1 "2019 October 17" "PC 0.1.1" "PC Manual"
+.SH NAME
+pc - Pascal Compiler
+
+.SH SYNOPSIS
+.nf
+\fBpc\fP [options]
+.fi
+
+.SH DESCRIPTION
+PC parses and (starts to) compile a subset of pascal into X86-64
+assembly. PC accepts a source file via stdin and will output to
+stdout (as long as the binary was compiled with the GENERATE_CODE
+macro). Errors are reported on stderr; If the binary was compiled
+with the macro DEBUG then parse trees and scopes are printed to stderr
+as well.
+
+.SH OPTIONS
+.PP
+PC currently accepts no options.
+
+.SH AUTHOR
+Tucker Evans
diff --git a/readme.txt b/readme.txt
new file mode 100644
index 0000000..b3f7f51
--- /dev/null
+++ b/readme.txt
@@ -0,0 +1,41 @@
+PC Readme
+=========
+Tucker Evans
+October 16, 2019
+
+PC parses and (starts to) compile a subset of pascal into X86-64
+assembly.
+
+Installation/Running
+--------------------
+PC can be installed into the local directory using `make`, this creates the
+binary 'pc'. PC accepts a source file via stdin and will output assembly to
+stdout (given it is compiled with the macro `GENERATE_CODE`). Errors are reported
+on stderr; if the binary is compiled with the `DEBUG` macro then tokens, parse
+trees, and scope information will also be printed to stderr.
+
+Status
+------
+PC has a working frontend and an incomplete backend . PC currently can tokenize,
+parse, and run semantic checks on source files. The code generation is currently
+limited to:
+- Output (write() calls)
+- Expressions
+ - Function calls
+ - Addition/Subtraction
+ - Multiplication/Division
+ - Negation
+ - Variable access (Not Arrays)
+- Statements
+ - Assignment
+ - Procedure calls
+
+Therefore the current ToDo list for code generation is:
+- Input via read() (emulating scanf c call)
+- If statements
+- While loops (statement)
+- For loops (statement)
+- Array Access
+
+Other ToDo's
+- Provide src/output files via flags.