{"id":21036255,"url":"https://github.com/vikas2171/if_else_parser","last_synced_at":"2026-05-20T06:38:23.129Z","repository":{"id":255210651,"uuid":"847418938","full_name":"Vikas2171/If_else_parser","owner":"Vikas2171","description":"If_else_parser is a C++ tool that validates the syntax of if-else conditional statements. It checks for correctness, generates parse trees, and displays the grammar rules used. This project supports nested conditions and provides an educational resource for understanding if-else constructs in C++.","archived":false,"fork":false,"pushed_at":"2024-08-28T16:18:16.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T16:17:37.602Z","etag":null,"topics":["cpp","if-else-statements","parse-tree","parser","principles-of-programming-languages"],"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/Vikas2171.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":"2024-08-25T19:08:06.000Z","updated_at":"2024-08-28T19:07:11.000Z","dependencies_parsed_at":"2024-08-28T17:04:38.045Z","dependency_job_id":null,"html_url":"https://github.com/Vikas2171/If_else_parser","commit_stats":null,"previous_names":["vikas2171/if_else_parser"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vikas2171%2FIf_else_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vikas2171%2FIf_else_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vikas2171%2FIf_else_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vikas2171%2FIf_else_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vikas2171","download_url":"https://codeload.github.com/Vikas2171/If_else_parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243476535,"owners_count":20296905,"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","if-else-statements","parse-tree","parser","principles-of-programming-languages"],"created_at":"2024-11-19T13:19:16.363Z","updated_at":"2025-12-30T08:13:23.459Z","avatar_url":"https://github.com/Vikas2171.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# If_else_parser\n\n## Introduction\n**If_else_parser** is a C++ project designed to validate whether an input string confirms to the syntax of an `if-else` conditional statement in C++. This tool is useful for programmers, students, and educators who want to ensure the correctness of `if-else` constructs in their code.\n\nThe project performs the following tasks:\n\n1. __Syntax Validation:__ It takes an input string and checks if it is a valid syntax for an `if-else` conditional statement in C++.\n2. __Parse Tree Generation:__ If the syntax is valid, the tool generates and prints all levels of the parse tree, with each level displayed on a separate line.\n3. __Grammar Rules:__ It prints the context-free grammar rules used in the validation process, presented as an adjacency list.\n## Team Members\nThis project is a collaborative effort by the following team members:\n\n* Sohit Dhawan  [[Linkdin](https://www.linkedin.com/in/sohit-dhawan-78676a255/)]\n* Shubham Gupta  [[Linkdin](https://www.linkedin.com/in/shubham-gupta-79876a255/)]\n* Vikas Prajapati [[Linkdin](https://www.linkedin.com/in/vikas-prajapati-577bab252/)]\n\n## Features\n* __Validation of if-else Syntax:__ The tool strictly adheres to the C++ syntax rules for `if-else` statements.\n* __Parse Tree Visualization:__ It displays all the levels of the parse tree, making it easier to understand how the input is parsed.\n* __Grammar Rule Display:__ Lists all the context-free grammar rules applied during parsing, represented as an adjacency list for better comprehension.\n* __Support for Nested if-else Conditions:__ The tool also supports the validation of nested if-else conditions.\n\n## Assumptions\n\nIn developing this project, we have made the following assumptions:\n\n* Only a single relational expression should be given as the condition of the if block.\n```cpp\n(a \u003e= b) \n```\n* The if and else blocks should be empty ({}).\n```cpp\nif(condition){}else{}\n```\n* Variable names should be a single character only.\n```cp\na, b, c,....\n```\n* The syntax is considered correct only if there is a corresponding else block for every if block.\n```cp\n\"if(condition){}\"\n- This is considered as invalid syntax by our parser.\n\"if(condition){}else{}\"\n- This is valid.\n```\n## Getting Started\n\n### Prerequisites\nTo run this project, you need:\n\n* A C++ compiler (e.g., GCC, Clang)\n* Basic knowledge of C++ and context-free grammars\n\n### Installation\n1. Clone the repository:\n```cpp\ngit clone https://github.com/Vikas2171/If_else_parser.git\n```\n2. Navigate to the Project Directory:\n```cpp\ncd If_else_parser\n```\n3. Compile the Program:\n```cpp\ng++ -o if_else_parser if_else_parser.cpp\n```\n4. Run the Program:\n```cpp\n./if_else_parser\n```\n\n## Usage\n1. Input:\n\n    The program prompts you to enter a string representing an `if-else` conditional statement in C++.\n\n2. Output:\n\n    If the input is valid, the program will:\n    * Print \"The given input is valid\"\n    * Display the parse tree with each level on a separate line.\n    * List all the context-free grammar rules used, displayed as an adjacency list.\n    * If the input is invalid, it will print \"The given input has Invalid Syntax\".\n\n## Example Run\n* INPUT\n```cp\nif(condition){}else{}\n```\n* OUTPUT\n\n![output](https://github.com/Vikas2171/If_else_parser/blob/main/image.png)\n\n## Acknowledgements\nWe would like to express our sincere gratitude to Senior Professor Subhasis Bhattacharjee of IIT Jammu for his guidance and support throughout this course project. His expertise and insights have been invaluable in the development of this parser.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikas2171%2Fif_else_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikas2171%2Fif_else_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikas2171%2Fif_else_parser/lists"}