Skip to content

Instantly share code, notes, and snippets.

View gtmsingh's full-sized avatar

Gautam Singh gtmsingh

View GitHub Profile
@gtmsingh
gtmsingh / boolparser.py
Last active May 16, 2020 05:17 — forked from leehsueh/boolparser.py
Python Boolean Expression Parser/Evaluator
"""
Grammer:
Expression --> AndTerm { OR AndTerm}+
AndTerm --> Condition { AND Condition}+
Condition --> Terminal (>,<,>=,<=,==) Terminal | (Expression)
Terminal --> Number or String or Variable
Usage:
from boolparser import *