Skip to content

Instantly share code, notes, and snippets.

View NHellFire's full-sized avatar

Naomi Rennie-Waldock NHellFire

  • United Kingdom
View GitHub Profile
@NHellFire
NHellFire / boolparser.py
Created August 27, 2019 19:44 — forked from leehsueh/boolparser.py
Python Boolean Expression Parser/Evaluator
"""
Grammar:
========
Expression --> AndTerm { OR AndTerm}+
AndTerm --> Condition { AND Condition}+
Condition --> Terminal (>,<,>=,<=,==) Terminal | (Expression)
Terminal --> Number or String or Variable
Usage:
======