{"id":18679966,"url":"https://github.com/effeix/pascalsimplifiedcompiler","last_synced_at":"2025-07-04T13:03:02.351Z","repository":{"id":92510067,"uuid":"122109011","full_name":"effeix/PascalSimplifiedCompiler","owner":"effeix","description":"Simplified compiler for the Pascal language built with Python3","archived":false,"fork":false,"pushed_at":"2018-05-30T00:08:49.000Z","size":7105,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T22:21:49.667Z","etag":null,"topics":["compiler","languages","pascal","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/effeix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-02-19T19:18:15.000Z","updated_at":"2023-08-02T00:21:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"856fee16-c644-4b42-ab75-cee0bf65385b","html_url":"https://github.com/effeix/PascalSimplifiedCompiler","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effeix%2FPascalSimplifiedCompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effeix%2FPascalSimplifiedCompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effeix%2FPascalSimplifiedCompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/effeix%2FPascalSimplifiedCompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/effeix","download_url":"https://codeload.github.com/effeix/PascalSimplifiedCompiler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239533066,"owners_count":19654617,"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","languages","pascal","python3"],"created_at":"2024-11-07T09:47:24.541Z","updated_at":"2025-02-18T19:15:37.537Z","avatar_url":"https://github.com/effeix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pascal Simplified Compiler\n\n### Usage\nYou are free to use PSC however you like. Simply clone the repository and run the file ```main.py``` (located inside directory ```src/```):\n\n```sh\n$ python3 src/main.py PASCAL_FILE i|c\n```\n\nwhere ```i``` stands for the interpreted version and ```c``` for the compiled version.\n\nThe compiled executable will be generated inside diretory ```bin/```, located in repository root (same level as ```src/```).\n\n##### Dependencies\n- Python 3.6.x\n- NASM command line tool\n- GNU Linker\n\n### Features\n###### Features marked with \"!\" are currently being implemented\n- [x] Lexical Analysis\n- [x] Syntactic Analysis\n- [x] Addition / Subtraction\n- [x] Multiplication / Division\n- [x] Comments\n- [x] Syntatic Errors\n- [x] Parenthesis\n- [x] Unary Operators\n- [x] Abstract Syntax Tree\n- [x] Program Flow\n- [x] Keywords\n- [x] Variables\n- [x] Symbol Table\n- [x] Print\n- [x] Boolean Operators\n- [x] Conditional Statements\n- [x] Loops\n- [x] Read\n- [x] Variable Declaration\n- [x] Types\n- [x] Type checking\n- [x] Semantic Errors\n- [x] Functions\n- [x] Function Arguments\n- [x] Variable Scopes\n- [ ] Code Generation !\n\n### EBNF\nAn [EBNF (\u003cb\u003eE\u003c/b\u003extended \u003cb\u003eB\u003c/b\u003eackus-\u003cb\u003eN\u003c/b\u003eaur \u003cb\u003eF\u003c/b\u003eorm)](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) is a sequence of statements describing a [Context-Free Grammar](https://en.wikipedia.org/wiki/Context-free_grammar). It is used to represent a formal language or programming language and, as the name sugests, is an extension to the original [BNF (\u003cb\u003eB\u003c/b\u003eackus-\u003cb\u003eN\u003c/b\u003eaur \u003cb\u003eF\u003c/b\u003eorm)](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form).\n\nBelow is the EBNF for this compiler:\n```ebnf\nprogram = \"program\", identifier, \";\", block, \".\";\nblock = [\"var\", varblock], [funcblock], statements;\nvar_declaration = identifier, {\",\", identifier}, \":\", type;\nvarblock = var_declaration, {\";\", var_declaration};\nfuncblock = \"function\", identifier, \"(\", {var_declaration}, \")\", \":\", type, \";\", block;\nstatements = \"begin\", statement, {\";\", statement}, [\";\"], \"end\";\nstatement = attribution | statements | print | if | while;\nif = \"if\", expression, \"then\", statement, [\"else\", statement];\nwhile = \"while\", expression, \"do\", statement;\nattribution = identifier, \":=\", expression | read;\nread = \"read\", \"(\", \")\";\nprint = \"print\", \"(\", expression, \")\";\nexpression = simple_expression, {(\"\u003c\" | \"\u003e\" | \"=\"), simple_expression};\nsimple_expression = term, {(\"+\" | \"-\" | \"or\"), term};\nterm = factor, {(\"*\", \"/\", \"and\"), factor};\nfactor = ({\"+\" | \"-\" | \"not\"}, factor) | number | (\"(\", expression, \")\") | identifier | funccall;\nfunccall = identifier, \"(\", [expression, {\";\", expression}], \")\";\nidentifier = letter, {letter | digit | \"_\" };\nnumber = digit, {digit};\nletter = a .. z | A .. Z;\ndigit = 0 .. 9;\ntype = \"bool\" | \"integer\";\n```\n\n### Syntactic Diagram\nThe syntactic diagram is a visual representation of the EBNF, describing the algorithm used by the compiler. If you pay close attention to the code, the similarities between the diagram and the algorithm are clear. Below is the syntactic diagram for this compiler:\n\n![Syntactic Diagram](https://i.imgur.com/zgaumZ6.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffeix%2Fpascalsimplifiedcompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feffeix%2Fpascalsimplifiedcompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feffeix%2Fpascalsimplifiedcompiler/lists"}