{"id":18282570,"url":"https://github.com/rafael-santiago/expr","last_synced_at":"2025-04-09T05:25:32.832Z","repository":{"id":80005636,"uuid":"104480973","full_name":"rafael-santiago/expr","owner":"rafael-santiago","description":"A very simple code showing the technique of how to solve expressions using RPN.","archived":false,"fork":false,"pushed_at":"2017-10-04T23:41:54.000Z","size":53,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-14T23:48:04.512Z","etag":null,"topics":["automata-theory","automatas","calculator","compiler-design","compiler-principles","compsci","computer-science","interpreters","pushdown-automaton","rpn","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafael-santiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2017-09-22T14:02:23.000Z","updated_at":"2023-04-04T11:51:45.000Z","dependencies_parsed_at":"2023-05-26T04:15:35.675Z","dependency_job_id":null,"html_url":"https://github.com/rafael-santiago/expr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fexpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fexpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fexpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafael-santiago%2Fexpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafael-santiago","download_url":"https://codeload.github.com/rafael-santiago/expr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247983033,"owners_count":21028233,"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":["automata-theory","automatas","calculator","compiler-design","compiler-principles","compsci","computer-science","interpreters","pushdown-automaton","rpn","tutorial-code"],"created_at":"2024-11-05T13:05:36.831Z","updated_at":"2025-04-09T05:25:32.813Z","avatar_url":"https://github.com/rafael-santiago.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expr\n\nThis repository is a simple implementation of a calculator that uses Reverse polish notation (RPN)\nin order to solve input expressions in standard infix notation.\n\nThe four basic math operations are supported and it works only with integers. If you are\nlooking for some practical stuff to start on compiler/interpreter design, maybe this\ncode can help you.\n\n## How can I clone this repo?\n\nThe repository has some sub-modules, the easiest way of cloning it is as follows:\n\n```\nyou@Somewhere:~/src# git clone https://github.com/rafael-santiago/expr expr --recursive\n```\n\nDone!\n\n## How can I build it?\n\nUntil now I successfully built  it on ``Linux``, ``FreeBSD``, ``NetBSD``, ``OpenBSD``, ``MINIX``,\n``Solaris`` and also ``Windows``. This project uses ``ANSI C``, so virtually you will be able to\neasily build this code in any decent platform.\n\nFor my own projects I always use my own [build system](https://github.com/rafael-santiago/hefesto).\nAfter following the steps to make ``hefesto`` work on your system all you should do is:\n\n```\nyou@Somewhere:~/src# cd expr/src\nyou@Somewhere:~/src/expr/src# hefesto\n```\n\nAfter calling ``hefesto`` the codes will be compiled and some tests will run. The binary will be\nwithin the directory ``../bin``.\n\nThe build was written to support ``GCC`` and also ``Clang``. The build will detect the available\ncompiler and use it, ``GCC`` is used by default. If you want to force the usage of ``Clang``\ncall ``hefesto`` with the following build option:\n\n```\nyou@Somewhere:~/src/expr/src# hefesto --use-toolset=clang-c-app\n```\n\nAnyway, if you are not interested in running tests and all this stuff, you can build the software\nby hand. This is a pretty minimalist project and you can easily compile it in just one simple single\ncommand line:\n\n```\nyou@Somewhere:~/src/expr/src# cc memory.c stack.c expr.c rpn.c main.c -oexpr\n```\n\n## How can I use it?\n\nBeing within the sub-directory ``src``, supposing that you have built the program with my\nbuild system, just call ``../bin/expr``.\n\nA prompt will be shown and all you should do is to type your infix expression and so\nconfirm it hit ENTER to get the result back.\n\nTo exit the program type CTRL+c and also confirm it with an ENTER.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafael-santiago%2Fexpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafael-santiago%2Fexpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafael-santiago%2Fexpr/lists"}