-
Notifications
You must be signed in to change notification settings - Fork 0
Syntax
Pilly is a limited stack-based postfix programming language
Programs are parsed line by line by repeatedly evaluating the next 'word' (string of characters separated by whitespace).
if the word is a number, it is added to the stack. Otherwise it is checked against the list of known words and if found the corresponding function is executed
Variables are declared by preceding their name with the word "VAR" or "VARIABLE" Constants are declared by preceding their name with the word "CONST" or "CONSTANT" and pop the first item off the stack as their value
Strings are contained by one of the following:
- start: "\"", end: "\""
- start: "STRING", end: "END"
- start: "STR", end: "END"
Comments are contained by one of the following:
- start: "/", end: "/"
- start: "//", end: "\n"
- start: "\\", end: "\n"
- start: "(". end: ")"
Lists are contained by: start: "[", end: "]"
Functions are contained by one of the following:
- start: "DEF", end: ";"
- start: ":", end: ";"
- start: "DEF", end: "END"
- start: ":", end: "END"
NOTE: the above starts are words like any other and must be surrounded by whitespace, same for the ends for lists and functions