{"id":25051063,"url":"https://github.com/n-shevko/modula2","last_synced_at":"2025-03-31T04:51:15.246Z","repository":{"id":253299054,"uuid":"843067838","full_name":"n-shevko/modula2","owner":"n-shevko","description":"Compiler for tiny subset of Modula 2","archived":false,"fork":false,"pushed_at":"2024-08-15T22:53:03.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T09:19:14.860Z","etag":null,"topics":["compiler-enginnering","llvm-ir","peg-parser"],"latest_commit_sha":null,"homepage":"","language":"F#","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/n-shevko.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-15T17:59:00.000Z","updated_at":"2024-08-15T22:53:06.000Z","dependencies_parsed_at":"2024-08-15T20:48:05.950Z","dependency_job_id":"c9b6b9fa-49a4-4cd8-9250-145d7e09470b","html_url":"https://github.com/n-shevko/modula2","commit_stats":null,"previous_names":["n-shevko/modula2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-shevko%2Fmodula2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-shevko%2Fmodula2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-shevko%2Fmodula2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-shevko%2Fmodula2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n-shevko","download_url":"https://codeload.github.com/n-shevko/modula2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418698,"owners_count":20773935,"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":["compiler-enginnering","llvm-ir","peg-parser"],"created_at":"2025-02-06T09:19:27.486Z","updated_at":"2025-03-31T04:51:15.225Z","avatar_url":"https://github.com/n-shevko.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Compiler for tiny subset of Modula 2.\n\nIt was done to learn basics of compiler engineering.\n\nLLVM IR was used as a target language.\n\n### What was done\n\n1. [Peg packrat parser generator](https://en.wikipedia.org/wiki/Packrat_parser)\n   It consumes file like [this](https://github.com/n-shevko/modula2/blob/main/modula_2/grammar.txt)\n   and generates:\n   - ast type definitions like [these](https://github.com/n-shevko/modula2/blob/main/modula_2/RawAst.fs)\n   - parser file like [this](https://github.com/n-shevko/modula2/blob/main/modula_2/Parser.fs)\n   The result parser file has function parse which can parse source code and generate ast object. \n   Parser generator supports basic quantifiers like: *+?\n   Nonterminal in {} means that it is entry point (top level) nonterminal.\n\n2. Ast [-\u003e](https://github.com/n-shevko/modula2/blob/main/modula_2/Cfg.fs) CFG pass \n   \n3. CFG [-\u003e](https://github.com/n-shevko/modula2/blob/main/modula_2/Ssa.fs) CFG in SSA form pass.\n   Inspired by \"Simple and Efficient Construction of Static Single Assignment Form (Braun)\"\n\n### Known issues\n\n- Compiler doesn't have any garbage collection\n- Implemented only arrays, structs, integers. \n- Elimination of left recursion from grammar works only if left recursion appears in the first branch\n- Syntax error reports are incomprehensible :) [This](https://github.com/n-shevko/modula2/blob/main/parser/ReportSyntaxErrors.fs) thing should be definitely rewritten \n\n### Other\nAny modification of an array\\structure copy entire agregate and then modify only needed subelement. \nThis is done on purpose for potential CPS conversion in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-shevko%2Fmodula2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn-shevko%2Fmodula2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-shevko%2Fmodula2/lists"}