HALT is a language designed for string processing which is currently under development.
HALT takes instructions, each prepended with a line number.
A line beginning with a
# will make that line a comment. A line beginning with
---, denotes a second pass, taking the output as input.
HALT functions by keeping track of two main variables. HALT requires an input, it can even be a blank string. The pointer, and the instruction number.
The pointer stores the index that the program is at in the input string. When the pointer reaches
-1 or reaches past the string's end, the program is halted. If ht pointer never reaches these parameters, the program will trapped in an infinite-loop
The instruction number is the current instruction being executed. The instruction number, is specified by the number preceding the line.
|INCREMENT||None||Increments the pointer by 1|
|CONTINUE||number||Increments the pointer by n|
|SET||number||Sets pointer to the specific value|
|HALT||None|| The |
|NEXT||None||Sets pointer to the specific value|
|GOTO||number||Goes to instruction number n|
|STORE||number||Pushes character in string at pointer offset by n, to the output stack|
|TYPE||string||Pushes string to output stack|
|KEEP||number||Pushes character in string at pointer to output stack in index n|
|IF||string, number[, ELSE, number]|| If the characters, from the pointer are string. Goto line n1. Optionally, if |
|GET||int, number[, ELSE, number]||IF(char at index n1 in output stack, n2, ELSE, n3)|
1 TYPE "Hello, World!"; HALT;
1 KEEP 0; INCREMENT;
1 IF '"' 2 ELSE 7; 2 STORE 0; INCREMENT; IF "\\" 3 ELSE 4; 3 INCREMENT; GOTO 2; 4 IF '"' 5 ELSE 6; 5 HALT; 6 GOTO 2; 7 IF "'" 9 ELSE 8; 8 INCREMENT; GOTO 1; 9 STORE 0; INCREMENT; IF "\\" 10 ELSE 11; 10 INCREMENT; GOTO 9; 11 IF "'" 6 ELSE 12; 12 GOTO 9;