{"id":25772044,"url":"https://github.com/matinhosseinianfard/teslang-compiler","last_synced_at":"2025-09-07T06:37:59.729Z","repository":{"id":177709513,"uuid":"619492006","full_name":"MatinHosseinianFard/TesLang-compiler","owner":"MatinHosseinianFard","description":"Compiler Design course project","archived":false,"fork":false,"pushed_at":"2023-06-30T23:28:54.000Z","size":812,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T03:47:32.495Z","etag":null,"topics":["compliler","lexer","parser","ply","python3","regex","tokenizer"],"latest_commit_sha":null,"homepage":"","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/MatinHosseinianFard.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":"2023-03-27T08:48:00.000Z","updated_at":"2024-12-22T07:16:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a708537-9a2c-4a0b-9d2d-f6bab68d9a39","html_url":"https://github.com/MatinHosseinianFard/TesLang-compiler","commit_stats":null,"previous_names":["matinhosseinianfard/teslang-compiler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MatinHosseinianFard/TesLang-compiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatinHosseinianFard%2FTesLang-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatinHosseinianFard%2FTesLang-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatinHosseinianFard%2FTesLang-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatinHosseinianFard%2FTesLang-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatinHosseinianFard","download_url":"https://codeload.github.com/MatinHosseinianFard/TesLang-compiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatinHosseinianFard%2FTesLang-compiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274005337,"owners_count":25205934,"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-07T02:00:09.463Z","response_time":67,"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":["compliler","lexer","parser","ply","python3","regex","tokenizer"],"created_at":"2025-02-27T03:32:43.586Z","updated_at":"2025-09-07T06:37:59.720Z","avatar_url":"https://github.com/MatinHosseinianFard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teslang Compiler\n\nThis is a compiler project for the Teslang programming language. The compiler is designed to perform three main stages: lexical analysis, semantic analysis, and intermediate code generation.\n\n## Features\n\nThe Teslang compiler incorporates the following features:\n\n1. **Lexical Analysis**: The first stage of the compiler is responsible for tokenizing the input source code and performing lexical analysis. It breaks down the source code into a stream of tokens based on the Teslang language syntax.\n\n2. **Semantic Analysis**: The second stage of the compiler focuses on analyzing the meaning and correctness of the source code. It checks for semantic errors, performs type checking, and enforces language-specific rules and constraints.\n\n3. **Intermediate Code Generation**: The final stage of the compiler involves generating intermediate code representation from the validated source code. This intermediate code can be further processed and optimized for execution on a specific target platform.\n\nAdditional Features:\n\n- **Forward Referencing**: The compiler supports forward referencing, allowing references to identifiers before their declaration within the source code.\n\n- **Error Correction and Handling**: The compiler includes mechanisms to detect and handle errors encountered during the compilation process. It provides meaningful error messages to aid in debugging and improving the code.\n- **Scope**: The compiler manages variable scoping, ensuring that variables are properly declared and accessed within their respective scopes.\n- **Nested Functions**: The Teslang language supports nested functions, and the compiler handles their parsing, scoping, and code generation.\n\n## Usage\n\nTo use the Teslang compiler, follow these steps:\n\n1. Clone the repository:\n```https://github.com/MatinHosseinianFard/TesLang-compiler.git```\n\n2. Create a virtual environment:\n‍‍‍‍```python3 -m venv venv```\n\n3. Activate the virtual environment\n\n4. Install the required dependencies:\n```pip install -r requirements.txt```\n\n5. Execute the `compile.py` file to compile the Teslang source code:\n```python compile.py```\n\nAfter the compilation process is complete, the intermediate code will be generated in the `generated_IR.out` file. You can execute this intermediate code using the Teslang Virtual Machine (tsvm) available at [https://github.com/aligrudi/tsvm](https://github.com/aligrudi/tsvm).\n\nTo execute the intermediate code using tsvm, follow these steps:\n\n1. Download and compile the `tsvm.c` file.\n2. Run the compiled `tsvm` executable with the following command:\n```tsvm generated_IR.out```\n\n\nThanks to [mtnrzna](https://github.com/mtnrzna)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatinhosseinianfard%2Fteslang-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatinhosseinianfard%2Fteslang-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatinhosseinianfard%2Fteslang-compiler/lists"}