{"id":15683372,"url":"https://github.com/inokinoki/pl-0-rs","last_synced_at":"2025-06-16T19:33:02.919Z","repository":{"id":91522336,"uuid":"284217804","full_name":"Inokinoki/PL-0-rs","owner":"Inokinoki","description":"PL0 interpreter implemented in Rust","archived":false,"fork":false,"pushed_at":"2020-12-08T20:54:58.000Z","size":166,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T13:01:45.732Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Inokinoki.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-08-01T08:14:41.000Z","updated_at":"2022-08-31T08:49:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa5c4691-faf7-45e2-a414-cef682043c52","html_url":"https://github.com/Inokinoki/PL-0-rs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Inokinoki/PL-0-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inokinoki%2FPL-0-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inokinoki%2FPL-0-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inokinoki%2FPL-0-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inokinoki%2FPL-0-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inokinoki","download_url":"https://codeload.github.com/Inokinoki/PL-0-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inokinoki%2FPL-0-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260224066,"owners_count":22977336,"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":[],"created_at":"2024-10-03T17:04:47.528Z","updated_at":"2025-06-16T19:33:02.860Z","avatar_url":"https://github.com/Inokinoki.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A naive PL/0 interpreter in Rust\n\nThis project is to make me more familiar with Rust. It works right now, but maybe doesn't work well in some cases.\n\nWelcome to any contribution, if you can READ (yes, it's not even readable) the project.\n\n## PL/0 Introduction\n\nWait, what is it, the PL/0? From Wikipedia:\n\n    PL/0 is a programming language, intended as an educational programming language, that is similar to but much simpler than Pascal, a general-purpose programming language.\n\nIt's EBNF representation is like:\n\n```ebnf\nprogram = block \".\" .\n\nblock = [ \"const\" ident \"=\" number {\",\" ident \"=\" number} \";\"]\n        [ \"var\" ident {\",\" ident} \";\"]\n        { \"procedure\" ident \";\" block \";\" } statement .\n\nstatement = [ ident \":=\" expression | \"call\" ident \n              | \"?\" ident | \"!\" expression \n              | \"begin\" statement {\";\" statement } \"end\" \n              | \"if\" condition \"then\" statement \n              | \"while\" condition \"do\" statement ].\n\ncondition = \"odd\" expression |\n            expression (\"=\"|\"#\"|\"\u003c\"|\"\u003c=\"|\"\u003e\"|\"\u003e=\") expression .\n\nexpression = [ \"+\"|\"-\"] term { (\"+\"|\"-\") term}.\n\nterm = factor {(\"*\"|\"/\") factor}.\n\nfactor = ident | number | \"(\" expression \")\".\n```\n\n## Functionality\n\nThere is a simple Virtual Machine(vm) in `vm.rs` to execute the \"code\" generated.\n\nAnd a parser in `compile` to parse and generate vm code.\n\nThe lexer using in this project is [Logos](https://github.com/maciejhirsz/logos).\n\n## Build\n\n```\ncargo build\n```\n\n## Run\n\n```\ncargo run \u003cpl/0-file-path\u003e\n```\n\nThe output will be there.\n\n![Some samples](run_sample.png)\n\nUp to now, ~~only the `sample1.pl0` and `sample5.pl0` can be correctly executed and give the right output (WHAT A PITY).~~ all samples can be run correctly (Congratulation) !!!\n\n## Test\n\nThere are some tests(unit test/integration test) in the project.\n\nYou can run them with\n\n```\ncargo test\n```\n\n~~Some of them might be broken by my latest commits. So, please be patient.~~ All of them should be passed :)\n\n## Many TODOs\n\n- Error handle (some)\n- ~~Fix While loop parsing (not work yet with `sample/sample0.pl0`)~~ Done\n- List code, ~~generate~~ export symbol table\n- VM code to native binary (maybe?)\n- ...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finokinoki%2Fpl-0-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finokinoki%2Fpl-0-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finokinoki%2Fpl-0-rs/lists"}