Skip to content
/ pxpr Public

PXPR (short for Parse Expression) is a command line calculator tool that allows you to type in an expression just as you would in most C-style programming languages. PXPR supports arithmetic operations and C-style boolean operations.

License

Notifications You must be signed in to change notification settings

brayner05/pxpr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💻 🧮 = PXPR - Expression Parser = 🧮 💻

PXPR (Parse eXPRession) is a fast arithmetic and boolean expression parser written in Rust, supporting arithmetic operations such as addition, subtraction, multiplication, division, modulo, expressions with nested parentheses, as well as C-style boolean expressions such as the logical not, and, or operators and the logical implication operator. PXPR can be evaluate expressions directly from the command line or via the PXPR REPL.

Sections

What is the goal of PXPR?

The goal of PXPR is to provide an easy-to-use, but feature rich command line calculator. Rather than opening up a calculator application and manually clicking buttons or starting up an IDE or text-editor, writing some code, compiling that code, and running it all to get the value of a basic expression, PXPR can evaluate the expression directly from the command line.

How to use PXPR

Compute an expression via the CLI

pxpr "3 - (2 + 5) + 2"

Which outputs:

    = -2

Compute an expression via the REPL

pxpr

Which will initialize the REPL:

expr > 3 - (2 + 5) + 2
        = -2

Compute a boolean expression

pxpr "!false || true"

or it's equivalent:

pxpr "false => true"

both of which output:

    = true

Installation

To install PXPR, clone this repository:

git clone https://github.com/brayner05/pxpr.git

Installing PXPR on

Linux

Once the PXPR repository has been cloned, switch to the repository directory and run the installation script:

cd pxpr
chmod +x ./install.sh
./install.sh

If no errors occurred, then PXPR is now installed on your machine.

Windows

Currently PXPR does not have an installation script for Windows, but can still be installed quite easily:

cd pxpr
cargo build --release
cargo install

About

PXPR (short for Parse Expression) is a command line calculator tool that allows you to type in an expression just as you would in most C-style programming languages. PXPR supports arithmetic operations and C-style boolean operations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published