Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sevcsik/sevcsikc

szoftlab2 hf
https://github.com/sevcsik/sevcsikc

Last synced: about 1 month ago
JSON representation

szoftlab2 hf

Awesome Lists containing this project

README

        

sevcsikc interpreter

Disclaimer

sevcsikc is an interpreter for the sevcsik language, which is an extremely minimalistic, assembly-like language. It was created as a homework for the 'softlab2' course of Budapest University of Technology and Economics, and it's not intented for use in production environments. This product doesn't give you any guarantees, it can burn down your house or scare your cat, you have been warned.
Usage

sevcsikc can get the source code from stdin, or from a file which can passed as the first commandline argument.
The sevcsik language

The code looks like this:

org 0
load 0 0 // 0 Counter = *0
load 5 1 // 1 Value to compare
load 1 2 // 2 Value to increment with
print 0 "Counter: %lf" // 3 Print counter value
add 0 2 0 // 4 Increment counter
subtract 0 1 3 // 5 Save comprasion result
nzgoto 3 3 // 6 If comprasion is false, continue
print 0 "Done" // 7 Goodbye
end

The first instruction must be org n, that tells the interpreter where to place the first instruction. This comes handy if you want to store variables in the memory, and don't want to screw up your instructions.

Instructions are the same as class names derived from Instruction class, but lowercase. Arguments follow the instructions, everything is seperated with whitespaces. There are no syntax error handling, to teach programmers to concentrate.

Comments after arguments can be anything, but it looks more professional if they start with '//'. Comments at the beginning of the line must start with '//'.