document bf.isbpl

This commit is contained in:
Daniella 2022-05-23 10:33:48 +02:00
parent 6102f9ec09
commit 1ccae742d6

View file

@ -1,4 +1,6 @@
"Brainfuck->ISBPL transpiler" #
native acopy native acopy
"#stream.isbpl" include "#stream.isbpl" include
"#multi.isbpl" include "#multi.isbpl" include
@ -15,6 +17,7 @@ func main {
def s args 0 aget STREAM.create.file.in stream =s def s args 0 aget STREAM.create.file.in stream =s
s makeCode =s s makeCode =s
"Write code to ISBPL file" #
filename ".isbpl" strconcat STREAM.create.file.out stream filename ".isbpl" strconcat STREAM.create.file.out stream
! s swap stream.write ! s swap stream.write
STREAM.close stream STREAM.close stream
@ -31,8 +34,11 @@ func read {
[ s STREAM.read stream dup -1 eq if { ] pop "" 2 stop } _char ] _string [ s STREAM.read stream dup -1 eq if { ] pop "" 2 stop } _char ] _string
} }
"Read BF and convert to ISBPL" #
func makeCode { func makeCode {
with s ; with s ;
"Initialization code as stringblock" #
def code string! { def code string! {
"#stream.isbpl" include "#stream.isbpl" include
def stdin "/dev/stdin" STREAM.create.file.in stream =stdin def stdin "/dev/stdin" STREAM.create.file.in stream =stdin
@ -52,6 +58,8 @@ func makeCode {
code code
} }
"Convert a BF char to ISBPL" #
func parse { func parse {
with c ; with c ;