{"id":20575552,"url":"https://github.com/janbaig/tree-walk-interpreter","last_synced_at":"2026-06-10T09:31:47.804Z","repository":{"id":45038507,"uuid":"507673431","full_name":"janbaig/tree-walk-interpreter","owner":"janbaig","description":"Implementing a Tree-Walk Interpreter","archived":false,"fork":false,"pushed_at":"2023-10-26T15:59:07.000Z","size":138,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T10:55:39.819Z","etag":null,"topics":["interpreters","java"],"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/janbaig.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":"2022-06-26T20:06:03.000Z","updated_at":"2025-01-07T02:58:24.000Z","dependencies_parsed_at":"2025-01-16T21:41:53.061Z","dependency_job_id":"e9ffbb26-f915-4ec8-b8fa-bbd3a8e18b2a","html_url":"https://github.com/janbaig/tree-walk-interpreter","commit_stats":null,"previous_names":["janbaig/tree-walk-interpreter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/janbaig/tree-walk-interpreter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janbaig%2Ftree-walk-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janbaig%2Ftree-walk-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janbaig%2Ftree-walk-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janbaig%2Ftree-walk-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janbaig","download_url":"https://codeload.github.com/janbaig/tree-walk-interpreter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janbaig%2Ftree-walk-interpreter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34146871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":["interpreters","java"],"created_at":"2024-11-16T05:39:34.700Z","updated_at":"2026-06-10T09:31:47.602Z","avatar_url":"https://github.com/janbaig.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tree-Walk Interpreter\n#### Goals\n- [x] Scanner\n- [x] Print Abstract Syntax Tree (AST)\n- [x] Parser\n- [x] Variable Resolution Pass\n\n#### Evaluates:\n- Expressions \u0026 Arithmetic\n- Branching \u0026 Looping \n- Variables, Functions \u0026 Function calls \n- Parameter binding \u0026 Function return statements \n- Classes, Inheritance, Instance variables, \u0026 Methods\n\n#### Future Features \n- [ ] Ability to evaluate string interpolation\n- [ ] Add support for the C-style conditional or “ternary” operator ``?:``.\n\n#### Example Program\n```rust\nclass Cake {\n  taste() {\n    var adjective = \"delicious\";\n    print \"The \" + this.flavor + \" cake is \" + adjective + \"!\";\n  }\n}\n\nvar cake = Cake();\ncake.flavor = \"German chocolate\";\ncake.taste(); // Prints \"The German chocolate cake is delicious!\".\n```\n\n#### BNF Grammer\n```css\nprogram        → declaration* EOF ;\n\ndeclaration    → classDecl\n               | funDecl\n               | varDecl\n               | statement ;\n\nclassDecl      → \"class\" IDENTIFIER ( \"\u003c\" IDENTIFIER )? \"{\" function* \"}\" ;\n\nfunDecl        → \"fun\" function ;\nfunction       → IDENTIFIER \"(\" parameters? \")\" block ;\nparameters     → IDENTIFIER ( \",\" IDENTIFIER )* ;\n\nvarDecl        → \"var\" IDENTIFIER ( \"=\" expression )? \";\" ;\n\nstatement      → exprStmt\n               | forStmt\n               | ifStmt\n               | printStmt\n               | returnStmt\n               | whileStmt\n               | block ;\n\nblock          → \"{\" declaration* \"}\" ;\n\nifStmt         → \"if\" \"(\" expression \")\" statement\n               ( \"else\" statement )? ;\n\nwhileStmt      → \"while\" \"(\" expression \")\" statement ;\n\nforStmt        → \"for\" \"(\" ( varDecl | exprStmt | \";\" )\n                 expression? \";\"\n                 expression? \")\" statement ;\n\nexprStmt       → expression \";\" ;\nprintStmt      → \"print\" expression \";\" ;\nreturnStmt     → \"return\" expression? \";\" ;\n\nexpression     → assignment ;\nassignment     → ( call \".\")? IDENTIFIER \"=\" assignment\n               | logic_or ;\n\nlogic_or       → logic_and ( \"or\" logic_and )* ;\nlogic_and      → equality ( \"and\" equality )* ;\nequality       → comparison ( ( \"!=\" | \"==\" ) comparison )* ;\ncomparison     → term ( ( \"\u003e\" | \"\u003e=\" | \"\u003c\" | \"\u003c=\" ) term )* ;\nterm           → factor ( ( \"-\" | \"+\" ) factor )* ;\nfactor         → unary ( ( \"/\" | \"*\" ) unary )* ;\nunary          → ( \"!\" | \"-\" ) unary | call ;\ncall           → primary ( \"(\" arguments? \") | \".\" IDENTIFIER )* ;\narguments      → expression ( \",\" expression )* ;\n\nprimary        → \"true\" | \"false\" | \"nil\"\n               | NUMBER | STRING | IDENTIFIER\n               | \"(\" expression \")\"\n               | \"super\" \".\" IDENTIFIER ;\n```\n\n#### Great Learning Resources\n- [Crafting Interpreters](https://craftinginterpreters.com/) by Robert Nystrom\n- [Building Recursive Descent Parsers](https://www.booleanworld.com/building-recursive-descent-parsers-definitive-guide/#How_does_parsing_work) by Supriyo Biswas\n\n\u003c!-- ![](https://user-images.githubusercontent.com/76413679/178587724-7ec4de45-b3fc-4844-9b46-b153afd2353b.png) --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanbaig%2Ftree-walk-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanbaig%2Ftree-walk-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanbaig%2Ftree-walk-interpreter/lists"}