Build Status

Version: 1.2.0


Link: Release 1.2.0


BashClass is a programming language supporting Object Oriented Programming, and compiles to BASH 4.4. Class members written in BashClass are converted to an associative array with unique indices in the generated BASH script.

BashClass uses EasyCC-C++ library which provides the lexical and syntax analysis. The lexical and syntax analysis configuration files, located under the resources directory, serve as input to EasyCC-C++ to parse the user files and validate it against a grammar determining the language syntax.

Build project


  • Clone repository
  • Build image: sudo docker build -t bashclass:latest .
  • Run container: docker run --name bashclass-tutorial -it bashclass:latest


  • Clone repository
  • Clone submodules: git submodule update --init --recursive
  • Run cmake:
cmake . \
  • Run make (developer mode):
make bashcdev
  • Run make (production mode):
make generate_files # Embed JSON configurations into C++ files
# Run the `cmake` command again to include the generated files
# cmake . ...
make bashc


Developer mode

./bin/bashcdev \
    -s resources/src/lexical_graph.json \
    -c resources/src/lexical_config.json \
    -e resources/src/lexical_errors.json \
    -g resources/src/grammar.json \
    -E resources/src/syntax_errors.json \
    -o /tmp/ \
    -v \
    path/to/file1 path/to/file2 ...

Production mode

./bin/bashc -o \
    path/to/file1 path/to/file2 ... 

In production mode the list of files to compile can be stored in a file (e.g. files.list) and then passed to the application prefixed by an @ symbol. (e.g. ./bin/bashc @files.list -o /tmp/


  • The application was tested only on Arch and Ubuntu
  • Not much input files has been written to test the application
  • Project was created for fun and is not guaranteed to work everywhere, unless users prove the opposite ;)


  • Feel free to contribute