shreyasseshadri / A-new-Language

A very basic language interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A-new-Language

This is a language created using parse tree,lexical generators Bison and Lex.

This language supports basic features like expression evaluation , basic arithmetic oprations , if condition , while condition

The CFG used in this language is :

    <expr> := [ <op> <expr> <expr> ] | 
                 <symbol> | <value>
    <symbol> := [a-zA-Z]+
    <value> := [0-9]+
    <op> := ‘+’ | ‘*’ | ‘==‘ | ‘<‘
    <prog> := [ = <symbol> <expr> ] |
              [ ; <prog> <prog> ] |
              [ if <expr> <prog> <prog> ] |
              [ while <expr> <prog> ] |
              [ return <expr> ]

Running the program

To run this program use:

 ./run

Permission may need to be given:

chmod +x run.sh

To clear all the object files and the other generated files use:

 ./clear

Reference

Lex and Yacc Tutorial

About

A very basic language interpreter

License:MIT License


Languages

Language:Yacc 57.2%Language:C 32.8%Language:Lex 10.0%