Stalactite

From Esolang
Jump to navigation Jump to search

note - This language has come to me partially in my dream, after studying the Grammars subject at the U :-P
I have written specification at the next Grammars, stuffed it in my wallet and found it now.
I just want to know if there is any language like this or exactly like this - it would make this lang unneedful. Thanks

so:


Stalactite is an esoteric programming language based on a Push-down automaton.

Specification

Stalactite programs are written in form of instructions which must be written on separate lines. In the code there should not be any empty lines.

It is equipped with single variable - accumulator, that can hold one value in range <0,255> and stack, that can hold infinite number of values from that range.

When the program is compiled/interpreted, it starts running and reads input from the standard input until it terminates with status 0 or 1.

The language has 9 instructions. They are:

no - exit with status -1.

ok - exit with status 0.

in - read one character from the input and store in into the accumulator as its ASCII value in numerical format.

push - push the value from the accumulator to the stack

pop - pop the value from the stack to the accumulator.

chst N - change state to N, where N is natural number ([0-9]+).

nop - do nothing.

if X N I - conditional instruction. X is value in range <0,255>; N is state number as described above; I is any instruction, can be also another if.

repeat - jump to the beginning of the program.

Computational class

Stalactite has a stack, therefore it can act like deterministic Push-down automaton.