{"id":32955316,"url":"https://github.com/teverett/jvmBASIC","last_synced_at":"2025-11-17T16:02:09.508Z","repository":{"id":6140002,"uuid":"7368733","full_name":"teverett/jvmBASIC","owner":"teverett","description":"A BASIC to JVM bytecode compiler","archived":false,"fork":false,"pushed_at":"2025-07-21T00:58:59.000Z","size":1508,"stargazers_count":50,"open_issues_count":6,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-07-30T10:57:17.469Z","etag":null,"topics":["antlr-grammar","bas","basic-programming-language","bottlesofbeer","bytecode-compiler","expose","java","javap","jvm","maven-mojo"],"latest_commit_sha":null,"homepage":null,"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/teverett.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":"2012-12-29T17:36:22.000Z","updated_at":"2025-05-20T17:20:44.000Z","dependencies_parsed_at":"2024-06-09T05:26:41.447Z","dependency_job_id":"d6904e3c-1b07-42eb-b64d-f25b61dd7bc4","html_url":"https://github.com/teverett/jvmBASIC","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/teverett/jvmBASIC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2FjvmBASIC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2FjvmBASIC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2FjvmBASIC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2FjvmBASIC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teverett","download_url":"https://codeload.github.com/teverett/jvmBASIC/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teverett%2FjvmBASIC/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284911789,"owners_count":27083425,"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-11-17T02:00:06.431Z","response_time":55,"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":["antlr-grammar","bas","basic-programming-language","bottlesofbeer","bytecode-compiler","expose","java","javap","jvm","maven-mojo"],"created_at":"2025-11-12T22:00:43.627Z","updated_at":"2025-11-17T16:02:09.502Z","avatar_url":"https://github.com/teverett.png","language":"Java","readme":"![CI](https://github.com/teverett/jvmBASIC/workflows/CI/badge.svg)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dae9bbea869d4757a7d3a2578bd79348)](https://www.codacy.com/app/teverett/jvmBASIC?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=teverett/jvmBASIC\u0026amp;utm_campaign=Badge_Grade)\n\njvmBASIC\n========\n\nA BASIC to JVM bytecode compiler\n\njvmBASIC is a bytecode compiler which is capable of consuming a BASIC file (.bas) and producing a JVM .class file. The JVM class file exposes a public class named after the input file and a public method \"program()\" which contains the generated bytecode.  The generated .class file also exposes a \"void main()\" method which enables the BASIC program to be run from the command line.\n\nIn order to use the generated .class file from Java code, the public class members \"inputStream\" and \"outputStream\" must be set, in order for the BASIC program to consume input and produce output.\n\n\nMaven Coordinates\n-------------------\n\njvmBasicCC\n\n```\n\u003cgroupId\u003ecom.khubla.jvmbasic\u003c/groupId\u003e\n\u003cartifactId\u003ejvmbasicc\u003c/artifactId\u003e\n\u003cversion\u003e2.4.0\u003c/version\u003e\n\u003cpackaging\u003ejar\u003c/packaging\u003e\n```\n\njvmBasicRT\n\n```\n\u003cgroupId\u003ecom.khubla.jvmbasic\u003c/groupId\u003e\n\u003cartifactId\u003ejvmbasicrt\u003c/artifactId\u003e\n\u003cversion\u003e2.4.0\u003c/version\u003e\n\u003cpackaging\u003ejar\u003c/packaging\u003e\n```\n\n\n\nLicense\n---------\n\njvmBASIC is distributed until the GPL v3. For more information please see the [GPL](http://www.gnu.org/licenses/gpl.txt).\n\nModules\n---------\n\nThe modules are:\n\n* jvmBasicc - The jvmBASIC compiler\n* jvmBasicrt - the jvmBASIC runtime library\n* jvmBasicwww - A simple web server that uses BASIC programs to generate HTML over HTTP\n* jvmBasicmojo - A maven mojo that compiles all .bas files found at /src/main/basic to .class files\n* examples - a simple directory of examples\n* demo - a simple .BAS program which can be compiled to produce a .jar and run to produce output\n\nThe Implementation\n---------\n\nNotes on the implementation\n\n* The Parser and Lexer are created by [ANTLR](http://www.antlr.org) via an ANTLR grammar. \n* The generated bytecode is created by ObjectWeb [ASM](http://asm.ow2.org/)\n* Currently screen functions such as \"CLEAR\" are not implemented\n* Math functions and string functions are implemented in the jvmBasic runtime jar \"jvmbasicrt.jar\"\n* BASIC types are implemented by the class \"Value\" in jvmbasicrt.jar\n\nRunning an example\n---------\n\n* build jvmBASIC: `mvn clean package install`\n* use the script `run_bas.sh` to run an example:\n\n\u003cpre\u003e\nsh run_bas.sh hellojvmBASIC.bas\n\u003c/pre\u003e\n\nThe output should look very much like:\n\u003cpre\u003e\nshrek:jvmBASIC tom$ sh run_bas.sh hellojvmBASIC.bas \nRunning BASIC file hellojvmBASIC.bas\nkhubla.com jvmBASIC Compiler\nCompiling: /Users/tom/projects/jvmBASIC/hellojvmBASIC.bas\nadded manifest\nadding: hellojvmBASIC.class(in = 1402) (out= 740)(deflated 47%)\n19:17:44.698 [main] INFO com.khubla.jvmbasic.jvmbasicrt.ExecutionContext - pushing String: '\"hello from jvmBASIC\"'\n19:17:44.701 [main] INFO com.khubla.jvmbasic.jvmbasicrt.ExecutionContext - popping hello from jvmBASIC\nhello from jvmBASIC\nshrek:jvmBASIC tom$ \n\u003c/pre\u003e\n\n\nUsing jvmBASICC\n---------\n\njvmbasicc.jar is the jvmBASIC compiler. The only required parameter is -file, which is used to specify an input file.  For example to compile \"myprogram.bas\" to bytecode:\n\n`java -jar jvmbasicc.jar -file myprogram.bas`\n\nThis will produce \"jvmbasicc.class\"\n\nOnce jvmbasicc.class has been combined into a jar file, the file \"jvmbasicrt.jar\" must be on the class path order order to run the generated code.\n\nRunning `java -jar jvmbasicc.jar` will produce help output, which will show all the commandline options.\n\nThe generated bytecode\n---------\n\nInspecting the generated bytecode\n\nTo view the generated class at the command line, use javap.  For example to view the generated output for \"bottlesofbeer.bas\" type\n\n`javap botttlesofbeer`\n\nto produce more verbose output from javap use\n\n`javap -c bottlesofbeer`\n\nThe grammar\n---------\n\nThe ANTLR grammar is at \n\n[https://github.com/teverett/jvmBASIC/blob/master/jvmbasicc/src/main/antlr4/com/khubla/jvmbasic/jvmbasicc/antlr/jvmBasic.g4](https://github.com/teverett/jvmBASIC/blob/master/jvmbasicc/src/main/antlr4/com/khubla/jvmbasic/jvmbasicc/antlr/jvmBasic.g4)\n\nThere is an excellent ANTLR grammar editor here:\n\n[ANTLRWorks](http://www.antlr.org/works/)\n\nOnce you have created the grammar you need, recompile jvmBasicc:\n\n`mvn clean package`\n\nIf you wish to use jvmBasicMojo, you will have to install the generated jvmBasic compiler:\n\n`mvn clean package install`\n\nRunning the Examples\n---------\n\nThe examples are standard maven builds, and require the jvmBASIC maven mojo \"jvmBasicmojo\".  In order for the examples to work propertly jvmbasicc.jar, jvmbasicrt.jar and jvmbasicmojo.jar must all have been compiled and installed.  The easiest way to do this is to run this command from the root jvmBasic directory\n\n`mvn clean package install`\n\nTo use the jvmBasic maven moojo from the command line:\n\n`mvn clean jvmbasic:jvmbasic jar:jar`\n\nThis will build the BASIC files, and produce a jar that can be run from the command line.  jvmbasicrt.jar must be on the command line.\n\njvmBASIC WWW\n---------\n\njvmBASIC WWW is a very simple web server that produces HTML output from BASIC files.  To run it use a command line similar to this:\n\n`java -jar target/jvmbasicwww.jar -sourcedir www -classdir www/classfiles/ -port 8080`\n\nThe basic files to compile are the directory specified by -sourcedir and the generated classes are in the directory specified by -classdir.  The HTTP port to bind is specified by -port.  The default page is served by INDEX.bas.\n\nto run the example use:\n\n`sh run.sh` and point your browser to `http://localhost:8080/`\n\n\n\n","funding_links":[],"categories":["Dialects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteverett%2FjvmBASIC","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteverett%2FjvmBASIC","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteverett%2FjvmBASIC/lists"}