{"id":18303097,"url":"https://github.com/b1z0n/notationconverter","last_synced_at":"2025-07-06T15:08:12.574Z","repository":{"id":122787891,"uuid":"207089533","full_name":"B1Z0N/NotationConverter","owner":"B1Z0N","description":"Class for converting from one arithmetical notation to another. Written with TDD.","archived":false,"fork":false,"pushed_at":"2019-09-12T14:23:34.000Z","size":1549,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T10:14:26.951Z","etag":null,"topics":["arithmetic-expression","infix-notation","postfix-notation","prefix-notation","tdd"],"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/B1Z0N.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":"2019-09-08T09:26:32.000Z","updated_at":"2019-09-12T14:23:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"64ffed2e-745c-4413-9ac1-e93f3bc7f003","html_url":"https://github.com/B1Z0N/NotationConverter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/B1Z0N/NotationConverter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B1Z0N%2FNotationConverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B1Z0N%2FNotationConverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B1Z0N%2FNotationConverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B1Z0N%2FNotationConverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/B1Z0N","download_url":"https://codeload.github.com/B1Z0N/NotationConverter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B1Z0N%2FNotationConverter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263922512,"owners_count":23530338,"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":["arithmetic-expression","infix-notation","postfix-notation","prefix-notation","tdd"],"created_at":"2024-11-05T15:24:08.431Z","updated_at":"2025-07-06T15:08:12.550Z","avatar_url":"https://github.com/B1Z0N.png","language":"C++","readme":"# Notation Converter\n\nClass for converting from one arithmetical notation to another. \n\n# Notation types\n\n- [Prefix](https://en.wikipedia.org/wiki/Polish_notation)\n- [Infix](https://en.wikipedia.org/wiki/Infix_notation)\n- [Postifx](https://en.wikipedia.org/wiki/Reverse_Polish_notation)\n\n# Installation and testing\n\nIt is one header class, so just include appropriate file named `notation_converter.h` in `inculde/` directory.\n\nTo run the tests(assuming you are in the root repository directory):\n```bash\nmkdir build  # or mybuild\ncd build\ncmake ..\nmake\n./run_tests\n```\n\n# Using in your project\n\nFrom previous step you can find static library generated in `build` directory. File named `libnotaconv.a` is a static library. So you should link this to your cpp-program and also add an include path which is `include` folder in the project's root. \n\n## Manually\n\n```c++\n// use.cpp\n\n#include \"notation_converter.h\"\n\n#include \u003ciostream\u003e\n\nusing namespace notaconv;\n\nint main() {\n    NotationConverter nc {\"+ 1 1\", ArithmeticNotation::PREFIX};\n    std::cout \u003c\u003c nc.convert(ArithmeticNotation::INFIX) \u003c\u003c '\\n';\n}\n```\n\nAnd compile-link-run it like this(gcc example):\n\n```bash\n\u003e g++ use.cpp -I\"${PROJECT_DIR}/inculde\" ${PROJECT_DIR}/build/libnotaconv.a -o use\n\u003e ./use\n\u003e 1 + 1\n```\n\nWhere `${PROJECT_DIR}` is a path to this project's directory.\n\n## CMake\n\nAdd this lines to your `CMakeLists.txt`:\n\n```cmake\ninclude_directories(${NOTACONV_PROJECT_DIR}/include)\nlink_directories(${NOTACONV_PROJECT_DIR}/build)\n...\n...\n...\ntarget_link_libraries(executable notaconv)\n```\n\nWhere `${NOTACONV_PROJECT_DIR}` is a path to this project's directory, and `executable` is your target specified in `add_executable(executable ${SOURCES})` function call.\n\n# How to\n\nFor user there are to main classes in this project:\n1. `NotationConverter`\n1. `ArithmeticNotation`\n\nSecond one is just `enum class` denoting one of [types of notation](#notation-types). And the second is a converter. \nUse it like this:\n```c++\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n\n#include \"notation_converter.h\"\n\nusing namespace notaconv;\n\nstd::string expr {\"1 + 2 * ( 3 - 2 )\"}; // necessary to have a space between two items\nNotationConverter nc {expr, ArithemticNotation::INFIX};\n\nstd::cout \u003c\u003c nc.convert(ArithemticNotation::PREFIX) \u003c\u003c '\\n';    // \"+ 1 * 2 - 3 2\"\nstd::cout \u003c\u003c nc.convert(ArithemticNotation::INFIX) \u003c\u003c '\\n';     // \"1 + 2 * ( 3 - 2 )\"\nstd::cout \u003c\u003c nc.convert(ArithemticNotation::POSTFIX) \u003c\u003c '\\n';   // \"1 2 3 2 - * +\"\n\n```\n\n# Note\n\nThis repository is a pet-pet project to learn TDD.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb1z0n%2Fnotationconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb1z0n%2Fnotationconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb1z0n%2Fnotationconverter/lists"}