An interpreter for a fictional language.
This interpreter parses Krul source code files (*.txt) and executes the matched expressions. When a file ends, the last value is used as the file name of the file that is yet to be parsed. Execution of the Krul program will stop when an end expression is interpreted. For more information about all the possible expressions, have a look at the following chapter.
This interpreter was originally a university assignment, but I decided to take it a step further and overengineer it.
The lurk program is constructed with the following configuration:
interface ISettings {
useLocalPath: boolean; // Use the local source code files (src/resources).
sourcePath: string; // Local path (src/resources) or online path.
expressionPath: string; // The path where expressions are located (src/core/expressions).
currentSource: string; // The current source code file that is being executed.
}
A list of all possible expressions that Lurk supports.
- End of search - end
- Function - fun
- Return - ret
- Absolute - abs
- Add - add
- Decrement - dec
- Divide - div
- Increment - inc
- Modulo - mod
- Multiply - mul
- Negate - neg
- Subtract - sub
- Go to - gto
- Go to if equal - geq
- Go to if greater - ggt
- Go to if greater or equal - gge
- Go to if less - glt
- Go to if less or equal - gle
- Go to if not equal - gne
- Concatenation - cat
- Duplicate - dup
- Index - idx
- Length - len
- New line - enl
- Reverse - rev
- Rotate - rot
- Substring - slc
- Assign variable - =
- Digit - \d
- Label definition - :
- Label reference - >
- Variable reference - $
- Text - \