{"id":21143896,"url":"https://github.com/alafty/regularexpressiontonfa","last_synced_at":"2025-08-26T02:10:13.468Z","repository":{"id":250717996,"uuid":"758204638","full_name":"alafty/RegularExpressionToNFA","owner":"alafty","description":"Task 1 for the Compilers lab where the needed deliverable is a function that takes a regular expression as an input and outputs an equivalent NFA as per Thompson's methon","archived":false,"fork":false,"pushed_at":"2024-03-07T00:16:02.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T13:24:20.813Z","etag":null,"topics":["compiler-design","compilers","java","nfa","regex"],"latest_commit_sha":null,"homepage":"","language":"Java","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/alafty.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-02-15T20:36:57.000Z","updated_at":"2024-07-29T12:34:49.000Z","dependencies_parsed_at":"2024-07-29T17:35:37.014Z","dependency_job_id":null,"html_url":"https://github.com/alafty/RegularExpressionToNFA","commit_stats":null,"previous_names":["alafty/regularexpressiontonfa"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alafty/RegularExpressionToNFA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alafty%2FRegularExpressionToNFA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alafty%2FRegularExpressionToNFA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alafty%2FRegularExpressionToNFA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alafty%2FRegularExpressionToNFA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alafty","download_url":"https://codeload.github.com/alafty/RegularExpressionToNFA/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alafty%2FRegularExpressionToNFA/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272160241,"owners_count":24883779,"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","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["compiler-design","compilers","java","nfa","regex"],"created_at":"2024-11-20T08:02:52.018Z","updated_at":"2025-08-26T02:10:13.414Z","avatar_url":"https://github.com/alafty.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RegExToNfa\n\n## Description\n\nThe `RegExToNfa` Java class provides functionality to convert a regular expression into a corresponding Non-Deterministic Finite Automata (NFA) using Thompson's construction algorithm. This conversion is a crucial step in various applications, such as pattern matching and lexical analysis.\n\n## Usage\n\nTo use the `RegExToNfa` class, follow these steps:\n\n1. Include the `RegExToNfa.java` file in your Java project.\n2. Create an instance of the `RegExToNfa` class, providing the regular expression in postfix notation and the alphabet as input.\n3. Call the `toString()` method of the `RegExToNfa` instance to obtain a formatted string representation of the resulting NFA.\n\nExample:\n\n```java\nString regex = \"abcu#abc|.∪.*\";\nRegExToNfa converter = new RegExToNfa(regex);\nString nfaString = converter.toString();\nSystem.out.println(nfaString);\n```\n\n## Input Format\n\nThe input to the `RegExToNfa` class should be a regular expression in postfix notation, where:\n\n- Characters represent literals in the regular expression.\n- `.` represents concatenation.\n- `∪` represents union.\n- `*` represents Kleene star (zero or more occurrences).\n- `e` represents an empty string (epsilon transition).\n\n## Output Format\n\nThe output of the `toString()` method is a formatted string representation of the resulting NFA. The string representation follows a specific format as described in the task description.\n\n## Classes\n\n- `RegExToNfa`: Main class responsible for converting a regular expression to an NFA.\n- `State`: Represents a state in the NFA.\n- `NFA`: Represents the NFA, containing states, transitions, start state, and accept state.\n- `Transition`: Represents a transition between states in the NFA.\n\n## Authors\n\n- [Mohamed El-Alafty](https://github.com/alafty)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falafty%2Fregularexpressiontonfa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falafty%2Fregularexpressiontonfa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falafty%2Fregularexpressiontonfa/lists"}