{"id":16288953,"url":"https://github.com/houssemnasri/coolcompiler","last_synced_at":"2025-08-17T13:41:20.931Z","repository":{"id":42981654,"uuid":"367077730","full_name":"HoussemNasri/CoolCompiler","owner":"HoussemNasri","description":"A cool compiler for the Cool programming language!","archived":false,"fork":false,"pushed_at":"2022-10-02T14:57:12.000Z","size":10425,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T12:33:32.381Z","etag":null,"topics":["compiler","cs143","garbage-collection","hacktoberfest","java","java-cup","jlex","oop"],"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/HoussemNasri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-13T14:39:18.000Z","updated_at":"2025-03-11T16:36:47.000Z","dependencies_parsed_at":"2023-01-19T04:15:16.963Z","dependency_job_id":null,"html_url":"https://github.com/HoussemNasri/CoolCompiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HoussemNasri/CoolCompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoussemNasri%2FCoolCompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoussemNasri%2FCoolCompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoussemNasri%2FCoolCompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoussemNasri%2FCoolCompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HoussemNasri","download_url":"https://codeload.github.com/HoussemNasri/CoolCompiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HoussemNasri%2FCoolCompiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270856567,"owners_count":24657690,"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-17T02:00:09.016Z","response_time":129,"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","cs143","garbage-collection","hacktoberfest","java","java-cup","jlex","oop"],"created_at":"2024-10-10T19:49:47.296Z","updated_at":"2025-08-17T13:41:20.879Z","avatar_url":"https://github.com/HoussemNasri.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cool Compiler\nI wrote this compiler while attending CS143[^cs] compiler construction course on *edx.org*.\nThe course is divided into four assignments. In each assignment, we implement one phase of the compilation process. All phases are being tested separately using automated scripts.\n\n## The Cool Programming Language\nCool, an acronym for *Classroom Object Oriented Language*. While *small* enough for a one term project, Cool still has many of the features of modern programming languages, including *objects*, *automatic memory management*, *strong static typing* and simple *reflection*.\n### Features\nAs the primary purpose of Cool is instruction, it lacks many of the features common to other, more general programming languages. For instance, the language supports less than comparisons but not greater than. The syntax is very much stripped down, and the *standard library* contains only a few basic classes. Separate compilation is not supported, though the compiler does support multiple source files as input. Every Cool program must define a class Main which must have a no argument main method in which execution flow begins. Namespaces are not supported.\n### Examples\n\u003e Hello World:\n\n``` cool\nclass Main inherits IO {\n  main() : Object {\n    out_string(\"Hello, world!\\n\")\n  };\n};\n```\n\n\u003e A simple program for computing factorials:\n\n``` cool\nclass Main inherits IO {\n  main(): Object {{\n    out_string(\"Enter an integer greater-than or equal-to 0: \");\n\n    let input: Int \u003c- in_int() in\n      if input \u003c 0 then\n        out_string(\"ERROR: Number must be greater-than or equal-to 0\\n\")\n      else {\n        out_string(\"The factorial of \").out_int(input);\n        out_string(\" is \").out_int(factorial(input));\n        out_string(\"\\n\");\n      }\n      fi;\n  }};\n\n  factorial(num: Int): Int {\n    if num = 0 then 1 else num * factorial(num - 1) fi\n  };\n};\n```\n## Built with\n- [Java](https://dev.java/) - The main programming language\n- [JLex](https://www.cs.princeton.edu/~appel/modern/java/JLex/) - Scanner generator\n- [Java-CUP](http://www2.cs.tum.edu/projects/cup/) - Parser generator\n- [Perl](https://www.perl.org/) - Testing, but why perl?\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n### Prerequisites \n- [Java 8+](https://openjdk.java.net/install/)\n- [MIPS](https://www.mips.com/develop/tools/compilers/)\n### Download\nSee the [releases](https://github.com/HoussemNasri/CoolCompiler/releases) page for the latest build\n\n[^cs]:\n    [CS143: Compilers][CS143] - Stanford's course on the practical and theoretical aspects of compiler construction\n      \n[CS143]: https://www.edx.org/course/compilers \n\n### If you like it, please let me know :grinning:\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoussemnasri%2Fcoolcompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoussemnasri%2Fcoolcompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoussemnasri%2Fcoolcompiler/lists"}