lenzpaul / Qapla

A programming language written in C.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Qapla'

A first stab at creating a programming language interpreter, using lexical analyzer LEX, YACC parser and C.


Foo demo gif

Program description:

This is an interactive interpreter for the fooish language.

Check out a quick demo here

INSTALLATION

  • run makefile, located in src/
  • execute program by running ./src/fooChecker
  • the grammar is detailed in src/y.output (auto generated)
  • To exit the interpreter, type: exit

[optional] I've added the following files for different levels of debugging and informative messages.

  • fooCheckerd
  • fooChecker_debug
  • fooChecker_debug_full

FEATURES

  • Working features

    • comments
    • assignment statements
    • variables
    • I/O : typechecked. reads, readi, readr, print
    • string expressions
      • including syntax, literals, escape sequences for " and , comparison operators, concatenation
    • arithmetic expressions : + - * / , correct precedence and associativity, typechecking
    • boolean expressions
      • syntax, literals T and F, the comparison operators, compound operators (AND OR NOT), typechecking
    • selection
      • syntax, the use of if, else-if, else, the boolean test expressions, local block scope
    • function handling
      • syntax, function definitions and calls, local variables/scope, proper handling of parameters and return values
  • Non working features [ To be developed ]

    • string expressions
      • substring operators
    • arithmetic expressions
      • MOD, and ^
    • iteration
      • while loops are not implemented

About

A programming language written in C.


Languages

Language:Yacc 54.9%Language:C 34.9%Language:Lex 7.7%Language:Makefile 1.9%Language:Shell 0.6%