entree.java : Download entree.class
interp.java Download interp.class
iaFrame.java Download iaFrame.class
intaplet.java Download intaplet.class
Console interpret :
interpret.java
Download interpret.class
The following parameters may be transmitted to the applet, containing
the source codes of the corresponding programs :
This language uses a stack to transmit arguments to the functions,
like Forth or RPL.
A running process is represented by a context (CTX program stack args ext)
where args is used by functions to store their arguments, which are
recalled with their number.
The internal representation of function is similar to De Brujn's lambda calculus
but the compiler converts a definition with named variables like in Church's
lambda calculus ^x body into the internal form (LDB body).
A program is a sequence of instructions (SEQ x1 (SEQ x2 ... (SEQ xn-1 xn)))
which can also be written ; x1; x2 ... ; xn-1 xn or
{x1 x2 ... xn-1 xn } or
[xn xn-1 ... x2 x1]
which permits to white function calls in prefixed form [f x1 ... xn]
instead of the postfixed form ;xn ... ;x1 f.
The data type are :
- Symbols : example : foobar
- Numbers (double) : example : #123.456#
- Strings : example : "Hello !"
- Records or arrays : (node x1 ... xn)
- Java objects (OBJ) : generated by some instructions, cannot be entered in source
Here are the instructions of the language :
- nop : does nothing
- (qt x) : pushes x on the stack
- eval : evaluates its argument (which is on the top of the stack)
- (set x) : assigns the argument to the variable x
- (eqthen x y) : does x if the two arguments are equal, y otherwise.
"; a ; b (eqthen x y)" or { a b (eqthen x y) } means "if a=b then x else y".
- plus : adds its 2 arguments. Example : [plus x y] or ;y ;x plus
- times : multiplies its 2 arguments
- div : top of stack divided by second element of stack
- (loop x) : repeats x
- exit : exits from a loop
- arity : number of elements of its argument
- node : node of its argument
- [subexpr x i] : i-th item of x
- [adse x a] : x added at the end of a
- copy : makes a copy of its argument
- [mkexpr node n] : array of n elements with node n
- [rplac x i y] : replaces the i-th element of x by y
- [mkstr n c] : makes a string of length n
- [concat s1 s2] : concatenation of strings
- [charat s i] : i-th character of string s
- (callcc x) : pushes the context representing the state of the
current process and runs x
- [rcallcc ctx x] : returns x to context ctx.
Example : (callcc ^ctx [rcallcc ctx foobar])
- [excallcc ctx x] : does x in context ctx
- [printout s] : prints the string s
- [rep x] : external representation of x
- [compil s] : internal representation of source s
- readin : line read from standard input
- global : gives the array of global variables
- [button "label"] : creates a button labeled "label"
- [textarea s r c] : create a text area with r rows, c columns and text s
- [settext o s] : sets the text of object o to s
- [gettext o] : gets the text of object o
- [setcolor (COLOR r g b)] : sets the current color
- [setfont font type size] : sets the current font
- [drawstring s (COORD x y)] : writes a text
- [drawline (POINT x1 y1) (POINT x2 y2)] : draws a line
- [fillrect (POINT x y) (VECTOR w h)] : fills a rectangle
- [filloval (POINT x y) (VECTOR w h)] : fills an oval
- [getparameter p] : gets parameter p from the calling HTML page
- [showdocument url] : displays document located at url
- Other AWT function are generally similar to the corresponding Java functions
but with names in lowercase. Please refer to a AWT documentation.
- [parsenbr s] : number represented by string s
- [repnbr x] : string representing number x
- sin, cos, exp, log : mathematical functions