{"id":19694154,"url":"https://github.com/innofang/calc","last_synced_at":"2026-04-11T21:03:23.699Z","repository":{"id":129983438,"uuid":"51766855","full_name":"InnoFang/calc","owner":"InnoFang","description":"🎫A simple interpreter \u0026 command-line calculator written in Kotlin","archived":false,"fork":false,"pushed_at":"2018-05-13T01:40:23.000Z","size":149,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T12:38:58.709Z","etag":null,"topics":["calculator","command-line","interpreter"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InnoFang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2016-02-15T16:00:38.000Z","updated_at":"2018-05-13T01:40:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"8870448a-1a02-4c33-8328-162137407889","html_url":"https://github.com/InnoFang/calc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/InnoFang/calc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnoFang%2Fcalc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnoFang%2Fcalc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnoFang%2Fcalc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnoFang%2Fcalc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InnoFang","download_url":"https://codeload.github.com/InnoFang/calc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InnoFang%2Fcalc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31695165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T20:18:30.949Z","status":"ssl_error","status_checked_at":"2026-04-11T20:18:29.982Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["calculator","command-line","interpreter"],"created_at":"2024-11-11T19:20:40.934Z","updated_at":"2026-04-11T21:03:23.681Z","avatar_url":"https://github.com/InnoFang.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# calc\n\nA simple command-line calculator written in Kotlin\n\n**PS** this is a practice project of an interpreter, to implement a command-line calculator, I design a series of grammar to do so instead of using _reverse Polish notation (RPN)_\n\n# Grammar\n\n```\nexpr   : factor (( PLUS | MINUS) factor) *\nterm   : factor (( MUL  | DIV  ) factor) *\nfactor : (PLUS | MINUS) factor | INTEGER | LPAREN expr RPAREN\n```\n\n# Usage\n\nopen your terminal, and type\n\n```\n\u003e $ git clone git@github.com:InnoFang/calc.git\n\u003e $ cd calc\n\u003e $ gradle build\n```\n\nThen, there is a file named `calc-1.0.0.jar` in the `build/libs`\n\n```\n\u003e $ cd build/libs\n\u003e $ java -jar calc-1.0.0.jar\n```\n\n# Example\n\nyou can use like this\n\n```\ncalc\u003e 12\n12\ncalc\u003e 34 * 56\n1904\ncalc\u003e 1234 + 87123 - 19283\n69074\ncalc\u003e 22 * 12 - 172 + 56\n148\ncalc\u003e 345 / 5 * ( 234 - 92 ) + 66\n9864\ncalc\u003e 1 ------------ 2\n3\ncalc\u003e 2 ++++-----+++ 3\n-1\n```\n\n# Reference\n\n + [lsbasi](https://github.com/rspivak/lsbasi)\n\nthis project gave me inspiration and idea, as well as help me a lot, thanks\n\n# [License](https://github.com/InnoFang/calc/blob/master/LICENSE)\n\n           Copyright 2018 InnoFang\n\n           Licensed under the Apache License, Version 2.0 (the \"License\");\n           you may not use this file except in compliance with the License.\n           You may obtain a copy of the License at\n\n               http://www.apache.org/licenses/LICENSE-2.0\n\n           Unless required by applicable law or agreed to in writing, software\n           distributed under the License is distributed on an \"AS IS\" BASIS,\n           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n           See the License for the specific language governing permissions and\n           limitations under the License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnofang%2Fcalc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnofang%2Fcalc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnofang%2Fcalc/lists"}