Skip to content

Instantly share code, notes, and snippets.

@myzsyweb
myzsyweb / basic.sh
Created June 20, 2012 13:08
a simple interpreter for BASIC written in AWK
#!/usr/bin/gawk -f
# a simple interpreter for GWBASIC(subset) written in AWK
# following 'The AWK Programming Language' Chapter 6
# @date June 20,2012
# @link basic.sh https://gist.github.com/2959816
# @link test.sh https://gist.github.com/2959877
# TODO:
# gosub/return...ok
# if/else/elseif/endif...ok
# while/wend...ok
a simple interpreter for BASIC written in AWK
see url https://gist.github.com/2959816
########## GWBASIC ###############
#!./basic2.sh
print "start"
s = 0:i = 0
loop:
s = s + i:i = i + 1
print "s" , s