Skip to content

FelipeYepez/OwnVirtualMachine

Repository files navigation

Patito Language Virtual Machine

This Python project implements the 'Patito' language using PLY lex and yacc. The 'Patito' language is a custom programming language with defined rules and syntax. Patito Language Rules

Project Structure

The project consists of the following files:

  • Scanner_Parser_Patito.py: Contains the lexer and parser definitions for the 'Patito' language.
  • test_Lexer_Parser.py: Runs tests on the lexer and parser using multiple test files, both correct and incorrect, to verify the acceptance or detection of errors.
  • Virtual_Machine.py: Implements a virtual machine class that executes the intermediate code quadruples generated by the parser. It creates a memory space, variables table, and constants table.
  • run_VM.py: Runs tests on the virtual machine to execute code written in the 'Patito' language.

Getting Started

To run the project and execute 'Patito' language code, follow these steps:

  1. Ensure that Python is installed on your system.
  2. Clone this repository to your local machine.
  3. Navigate to the project directory.
  4. Open the run_VM.py file and add the name of your own code file to the files list.
  5. Save the file and close it.
  6. Open a terminal and run the following command: python run_VM.py
  7. The virtual machine will execute the code in your file, and the output will be displayed in the terminal.

Feel free to explore and modify the code to suit your needs. Enjoy using the 'Patito' language!

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages