{"id":13779325,"url":"https://github.com/cucumber-attic/bool","last_synced_at":"2025-05-11T12:33:13.220Z","repository":{"id":6688556,"uuid":"7933669","full_name":"cucumber-attic/bool","owner":"cucumber-attic","description":"Cross-platform boolean expression parser and interpreter","archived":true,"fork":false,"pushed_at":"2015-12-19T17:13:07.000Z","size":1855,"stargazers_count":35,"open_issues_count":6,"forks_count":14,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-05T23:49:19.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cucumber-attic.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-31T09:20:36.000Z","updated_at":"2024-11-28T16:31:16.000Z","dependencies_parsed_at":"2022-08-20T17:20:37.781Z","dependency_job_id":null,"html_url":"https://github.com/cucumber-attic/bool","commit_stats":null,"previous_names":["cucumber/bool"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber-attic%2Fbool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber-attic%2Fbool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber-attic%2Fbool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cucumber-attic%2Fbool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cucumber-attic","download_url":"https://codeload.github.com/cucumber-attic/bool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253567529,"owners_count":21928840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:01:03.914Z","updated_at":"2025-05-11T12:33:12.828Z","avatar_url":"https://github.com/cucumber-attic.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# bool\n\n[![Build Status](https://travis-ci.org/cucumber/bool.png)](https://travis-ci.org/cucumber/bool)\n\nThis is a cross-platform library for parsing boolean arithmetic expressions like `a \u0026\u0026 b \u0026\u0026 (!c || !d)` and evaluating them by assigning values to the variables.\n\nBoolean expressions are parsed into an [abstract syntax tree](http://en.wikipedia.org/wiki/Abstract_syntax_tree) (AST).\n\nThis is done with a generated lexer and parser. The generators used are:\n\n* Java: [Ragel](http://www.complang.org/ragel/) and [Bison](http://www.gnu.org/software/bison/)\n* Ruby: (C extension): [Ragel](http://www.complang.org/ragel/) and [Bison](http://www.gnu.org/software/bison/)\n* JRuby: [Ragel](http://www.complang.org/ragel/) and [Bison](http://www.gnu.org/software/bison/)\n* JavaScript: [jison-lex](https://github.com/zaach/jison-lex) and [Jison](http://zaach.github.io/jison/)\n\nThis choice of generators makes it easy to port the implementation to other languages since they are ported to most programming languages. \n\nEvaluation of the boolean expressions is done by traversing the AST with a visitor. (This is obviously overkill for something as \nsimple as boolean expressions, keep reading to understand why).\n\nSupported platforms are Ruby, JRuby, Java and JavaScript. More platforms like Python, PHP and .NET may be added later.\n\nThe Ruby gem uses a C extension (for speed) and the JRuby gem uses a Java extension (also for speed). Support for e.g. Python could be added \neasily by using the same C code as the Ruby gem. Java programs (or any other JVM-based program such as Scala or Clojure) can also use the Java library as-is.\n\n## Why?\n\nThe purpose of this library is twofold.\n\nFirst, it serves as a simple example of how to build a custom interpreted language with a fast lexer/parser that builds a \nvisitor-traversable AST, and that runs on many different platforms. People who want to build a bigger cross-platform language could \nleverage the structure and build files in this project. For example, the [Gherkin](https://github.com/cucumber/gherkin3) 3.0 project will use this \nproject as a template.\n\nSecond, this project will be used by Cucumber to evaluate _tag expressions_ in a more elegant way.\n\n## Building\n\nSee `CONTRIBUTING.md`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucumber-attic%2Fbool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcucumber-attic%2Fbool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcucumber-attic%2Fbool/lists"}