Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sevcsik/sevcsikc
szoftlab2 hf
https://github.com/sevcsik/sevcsikc
Last synced: about 1 month ago
JSON representation
szoftlab2 hf
- Host: GitHub
- URL: https://github.com/sevcsik/sevcsikc
- Owner: sevcsik
- Created: 2010-05-10T12:24:05.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-05-11T12:33:37.000Z (over 14 years ago)
- Last Synced: 2023-03-10T23:12:19.476Z (almost 2 years ago)
- Language: C++
- Homepage:
- Size: 94.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
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.
Usagesevcsikc can get the source code from stdin, or from a file which can passed as the first commandline argument.
The sevcsik languageThe 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
endThe 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 '//'.