All Projects → OlegSmelov → omgrofl-interpreter

OlegSmelov / omgrofl-interpreter

Licence: MIT and 2 other licenses found Licenses found MIT LICENSE Unknown LICENSE-hamcrest.txt EPL-1.0 LICENSE-junit.txt
Omgrofl interpreter

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to omgrofl-interpreter

esoo
Like the Programming Languages Zoo but with esoteric languages.
Stars: ✭ 18 (+12.5%)
Mutual labels:  esoteric, esoteric-interpreter
motivational-numerology
Simple web page to calculate and interpret the numerology numbers derived from your name and birth date (in English, French, and Turkish).
Stars: ✭ 23 (+43.75%)
Mutual labels:  esoteric
malbolge-lisp
A lightweight (350MB) Lisp interpreter in Malbolge Unshackled, often dubbed the hardest turing complete programming language.
Stars: ✭ 348 (+2075%)
Mutual labels:  esoteric
nuna
(Our virtual) nuna language details
Stars: ✭ 55 (+243.75%)
Mutual labels:  esoteric
Creepycodecollection
A Nonsense Collection of Disgusting Codes
Stars: ✭ 2,206 (+13687.5%)
Mutual labels:  esoteric
Headache
Programming Language that compiles to 8 Bit Brainfuck
Stars: ✭ 59 (+268.75%)
Mutual labels:  esoteric
rathilang
A small gift for someone who did big things (Python Package)
Stars: ✭ 14 (-12.5%)
Mutual labels:  esoteric

Omgrofl-interpteter

Build Status

Omgrofl interpreter written in Java

About

This project aims to create a fully-functional interpreter of an esoteric programming language called Omgrofl. More information on the language itself can be found here: http://esolangs.org/wiki/Omgrofl

Suggestions or patches are more than welcome.

How it works

The interpreter parses the input source code and transforms it into an abstract syntax tree. It then traverses the tree and runs each instruction.

Getting started

To compile, run these commands on the command line:

git clone https://github.com/OlegSmelov/omgrofl-interpreter.git
cd omgrofl-interpreter
ant

Run an example:

cd dist
java -jar Omgrofl.jar ../examples/alphabet.omgrofl

Currently supported statements

  • Assignment (variable iz variable/value; variable to /dev/null)
  • Char output (rofl variable)
  • Char input (stfw variable)
  • Infinite loop (rtfm ... brb)
  • For loop (4 variable iz variable/value 2 variable/value ... brb)
  • Loop break (tldr)
  • Comments (w00t)
  • Sleep (afk variable/value)
  • Program exit (stfu)
  • Incrementing / decrementing (lmao/roflmao variable)
  • Conditions (wtf variable/value iz (nope) liek/uber variable/value ... brb)
  • Stack/Queue (n00b/l33t/haxor variable)

Implementation details

  • Unassigned variables are treated as nonexistent. If you try to use a variable without assigning a value to it first, an exception will be thrown.
  • An exception will also be thrown if you try to take a value off the stack when the stack is empty.
  • On EOF, 255 is returned as the value.
  • Indentation and whitespace don't matter. The only thing that matters is that every statement is written on a separate line.
  • If there is more than one statement on a line, an exception will be thrown. This doesn't follow the language specification, but I believe this is a good decision, because a) honest mistakes will be found faster, and b) people new to the language will know if they've written anything wrong.

License

MIT (see LICENSE)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].