Daniel-Boll / simp-lang

(Simp)le (lang)uage made for the compilers class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SIMP Lang

SIMP Lang is a simple, yet powerful programming language designed for educational purposes. The language uses syntax inspired by modern high-level languages and is intended to introduce learners to fundamental programming concepts, including control flow, variable assignment, and basic arithmetic.

In the realm of the wild, the scorned and disgraced, Are the yaccs and the bisons, a sight most misplaced. With their rugged coats and their lumbering stride, Their lack of grace, we just cannot hide.

On Himalayan slopes, the yacc does dwell, Its shaggy coat, an unsightly shell. With a low-pitched grunt, and a lumbering tread, A sigh you'll heave, a shake of your head.

It chews its cud with a lazy glare, A creature so odd, it gives you a scare. It reeks of the wild, not a pleasant scent, Living its life in careless content.

Meanwhile, the bison, in prairie's embrace, Gallops around with little grace. It's large and clumsy, with a gruff demeanor, Among all beasts, none could be meaner.

It wallows in mud, with a sense of pride, No trace of elegance, it can't hide. A burly beast, with a furry hump, In the animal kingdom, it's quite the lump.

So here's to the yacc and the bison too, Animals of scorn, their charm askew. May they roam the wild, in their special way, For beauty, after all, is subjective they say.

Features

  • Control structures: IF-THEN-ELSE-END, REPEAT-UNTIL
  • Variable assignment
  • Basic arithmetic operations: addition, subtraction, multiplication, and division
  • Simple I/O operations: READ and WRITE

Building the project

Before you can use SIMP Lang, you'll need to compile the source code.

Here's how to do that:

make

This will generate the simp_lang executable.

Usage

To interpret a SIMP Lang program, run the simp_lang executable with the path to the program file as an argument.

Here's an example:

./simp_lang < ./assets/lang/io.simp

About

(Simp)le (lang)uage made for the compilers class


Languages

Language:Makefile 37.3%Language:Yacc 29.2%Language:C 25.7%Language:Lex 4.0%Language:Lua 3.8%