This is a simple C program named compiler.c that implements a recursive descent parser for evaluating arithmetic expressions.
The compiler.c file contains a basic implementation of a recursive descent parser for arithmetic expressions. It supports addition, subtraction, multiplication, and division operations, as well as parentheses for grouping expressions. The program reads an arithmetic expression entered by the user, evaluates it, and prints the result.
To use the compiler, follow these steps:
-
Clone the repository:
git clone https://github.com/Ismat-Samadov/compiler.git -
Navigate to the directory:
cd compiler -
Compile the
compiler.cfile:gcc compiler.c -o compiler -
Run the compiled program:
./compiler -
Enter an arithmetic expression when prompted.
-
The program will evaluate the expression and print the result.
Here's an example of using the compiler:
$ ./compiler
Enter an arithmetic expression: 5+3
Result: 8
Contributions to this project are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.