{"id":17968111,"url":"https://github.com/yanhuijessica/syntax-analysis","last_synced_at":"2026-03-05T21:32:44.611Z","repository":{"id":86373770,"uuid":"235596474","full_name":"YanhuiJessica/Syntax-Analysis","owner":"YanhuiJessica","description":"LR(0)/SLR(1)/LR(1)/LALR(1), syntax analysis, simple calculator","archived":false,"fork":false,"pushed_at":"2020-02-13T13:09:44.000Z","size":333,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T15:51:22.741Z","etag":null,"topics":["dfa","lalr1","lr0","lr1","python","python3","slr1"],"latest_commit_sha":null,"homepage":"","language":"Python","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/YanhuiJessica.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":"2020-01-22T14:57:05.000Z","updated_at":"2025-04-18T03:12:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"8973c42a-221c-4554-9ebd-9c074d92efa5","html_url":"https://github.com/YanhuiJessica/Syntax-Analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YanhuiJessica/Syntax-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanhuiJessica%2FSyntax-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanhuiJessica%2FSyntax-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanhuiJessica%2FSyntax-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanhuiJessica%2FSyntax-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YanhuiJessica","download_url":"https://codeload.github.com/YanhuiJessica/Syntax-Analysis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YanhuiJessica%2FSyntax-Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30150443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dfa","lalr1","lr0","lr1","python","python3","slr1"],"created_at":"2024-10-29T14:10:56.277Z","updated_at":"2026-03-05T21:32:44.592Z","avatar_url":"https://github.com/YanhuiJessica.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Syntax-Analysis\r\n\r\n### Overview\r\n\r\n- Can construct and display LR(0) DFA and LR(1) DFA\r\n- Can judge the grammer\r\n- Can construct LR(0)/SLR(1)/LR(1)/LALR(1) ACTION/GOTO tables\r\n- Can judge whether the sentence is generated by the given grammar\r\n\r\n### Requirements\r\n\r\n- Python 3\r\n- python-graphviz\r\n  - Users can install it by running `pip install graphviz`\r\n\r\n### DFA Sample Generation\r\n\r\n#### LR(0) DFA\r\n\r\n- Sample LR(0) grammer\r\n    ```bash\r\n    E-\u003eE+T|T\r\n    T-\u003e(E)|d\r\n    # should not have new line at the end of the file\r\n    ```\r\n- Sample-generated DFA: \u003cbr\u003e\r\n![sample LR(0) DFA](img/sample_LR(0)_dfa.png)\r\n\r\n#### LR(1) DFA\r\n\r\n- Sample LR(1) grammer\r\n    ```\r\n    E-\u003e(L,E)|F\r\n    L-\u003eL,E|E\r\n    F-\u003e(F)|d\r\n    ```\r\n- Sample-generated DFA: \u003cbr\u003e\r\n![sample LR(1) DFA](img/sample_LR(1)_dfa.png)\r\n\r\n### Simple Calculator\r\n\r\nFile folder `calculator` contains a python calculator based on LR parsing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanhuijessica%2Fsyntax-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanhuijessica%2Fsyntax-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanhuijessica%2Fsyntax-analysis/lists"}