Skip to content

Whitespace Programming Language evaluator written in Scala using the Scala Parser Combinators

License

Notifications You must be signed in to change notification settings

Andreal2000/WhitespaceEvaluator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Whitespace Evaluator

GitHub Actions Workflow Status

Whitespace Evaluator is an interpreter for the Whitespace programming language written in Scala 3. The interpreter utilizes scala parser combinators for parsing Whitespace code and is built using sbt (Simple Build Tool).

What is Whitespace?

Whitespace is an esoteric programming language where the only meaningful characters are space, tab, and newline. All other characters are ignored, making the code visually resemble whitespace. Programs in Whitespace are defined by sequences of these whitespace characters, and they are executed based on the lengths of these sequences.

Features

  • Whitespace Interpreter: Parses and interprets Whitespace code.
  • Parser Combinators: Utilizes Scala 3's parser combinators for stability and easy to understand code.
  • SBT Build: Uses SBT as the building tool for the project.
  • CI/CD Testing: CI/CD pipeline ensures continuous testing of the interpreter.

Requirements

Ensure you have the following prerequisites installed before using the Whitespace Evaluator:

Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/Andreal2000/WhitespaceEvaluator.git
  2. Navigate to the project directory:

    cd WhitespaceEvaluator
  3. Build the project using SBT:

    sbt compile

Usage

To execute a whitespace program, provide the program as input to the interpreter:

sbt "run path/to/your/whitespace-program.ws"

To execute multiple whitespace programs in succession, provide the paths to the programs as input to the interpreter:

sbt "run path/to/first/whitespace-program.ws path/to/second/whitespace-program.ws ... path/to/nth/whitespace-program.ws"

This command will execute each whitespace program in the specified order. Adjust the file paths accordingly to include all the whitespace programs you want to run.

Testing

This project includes unit tests to ensure the correctness of the interpreter. To run the tests, use the following command:

sbt test

The CI/CD pipeline also automatically runs these tests to ensure continuous integration.