Skip to content
nicogabriel1708Public

About

A Java library and CLI tool for evaluating arithmetic expressions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

59 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ARIEE — Arithmetic Expression Evaluator

A Java library and CLI tool for evaluating arithmetic expressions.


ARIEE Core

The core library provides the ArithmeticExpression and ArithmeticEquation classes. ArithmeticExpression evaluates arithmetic expressions, supporting basic operations as well as parentheses for grouping. ArithmeticEquation validates whether two expressions are equal.


Installation

Maven Dependency

To use the library in your project, add the following Maven dependency to your pom.xml file:

<dependency>
    <groupId>com.nicogabriel</groupId>
    <artifactId>ariee-core</artifactId>
    <version>1.0.0</version>
</dependency>

JAR File

Alternatively, you can download the JAR file from the releases page or the Maven Central Repository.


Examples

Parsing Text

import com.nicogabriel.ariee.core.ArithmeticExpression;
import com.nicogabriel.ariee.core.ArithmeticEquation;

void main() {
    ArithmeticExpression expression = ArithmeticExpression.parse("5 + 3 * 2");
    double result = expression.evaluate();

    ArithmeticEquation equation = ArithmeticEquation.parse("2 + 2 = 3 + 1");
    boolean valid = equation.isValid();
}

Parsing Files

import com.nicogabriel.ariee.core.ArithmeticExpression;
import com.nicogabriel.ariee.core.ArithmeticEquation;

void main() {
    ArithmeticExpression expression = ArithmeticExpression.parseFile(Path.of("expression.txt"));
    double result = expression.evaluate();

    ArithmeticEquation equation = ArithmeticEquation.parseFile(Path.of("equation.txt"));
    boolean valid = equation.isValid();
}

ARIEE CLI

The command line application serves as a convenience tool for evaluating arithmetic expressions directly from the terminal.


Installation

Windows

winget install ariee

Linux

sudo apt install ariee

macOS

brew install ariee

Usage

Start the interactive REPL:

ariee

Evaluate a single expression (use quotes!):

ariee "5 + 3 * 2"

Read and evaluate an expression from a file:

ariee -f filename.txt

About

A Java library and CLI tool for evaluating arithmetic expressions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages