Skip to main content

Interpreter of Boolean Logic Language

Project description

# Bamboolean interpreter

[![Build Status](](

Supported from Python >= 3.4

Implementation of Bamboolean - Boolean Logic Language

Bamboolean is a simple language that consumes array of pre-defined variables, and
returns boolean value if constraints on these variables are met.

[Exemplary expressions in the language](./bamboolean/tests/

## Features

- Case in-sensitive variable names and keywords
- Comparison operators (listed below)
- Logic AND / OR
- Expressions with parentheses
- Types: Float, Int, String, Bool, Variable
- [Truth value testing same as in Python](
- Implicit cast of variables to boolean when no relational operator is specified

##### Operators associativity

All operators are left-associative

##### Operators precedence (the higher number the higher priority)

1. OR
2. AND
3. == | != | < | <= | > | >=

## Testing

Run tests:


## EBNF Grammar

compound_expr : expr
| empty

expr : simple_expr (OR simple_expr)*

simple_expr : term (AND term)*

term : statement

statement : value
| constraint

constraint : variable (relational_operator value)?

relational_operator : ( EQ | NE | LT | LTE | GT | GTE )

value : INTEGER

variable : ID

empty :


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
bamboolean-0.2.0-py3-none-any.whl (12.8 kB) Copy SHA256 hash SHA256 Wheel py3
bamboolean-0.2.0.tar.gz (9.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page