PAWPAW
This is a beta version (0.5) of PawPaw.
This release is a bug fix, and some new operators were added.
This is named after my
dog for no particular reason.
For some more info about this and other projects see my main site: http://schizophrenicprogrammer.info
This is a forth-like language except that it allows top-down
development.
There are several stacks. As you would expect there is a data
stack, a return stack. But there is also a control structure
stack.
Including files is done by putting the name of the definition in double quotes then calling include as in:
"xyz" include
Here is a list of the words that are implemented so far:
EXIT calls exit(0) to end the interpreter.
+L add longs
.L print long
+ int add
. int print
: define a new word
niy print that a word (string arg) is not
implemented, exit the interpret loop early.
; end a definition
Note you may now use any editor you wish, but you must define $EDITOR environment variable before running the interpreter.
"word" edit calls the Kwrite editor on the source file name
corresponding to word.
(note the name of the file is a hex string followed by .pp)
size var name define a variable.
value const name define a constant
@C fetch from a character var
!C store to a char var
@S fetch from a short var
!S store to a short var
@ integer fetch
! integer store
- int subtract
* int multiply
% int modulus
/ int divide
& integer and
| integer or
^ integer exclusive or
~ 1's complement integer
<< integer shift left
>> integer shift right
> < >= <= != == integer relationals
[] integer subscript
I->L convert int to long
L->I convert long to int
@L fetch long
!L store long
-L long subtract
*L long multiply
%L long modulus
&L long and
|L long or
^L long eor
~L one's complement long
<<L shift long left by int arg
>>L shift long right by int arg
<L >L <=L >=L !=L ==L long relationals
dup int dup
dupL long dup
drop int drop
dropL long drop
rot int rot
rotL long rot
swap int swap
swapL long swap
pick int pick
pickL long pick by int arg
[]! subscripted store
.S print string
?S read string
? read int
?L read long
CR print a newline
dir Print a list of all words that have been defined using the
editor (xxxx.pp) where xxxx is a hex string.
/* ... */ comment
"word" compile compile a definition file
"xxx" "yyy" add_dep add a dependency for yyy to word xxx
file.
control structure
if (expr) then true-part else false-part fi
or
if (expr) then true-part fi
while expr do body od
until expr do body od
switch (expr) is case (expr) :: (code) esac ... default (code) tluafed
hctiws
I'd like to keep a list of users. I promise not to spam you, but just
to email periodically with major new feature announcements. To
register: Click here.
Download:
Current version is 0.5.
http://schizophrenicprogrammer.info/pawpaw0.6.tar.gz