Skip to content
This repository was archived by the owner on Jun 27, 2022. It is now read-only.

Latest commit

 

History

History
104 lines (72 loc) · 2.51 KB

File metadata and controls

104 lines (72 loc) · 2.51 KB

Development

Installing Dependencies

To install the dev-dependencies, simply use ./requirements/dev.txt with pip, like the following:

pip install -r requirements/dev.txt

Or for a virtual environment:

pipenv install -r requirements/dev.txt

Building

Build inno-setup installer for Windows

Download inno-setup here

Build inside this folder and use the inno-setup.iss file. The generated installer will be placed inside ./Output

Generating the Parser and Lexer

Required for Lexer and Parser Development which include changes on the .g4 grammar files

Downloading Antlr4

To download Antlr4 go here

Quickstart Installation Guide on the Main Website: here

Generating the Python files

Generating the Parser and Lexer is made up of two parts:

  • Using Antlr4 to compile the .g4 file to actual source code
  • Implementing the Runtime (The user code that is shipped with the binaries)

Note: Generating the Parser and Lexer means that depending on the changes the implementation code needs to be changed.

To generate in the command-line use:

  • For the Pre-Processor:

    • Python (Required for the Compiler):
      antlr4 -o ./paralang_base/preprocessor/parser -Dlanguage=Python3 ./ParaPreProcessor.g4
    • Java:
      antlr4 -o ./paralang_base/preprocessor/parser -Dlanguage=Java ./ParaPreProcessor.g4
  • For the Core Language:

    • Python (Required for the Compiler):
      antlr4 -o ./paralang_base/compiler/parser/python -Dlanguage=Python3 ./Para.g4
    • Java:
      antlr4 -o ./paralang_base/compiler/parser/python -Dlanguage=Java ./Para.g4

Afterwards if needed correctly move the folder using:

mv ./path/to/generated/output/* ./src/compiler/core/<insert-destination>/

and delete the remaining folder:

rm -rf ./path/to/generated/output

Notes:

  • Make sure the alias for antlr4 / antlr exists! Else the command will not work
  • Comments are only partly ignored in Para.g4, due the intended removal in the Pre-Processor. Errors can occur!

Generating the docs

To generate the docs for a one-time usage, use the following:

./docs/make.bat html

or for an active http server, which will automatically reload changes, use this:

sphinx-autobuild ./docs/source ./docs/build/html