{"id":29630063,"url":"https://github.com/dps/toybasic","last_synced_at":"2025-09-08T19:36:50.991Z","repository":{"id":137287499,"uuid":"334516187","full_name":"dps/toybasic","owner":"dps","description":"A toy basic compiler playground","archived":false,"fork":false,"pushed_at":"2021-02-01T04:42:30.000Z","size":26,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-21T10:19:39.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dps.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":"2021-01-30T21:34:43.000Z","updated_at":"2025-06-20T20:51:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e11c706-f713-4e11-b970-cb3f31f1dbc0","html_url":"https://github.com/dps/toybasic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dps/toybasic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dps%2Ftoybasic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dps%2Ftoybasic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dps%2Ftoybasic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dps%2Ftoybasic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dps","download_url":"https://codeload.github.com/dps/toybasic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dps%2Ftoybasic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231435,"owners_count":25245585,"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-09-08T02:00:09.813Z","response_time":121,"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":[],"created_at":"2025-07-21T10:08:06.183Z","updated_at":"2025-09-08T19:36:50.960Z","avatar_url":"https://github.com/dps.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toybasic\n\nThis is a toy compiler for a simple dialect of BASIC in golang. It's written in Go and it generates (ugly!) Go code.\nI made this just for fun. The code is pretty short and hopefully easy to read. I hope you enjoy it too.\n\nExample program `example/hello.bas`\n```VB\n10 PRINT \"Hello, world.\"\n20 LET x = (3 * 2) + 3\n30 LET x = x + 1\n40 IF x == 10 THEN PRINT \"Ten!\"\n45 PRINT x\n50 IF x \u003e= 15 THEN GOTO 70\n60 GOTO 30\n70 END\n```\nExample output\n```\n$ ./toybasic \u003cexample/hello.bas\n$ go run out.go\nHello, world.\nTen!\n10\n11\n12\n13\n14\n15\n```\n# The lexer\nThe lexer uses `github.com/blynn/nex`. I really like `nex`'s awk-like syntax.\n```\n$ go run github.com/blynn/nex lexer.nex\n```\n\n# The parser\nThe parser uses `goyacc`\n```\n$ go run golang.org/x/tools/cmd/goyacc -o toybasic.go parser.y\n```\n\n# Build the compiler\n```\n$ go build -o toybasic toybasic.go lexer.nn.go compiler.go\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdps%2Ftoybasic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdps%2Ftoybasic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdps%2Ftoybasic/lists"}