Skip to content

mustafataibah/OCaml-Interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

OCaml Interpreter

This project includes a stack-based interpreter for a simple OCaml-like language. The interpreter was developed using the OCaml programming language and includes a variety of mathematical, logical operations, and control structures.

Features

Basic mathematical operations: Addition, Subtraction, Multiplication, Division. Logical operations: AND, OR, NOT, Equal, Less than or equal to. Control structures: Local, Global, Lookup, BeginEnd, IfElse. Functions: Function definition and function call.

Interpreter Details

The language used in this interpreter includes the following components:

Constants: Integer, Boolean, Unit, String, Name Commands: Push, Pop, Add, Sub, Mul, Div, Trace, And, Or, Not, Equal, Lte, Local, Global, Lookup, BeginEnd, IfElse, Fun, Call Environments: local and global environments are supported

Improvements

This interpreter is fully functional, but there's always room for improvement. Here are a few things to consider:

Expand the range of recognized commands and expressions. Better error handling: provide more specific error messages to guide the user. Performance optimization: optimize the current commands and functions. More complex functions: allow for the declaration of more complex functions. Additional control structures: include more control structures, such as For and While loops.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages