Skip to content

Instantly share code, notes, and snippets.

Avatar

Gautam Singh gtmsingh

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