Skip to content

oademuwagun/basic-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BASIC INTERPRETER

This project is a basic interpreter for a very simple language.

Language Rules

The syntax for this language is defined by the following grammar:

-> | |

-> : | display -> |

-> A | B | C | D | E -> | + | - | * | / -> |

-> |

-> |

-> 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

Note:

=> space character => line feed character => carriage return character

Also,

  • At most five variables can be defined in a program.
  • The symbol, ':' is the assignment operator.
  • It assigns the result of an expression to a variable.

Set Up

Pre-requisites

  • GCC

Instructions:

  • Run the following command: gcc interpreter.c -std=c99 -o interpreter ./interpreter [PROGRAM_FILE_NAME]

Sample Program

File content:

A:1 B:A+0 display A

Output: 1

More sample programs in the samples directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages