Parses and evaluates boolean expressions. Usage:

BoolCompiler compiler = new BoolCompiler();
BoolProgram program = compiler.compile("a == b && a != c");

HashMap<String, Boolean> context = new HashMap<String, Boolean>();
context.put("a", true);
context.put("b", true);
context.put("c", false);
boolean result = program.eval(context);
System.out.println("result = "+result);

Features

  • Parses C-like boolean expressions
  • Expressions can contain variables
  • Variables can be assigned and changed
  • Evaluates expressions at a decent pace
  • Can print the AST for debugging purposes
  • Simple example of a recursive descent parser

Project Activity

See All Activity >

Follow JavaBoolCompiler

JavaBoolCompiler Web Site

Other Useful Business Software
Build AI Apps with Gemini 3 on Vertex AI Icon
Build AI Apps with Gemini 3 on Vertex AI

Access Google’s most capable multimodal models. Train, test, and deploy AI with 200+ foundation models on one platform.

Vertex AI gives developers access to Gemini 3—Google’s most advanced reasoning and coding model—plus 200+ foundation models including Claude, Llama, and Gemma. Build generative AI apps with Vertex AI Studio, customize with fine-tuning, and deploy to production with enterprise-grade MLOps. New customers get $300 in free credits.
Try Vertex AI Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of JavaBoolCompiler!

Additional Project Details

Registered

2020-09-27