/SimpleArithmeticLanguage

A Lexer, Parser, and Interpreter for a basic arithmetic language.

Primary LanguageC++

Simple Arithmetic Language

This repository includes a Lexer, Parser, and Interpreter for a basic arithmetic language.

Lexer, Parser, and Interpreter

The Lexer is responsible for breaking down the input code into individual tokens. These tokens are then passed onto the Parser, which analyzes the structure of the tokens and creates an Abstract Syntax Tree (AST). The Interpreter then traverses the AST and evaluates the expressions to produce the final result.

Functionality

This arithmetic language supports most common mathematical operators. Including addition, subtraction, multiplication, and division. It also includes support for parentheses to control the order of operations, as well as unary operations such as the negate operator (e.g. -1, -233.0, etc.)

Usage

To use this language, simply clone the repository and run the main project. You can then input your arithmetic expressions into the terminal and see the result outputted.

Feel free to contribute to this repository and add new features.