{"id":17898775,"url":"https://github.com/mrvplusone/j--_in_scala","last_synced_at":"2025-04-03T05:15:15.389Z","repository":{"id":132436007,"uuid":"71353793","full_name":"MrVPlusOne/J--_in_Scala","owner":"MrVPlusOne","description":"A j-- compiler written in Scala","archived":false,"fork":false,"pushed_at":"2016-11-01T05:04:59.000Z","size":356,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T19:11:57.064Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/MrVPlusOne.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":"2016-10-19T12:16:26.000Z","updated_at":"2016-11-01T04:13:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"18969a5d-454d-4115-9fd1-4cd8f9281929","html_url":"https://github.com/MrVPlusOne/J--_in_Scala","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrVPlusOne%2FJ--_in_Scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrVPlusOne%2FJ--_in_Scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrVPlusOne%2FJ--_in_Scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrVPlusOne%2FJ--_in_Scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrVPlusOne","download_url":"https://codeload.github.com/MrVPlusOne/J--_in_Scala/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939239,"owners_count":20857922,"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-28T15:39:00.420Z","updated_at":"2025-04-03T05:15:15.373Z","avatar_url":"https://github.com/MrVPlusOne.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# J-- Compiler\n\nA compiler for a subset of Java, written in Scala\n\n### About J--\n\nJ-- is introduced in the book [*Introduction to Compiler Construction in a Java World*](http://www.cs.umb.edu/j--/index.html)\n\nIt supports about a half of Java's grammar, including non-nested classes and single inheritance.\n\nIts grammar is specified in the files [lexicalgrammar](lexicalgrammar) and [grammar](grammar).\n \n### Tokenization and Parsing\n\nIn this project, tokenization and parsing is implemented using Scala's combinator parsing library ([its \ngithub page](https://github.com/scala/scala-parser-combinators)), \ntheir implementations mostly sit in [Tokenizer.scala](src/main/scala/jmms/Tokenizer.scala) and [SyntaxParser.scala](src/main/scala/jmms/SyntaxParser.scala).\n\n\n### Code Generation\n\nThis J-- compiler compiles .java files into JVM .class files. The code generation part is implemented with the aid of a wonderful\nscala library called cafebabe([its github page](https://github.com/psuter/cafebabe)). I copied the source code of cafebabe \ninto this project and has made some tiny modifications on it, to help me debug. But if you replace the cafebabe package with \na direct use of its original jar files, this project should still compile and work as well.\n\n### A Swing code editor (work in progress)\n\nRun the main method from [CodePane.scala](src/main/scala/jmms/gui/CodePane.scala) and you will see a code editor pop up.\nIt's written using Java Swing's StyledDocument and JTextPane.\n\nCurrently it has some support for syntax highlighting and error reporting, and it can display the syntax tree structure corresponding \nto current cursor location. More functionality may be added in the future. \n\n![Code editor](images/code_editor.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrvplusone%2Fj--_in_scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrvplusone%2Fj--_in_scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrvplusone%2Fj--_in_scala/lists"}