Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

126 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interpreter

This project is a simple interpreter for a custom programming language. It can read and execute code from a file or run an interactive prompt for executing code line by line.

Features

  • Lexical Analyzer (Lexer) ✅
    • Lexemes
    • Tokens
  • Syntactical Analysis (Parser) ✅
    • Abstract Syntax Tree
    • Recursive Descent Parser
  • Execution of Code ️✅

Getting Started

Prerequisites

  • C++ compiler (e.g., g++)
  • CMake (optional, for building the project)
  • Build Tools like VS Build Tools for Windows

Building the Project

To build the project, you can use the following commands:

mkdir build
cd build
cmake ..
make

File Mode

To run a file, use the following command:

#Linux
./src/Interpreter

#Windows
.\src\Debug\Interpreter.exe 

And provide the path to the file when prompted.

Usage

Example Code

Here is an example of the custom language syntax:

SUGOD
    MUGNA NUMERO x, y, z = 5
    MUGNA LETRA a_1 = 'n'
    MUGNA TINUOD t = "OO"
    x=y=4
    a_1='c'
    --this is a comment
    IPAKITA: x & t & z & $ & a_1 & [#] & "last"
KATAPUSAN

Running the Example

Save the example code to a file (e.g., example.txt) and run the interpreter in file mode, providing the path to the file.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

CS322-F2 2024-2025

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages