Program uses shunting yard algorithm to interpret C Preprocessor (#if, #elif) boolean expressions Examples c_eval function implements Parser(with Precedence of all operators such as defined ! | >> ...) defined operator must take only an identifier Below Expression will output a syntax error expr = "!defined(456)" c_eval(expr) expr = "~ defined(TEST)" c_eval(expr) expr = "F > 12.3" c_eval(expr) expr = "!defined(AAA) && F > H +" c_eval(expr) If there is an identifier in this expression, it means it has not defined and treated as 0 in eval loop For Example below, B will be treated as 0 expr = "!defined(B) && 123 > 1257" c_eval(expr) # False Also FOO and F Treated as 0 expr = "!defined(FOO) && 123678 > 1257 || F + 12" c_eval(expr) # True