~kameliya/piret

c6673b0e8ca8a7962f3320b23d445b6ec32ecd22 — Arlen Christian Mart Cuss 8 years ago 1f7f067
docs
3 files changed, 12 insertions(+), 4 deletions(-)

M .gitignore
M README.md
M strap
M .gitignore => .gitignore +0 -3
@@ 1,6 1,3 @@
a.out
out
out.c
boot1
boot2
boot1.c

M README.md => README.md +3 -1
@@ 12,4 12,6 @@

## current state:

    ./strap
Piret now successfully bootstraps (with a fair bit of C help).

To try it yourself, just run `./strap`.  Have a look to see how it works.

M strap => strap +9 -0
@@ 1,9 1,18 @@
#!/bin/bash

# run the ruby compiler to make boot1
ruby piretc.rb piretc.pi > boot1.c
gcc -std=gnu99 boot1.c -g -o boot1 || (echo 'failed boot1'; exit 1) || exit 1

# run the piret compiler (boot1) to make boot2
./boot1 piretc.pi > boot2.c
gcc -std=gnu99 boot2.c -g -o boot2 || (echo 'failed boot2'; exit 1) || exit 1

# run the piret complier (boot2) to make boot3
./boot2 piretc.pi > boot3.c
gcc -std=gnu99 boot3.c -g -o boot3 || (echo 'failed boot3'; exit 1) || exit 1

# boot2 and boot3 are both from piret, so they should be identical.
if [ x"`diff boot2.c boot3.c`" != x ]; then
	echo "boot2.c and boot3.c differ (failure)"
else