{"id":23021013,"url":"https://github.com/b-sullender/expression-parser","last_synced_at":"2025-06-29T18:32:59.429Z","repository":{"id":241420033,"uuid":"694880797","full_name":"b-sullender/expression-parser","owner":"b-sullender","description":"An expression parser in C that can easily be modified for more operations or turned into a calculator or programming language.","archived":false,"fork":false,"pushed_at":"2024-06-08T15:16:52.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T18:52:27.926Z","etag":null,"topics":["c-parser","calculator","expression-evaluator","expression-parser","programming-language"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/b-sullender.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-09-21T22:25:16.000Z","updated_at":"2024-07-23T13:07:53.000Z","dependencies_parsed_at":"2024-05-28T08:19:39.737Z","dependency_job_id":"53d59265-c259-40c5-bffa-0a1bd2659bbb","html_url":"https://github.com/b-sullender/expression-parser","commit_stats":null,"previous_names":["b-sullender/expression-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/b-sullender/expression-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Fexpression-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Fexpression-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Fexpression-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Fexpression-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-sullender","download_url":"https://codeload.github.com/b-sullender/expression-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-sullender%2Fexpression-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262647590,"owners_count":23342676,"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":["c-parser","calculator","expression-evaluator","expression-parser","programming-language"],"created_at":"2024-12-15T12:16:09.723Z","updated_at":"2025-06-29T18:32:59.376Z","avatar_url":"https://github.com/b-sullender.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expression-Parser\n\nExpression Parser is a versatile C-based parser designed for efficiency and speed, making it suitable for a wide range of applications. It supports various operations, both arithmetic and bitwise, and can be extended to include additional features.\n\n## Supported Operations\n\nThe Expression Parser currently supports the following operations:\n\n### Arithmetic Operations\n\n- Addition `+`\n- Subtraction `-`\n- Multiplication `*`\n- Division `/`\n- Modulo `%`\n\n### Bitwise Operations\n\n- Left Shift `\u003c\u003c`\n- Right Shift `\u003e\u003e`\n- Bitwise AND `\u0026`\n- Bitwise OR `|`\n- Bitwise XOR `^`\n\nYou can use parentheses to control the order of operations and ensure precise calculations.\n\nLICENSE TERMS\n=============\n```\nThis software is provided 'as-is', without any express or implied\nwarranty.  In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n(1) If any part of the source code or algorithm is used, it is requested that\n    appropriate attribution is given to the authors by providing a link to\n    the original repository or a reference to the authors name.\n(2) Permission for use of this software is granted only if the user accepts\n    full responsibility for any undesirable consequences; the authors accept\n    NO LIABILITY for damages of any kind.\n\nBy using this software, you acknowledge that you have read and understood\nthese terms and agree to abide by them.\n```\n\nTo compile and run the expression parser, follow these steps:\n\n1. Clone the repository to your local machine:\n   ```shell\n   git clone https://github.com/b-sullender/expression-parser.git\n   ```\n\n2. Navigate to the project directory:\n   ```shell\n   cd expression-parser\n   ```\n\n3. Compile the application using GCC:\n   ```shell\n   gcc main.c -o exp\n   ```\n\n4. Run the program:\n   ```shell\n   ./exp\n   ```\n\n## Extending the Parser\n\nOne of the key strengths of the Expression Parser is its extensibility. You can easily add support for more operations by following these guidelines:\n\n1. **Define the Operation**: Add the name of the new operation to the `TokenType` enum. This enum defines the types of tokens that the parser can recognize.\n\n2. **Token Handling**: In the `getNextToken` function, add an `else if` handler for your new token type and set the appropriate precedence. This step ensures that the parser recognizes the new token correctly.\n\n3. **Operation Implementation**: In the `parseExpression` function, add an `else if` handler for your new token type. Here, you'll implement the actual operation associated with the new token type.\n\nFeel free to experiment and expand the capabilities of the Expression Parser to meet your specific needs or contribute to its development.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-sullender%2Fexpression-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-sullender%2Fexpression-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-sullender%2Fexpression-parser/lists"}