{"id":28325228,"url":"https://github.com/shravanasati/crusade","last_synced_at":"2025-07-18T16:07:15.035Z","repository":{"id":221862930,"uuid":"755234130","full_name":"shravanasati/crusade","owner":"shravanasati","description":"A friendly math interpreter.","archived":false,"fork":false,"pushed_at":"2024-07-15T11:07:17.000Z","size":19631,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T12:43:34.459Z","etag":null,"topics":["cpp","math-interpreter","shunting-yard-algorithm"],"latest_commit_sha":null,"homepage":"","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/shravanasati.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-09T17:50:19.000Z","updated_at":"2024-07-15T11:07:19.000Z","dependencies_parsed_at":"2024-02-10T17:31:37.061Z","dependency_job_id":"d7e77799-a110-4ddb-94f0-a981263d7af9","html_url":"https://github.com/shravanasati/crusade","commit_stats":null,"previous_names":["shravanasati/crusade"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shravanasati/crusade","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravanasati%2Fcrusade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravanasati%2Fcrusade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravanasati%2Fcrusade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravanasati%2Fcrusade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shravanasati","download_url":"https://codeload.github.com/shravanasati/crusade/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravanasati%2Fcrusade/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265791718,"owners_count":23829165,"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":["cpp","math-interpreter","shunting-yard-algorithm"],"created_at":"2025-05-25T20:12:20.114Z","updated_at":"2025-07-18T16:07:15.028Z","avatar_url":"https://github.com/shravanasati.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crusade\n\nA simple math interpreter written in C++ using the Shunting-yard algorithm.\n\nWatch the [demo video](https://youtu.be/KPOjq7f3VuU).\n\n### Working mechanism\n\ncrusade first tokenizes the given input and classifies them into numbers, operators, parentheses and so on. During this operation, it also validates the input and checks for invalid expressions like missing operators/operands/parentheses and so on.\n\nThe next step is to use the [shunting yard algorithm](https://en.wikipedia.org/wiki/Shunting_yard_algorithm) to convert the infix expression to the reverse polish notation (aka postfix expression, eg. `1 + 2 - 3` =\u003e `1 2 + 3 -`). I've also added a slight modification by providing unary operators with the highest precedence and right associativity. The evaluation of the postfix expression is pretty easy.\n\n\n### Build from source\n\n```sh\nmake\n```\n\n### Usage\n\nJust launch the executable file and you'd see a prompt. Enter your expressions here and press enter.\n\nYou can type `/q`, `exit` or `quit` to exit the application.\n\nYou can also toggle the debug mode using the `/debug` command. It will show your given expression in a parenthesized manner.\n\nYou can autocomplete these commands by pressing tab.\n\n\n### Further Goals\n\n- [x] Support for unary operators\n- [x] Pretty output\n- [x] Input history\n- [x] Tab Completions\n- [ ] Functions\n\n### Acknowledgements\n\n1. The awesome [linenoise](https://github.com/arangodb/linenoise-ng) library.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshravanasati%2Fcrusade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshravanasati%2Fcrusade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshravanasati%2Fcrusade/lists"}