{"id":20134379,"url":"https://github.com/vivekkdagar/xbasic","last_synced_at":"2025-07-10T11:11:42.826Z","repository":{"id":229831532,"uuid":"777639511","full_name":"vivekkdagar/xbasic","owner":"vivekkdagar","description":"A Python-based, extended interpretation of the BASIC language, enriched with additional features and functionalities.","archived":false,"fork":false,"pushed_at":"2024-04-04T19:26:00.000Z","size":1114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T09:26:29.474Z","etag":null,"topics":["basic-programming","cli","cli-app","click","compiler","interpreter","language","lexer","lexical-analysis","parser","project","pypi","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/xbasic/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vivekkdagar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-03-26T08:33:51.000Z","updated_at":"2024-03-28T14:01:11.000Z","dependencies_parsed_at":"2025-01-13T09:23:16.230Z","dependency_job_id":"a7448ce2-d923-4b12-b977-b159fc366c88","html_url":"https://github.com/vivekkdagar/xbasic","commit_stats":null,"previous_names":["vivekkdagar/xbasic"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekkdagar%2Fxbasic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekkdagar%2Fxbasic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekkdagar%2Fxbasic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekkdagar%2Fxbasic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vivekkdagar","download_url":"https://codeload.github.com/vivekkdagar/xbasic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241580759,"owners_count":19985611,"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":["basic-programming","cli","cli-app","click","compiler","interpreter","language","lexer","lexical-analysis","parser","project","pypi","python"],"created_at":"2024-11-13T21:09:22.313Z","updated_at":"2025-03-02T22:27:31.122Z","avatar_url":"https://github.com/vivekkdagar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n\n\u003cimg src=https://github.com/vivekkdagar/xbasic/blob/main/assets/menu.png alt=\"logo\"/\u003e\n\n\u003ch1\u003exbasic\u003c/h1\u003e\n\u003cp\u003eA Python-based, extended interpretation of the BASIC language, enriched with additional features and functionalities.\u003c/p\u003e\n\n\u003ch4\u003e \u003cspan\u003e · \u003c/span\u003e \u003ca href=\"https://github.com/vivekkdagar/xbasic/blob/master/README.md\"\u003e Documentation \u003c/a\u003e \u003cspan\u003e · \u003c/span\u003e \u003ca href=\"https://github.com/vivekkdagar/xbasic/blob/main/SYNTAX.md\"\u003e Syntax Guide \u003c/a\u003e \u003cspan\u003e · \u003c/span\u003e \u003ca href=\"https://github.com/vivekkdagar/xbasic/blob/main/example.bsx\"\u003e Example program \u003c/a\u003e \u003c/h4\u003e\n\n\n\u003cbr\u003e\n\n\u003c!-- TOC --\u003e\u003ca name=\"-project-feature-breakdown\"\u003e\u003c/a\u003e\n## 🪄 Project Feature Breakdown\n\u003c/div\u003e\n\n**Parsing and Tokenization:**\n- Utilizes a custom lexical analyzer or tokenizer (`Token`, `TokenList`) to break down source code into tokens (keywords, identifiers, operators, literals).\n- Implements parsing logic using recursive descent parsing.\n- Recognizes the structure of the input code based on defined grammar rules.\n\n**Abstract Syntax Tree (AST):**\n- Defines classes (`Value`, `String`, `NumberNode`, `BinOpNode`, etc.) to represent nodes in the abstract syntax tree (AST).\n- Constructs the AST by recursively building nodes during parsing.\n  \n**Error Handling:**\n- Provides a `ParseResult` class to manage parsing results and errors.\n- Defines error classes like `InvalidSyntaxError` and `RTError` for reporting syntax and runtime errors.\n\n**Execution Logic:**\n- Implements an interpreter component responsible for executing parsed AST nodes.\n- Traverses the AST and performs operations defined by language semantics.\n\n**Language Features:**\n- Supports variables with data types such as numbers, strings, and lists.\n- Provides constructs for control flow (`if`, `for`, `while` loops) and flow control statements (`return`, `continue`, `break`).\n- Allows defining and calling functions (`func-def`, `call`).\n\n**Utilities:**\n- Tracks position (line and column numbers) of tokens and nodes in the source code using utilities like `Position`.\n- Handles contextual information during parsing and execution using the `Context` class.\n\u003cbr\u003e\n\n\u003c!-- TOC --\u003e\u003ca name=\"notebook_with_decorative_cover-table-of-contents\"\u003e\u003c/a\u003e\n# :notebook_with_decorative_cover: Table of Contents\n\n- [Project Feature Breakdown](#-project-feature-breakdown)\n- [Screenshots](#camera-screenshots)\n- [Installation \u0026 Usage Guide](#toolbox-installation-from-pypi-or-build-from-source)\n- [Contributing](#wave-contributing)\n- [FAQ](#grey_question-faq)\n\n\n\u003c!-- TOC --\u003e\u003ca name=\"star2-about-the-project\"\u003e\u003c/a\u003e\n## :star2: About the Project\n\n\u003c!-- TOC --\u003e\u003ca name=\"camera-screenshots\"\u003e\u003c/a\u003e\n### :camera: Screenshots\n\n\u003c!-- TOC --\u003e\u003ca name=\"executing-a-file-within-the-shell\"\u003e\u003c/a\u003e\n#### Executing a file within the shell\n\u003cdiv align=\"center\"\u003e \u003ca href=\"\"\u003e\u003cimg src=\"https://github.com/vivekkdagar/xbasic/blob/main/assets/file.png\" alt='image' width='800'/\u003e\u003c/a\u003e \u003c/div\u003e\n\n\u003c!-- TOC --\u003e\u003ca name=\"using-the-interactive-shell\"\u003e\u003c/a\u003e\n#### Using the interactive shell\n\u003cdiv align=\"center\"\u003e \u003ca href=\"\"\u003e\u003cimg src=\"https://github.com/vivekkdagar/xbasic/blob/main/assets/shell.png\" alt='image' width='800'/\u003e\u003c/a\u003e \u003c/div\u003e\n\n\u003c!-- TOC --\u003e\u003ca name=\"opening-the-github-page\"\u003e\u003c/a\u003e\n#### Opening the github page\n\u003cdiv align=\"center\"\u003e \u003ca href=\"\"\u003e\u003cimg src=\"https://github.com/vivekkdagar/xbasic/blob/main/assets/git.png\" alt='image' width='800'/\u003e\u003c/a\u003e \u003c/div\u003e\n\n\n\n\u003c!-- TOC --\u003e\u003ca name=\"toolbox-installation-from-pypi-or-build-from-source\"\u003e\u003c/a\u003e\n## :toolbox: Installation (from PyPI or Build from Source)\n\n\n\n\u003ch3\u003e\u003ca id=\"pypi\"\u003e Install from PyPI\u003c/a\u003e\u003c/h3\u003e\n\nYou can install the `xbasic` package directly from PyPI using the following command:\n\n```bash\npip install xbasic\n```\n\n\n\u003c!-- TOC --\u003e\u003ca name=\"build-from-source\"\u003e\u003c/a\u003e\n### Build from Source\n\nClone the repository\n\n```bash\ngit clone https://github.com/vivekkdagar/xbasic\n```\n\nGo to the project directory\n```bash\ncd xbasic\n```\n\nBuild the package:\n\n```bash\npython3 -m build\n```\n\nInstall the package:\n\n```bash\npip install dist/*gz\n```\n\n\u003c!-- TOC --\u003e\u003ca name=\"book-usage-guide\"\u003e\u003c/a\u003e\n## :book: Usage Guide\n\nBelow is a guide on how to interact with xbasic:\n\n1. **Open github page**\n   ```bash\n     xbasic report\n   ```\n\n\n2. **Start an interactive shell**\n\n   ```bash\n     xbasic shell\n   ```\n\n3. **Execute a file within the shell**\n\n   ```bash\n     xbasic file -f path\n   ```\n   \n   - `-f`: Specify the path where the bsx file is.\n\n\n\n\n\u003c!-- TOC --\u003e\u003ca name=\"wave-contributing\"\u003e\u003c/a\u003e\n## :wave: Contributing\n\n\u003ca href=\"https://github.com/vivekkdagar/xbasic/graphs/contributors\"\u003e \u003cimg src=\"https://contrib.rocks/image?repo=Louis3797/awesome-readme-template\" /\u003e \u003c/a\u003e\n\nContributions are always welcome!\n\nsee [`contributing.md`](CONTRIBUTING.md) for ways to get started\n\n\u003c!-- TOC --\u003e\u003ca name=\"grey_question-faq\"\u003e\u003c/a\u003e\n## :grey_question: FAQ\n\n**1. What is XBasic?**\n   - XBasic is a project aimed at developing an interpreter for a programming language called XBasic. It involves the creation of a parser, lexer, and executor for XBasic code, allowing users to write and execute XBasic programs.\n\n**2. What features does XBasic offer?**\n   - XBasic aims to provide a range of features common to programming languages, including variable assignment, arithmetic operations, control flow statements (such as if-else, loops), function definitions, and function calls. It also supports data types like numbers, strings, and lists.\n\n**3. How is XBasic implemented?**\n   - XBasic is implemented in Python. The project includes custom logic for lexical analysis (tokenization), parsing, and execution of XBasic code. It utilizes object-oriented programming principles to represent language constructs and manage program execution.\n\n**5. How are errors handled in XBasic?**\n   - XBasic includes error handling mechanisms to report syntax errors during parsing and runtime errors during program execution. Custom error classes are used to provide informative messages, including error location and context, helping users debug their code effectively.\n\n**6. How can I get started with XBasic?**\n   - To get started with XBasic, you can clone the project repository from GitHub and follow the setup instructions. Once set up, you can explore the codebase, contribute to development, or use the interpreter to write and execute XBasic programs. Additionally, documentation and examples are provided to guide users through usage and development processes.\n\n**7. What file format does XBasic use?**\n   - XBasic uses the \".bsx\" file format for XBasic source code files. Users can write XBasic code in files with the \".bsx\" extension, and the XBasic interpreter can parse and execute these files. This file format helps organize and store XBasic programs efficiently.\n\n\n\n\u003c!-- TOC --\u003e\u003ca name=\"warning-license\"\u003e\u003c/a\u003e\n## :warning: License\n\nDistributed under the MIT License. See LICENSE for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekkdagar%2Fxbasic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvivekkdagar%2Fxbasic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekkdagar%2Fxbasic/lists"}