Skip to content

Releases: Marco-Valentini/JavaScript-Interpreter

v0.1.0-alpha

04 Nov 11:03
Compare
Choose a tag to compare
v0.1.0-alpha Pre-release
Pre-release

JavaScript Interpreter first pre-release.

This Interpreter is written in Python using the Lark library.
The executable file has been created using PyInstaller.

There are two versions of the executable file:

  • JavaScript-Interpreter-release-MacOS-Apple-chip.zip contains the executable file for MacOS with Apple chip and a folder with some JavaScript test scripts.
  • JavaScript-Interpreter-Windows.zip contains the executable file for Windows and a folder with some JavaScript test scripts.

Instruction for execution on Windows

To run the executable file you have to stop Windows Defender from blocking the file:

  1. download the zip file JavaScript-Interpreter-Windows.zip and extract it.
  2. Open Windows Defender from the notification area.
  3. Select Virus & threat protection.
  4. Open Virus & threat protection settings.
  5. Scroll down and select Add or remove exclusions under the Exclusions section.
  6. Click on Add an exclusion and select the "main.exe" file.
  7. Confirm selection.

The interpreter can be executed in two ways:

Interpreter in CLI mode:

  1. open the PowerShell
  2. run & 'path_to_file\main.exe' (the path_to_file can be a relative path or an absolute path)

Or just double-click on the executable file "main.exe"

Interpreter in script mode:

  1. open the PowerShell
  2. run & 'path_to_file\main.exe' --script 'path_to_file\test_n.js' (the path_to_file can be a relative path or an absolute path)

Instruction for execution on MacOS with Apple chip

The interpreter can be executed in two ways:

Interpreter in CLI mode:

  1. download the zip file JavaScript-Interpreter-release-MacOS-Apple-chip.zip.
  2. open the terminal
  3. run path_to_file/main (the path_to_file can be a relative path or an absolute path)

Or just double-click on the executable file "main"

Interpreter in script mode:

  1. open the terminal
  2. run path_to_file/main.exe -s (--script) path_to_file/file.js (the path_to_file can be a relative path or an absolute path)

For both modalities, if you specify the flag -d (--debug) the debug mode will be activated and the Parse Tree will be printed in the terminal.