How To Install bnfc on Debian 10

Learn how to install bnfc on Debian 10 with this tutorial. bnfc is Compiler front-end generator based on Labelled BNF

Introduction

In this tutorial we learn how to install bnfc on Debian 10.

What is bnfc

bnfc is:

The BNF Converter is a compiler construction tool that generates a compiler front-end and a readable syntax description document from a Labelled BNF grammar. It was originally written to generate Haskell, but it can now also be used for generating Java, C++, and C.

To process Haskell output, you need the Glorious Glasgow Haskell Compiler (virtual package ghc), the Happy parser generator (package happy) and the Alex scanner generator (package alex).

To process Java output, you need a Java compiler and virtual machine, the CUP parser generator (package cup) and the JLex scanner generator (package jlex).

To process C or C++ output, you need a C or C++ compiler, respectively, the Bison parser generator (package bison) and the flex scanner generator (package flex).

To process the generated documents, you need LaTeX (packages tetex-base, tetex-bin, etc.).

There are three methods to install bnfc on Debian 10. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install bnfc Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install bnfc using apt-get by running the following command:

sudo apt-get -y install bnfc

Install bnfc Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install bnfc using apt by running the following command:

sudo apt -y install bnfc

Install bnfc Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install bnfc using aptitude by running the following command:

sudo aptitude -y install bnfc

How To Uninstall bnfc on Debian 10

To uninstall only the bnfc package we can use the following command:

sudo apt-get remove bnfc

Uninstall bnfc And Its Dependencies

To uninstall bnfc and its dependencies that are no longer needed by Debian 10, we can use the command below:

sudo apt-get -y autoremove bnfc

Remove bnfc Configurations and Data

To remove bnfc configuration and data from Debian 10 we can use the following command:

sudo apt-get -y purge bnfc

Remove bnfc configuration, data, and all of its dependencies

We can use the following command to remove bnfc configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge bnfc

Dependencies

bnfc have the following dependencies:

References

Summary

In this tutorial we learn how to install bnfc package on Debian 10 using different package management tools: apt, apt-get and aptitude.