{"id":19040498,"url":"https://github.com/zakircodearchitect/lexer-","last_synced_at":"2025-06-17T05:33:47.711Z","repository":{"id":261638317,"uuid":"884905049","full_name":"ZakirCodeArchitect/Lexer-","owner":"ZakirCodeArchitect","description":"This project implements a Lexical Analyzer (Lexer) for MiniLang, which tokenizes source code into types like keywords, operators, and literals. It handles errors and skips comments, laying the foundation for a MiniLang compiler.","archived":false,"fork":false,"pushed_at":"2024-11-28T07:46:27.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-04T08:17:49.368Z","etag":null,"topics":["cpp","lexer","lexer-analyzer"],"latest_commit_sha":null,"homepage":"","language":"C++","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/ZakirCodeArchitect.png","metadata":{"files":{"readme":null,"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":"2024-11-07T15:44:23.000Z","updated_at":"2024-11-28T07:46:31.000Z","dependencies_parsed_at":"2025-01-02T07:12:00.576Z","dependency_job_id":"21951c21-bfd3-47a1-a247-c8f4761440c7","html_url":"https://github.com/ZakirCodeArchitect/Lexer-","commit_stats":null,"previous_names":["zakircodearchitect/lexer-"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZakirCodeArchitect/Lexer-","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakirCodeArchitect%2FLexer-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakirCodeArchitect%2FLexer-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakirCodeArchitect%2FLexer-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakirCodeArchitect%2FLexer-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZakirCodeArchitect","download_url":"https://codeload.github.com/ZakirCodeArchitect/Lexer-/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakirCodeArchitect%2FLexer-/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260299255,"owners_count":22988605,"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":["cpp","lexer","lexer-analyzer"],"created_at":"2024-11-08T22:22:57.224Z","updated_at":"2025-06-17T05:33:47.699Z","avatar_url":"https://github.com/ZakirCodeArchitect.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📝 **MiniLang Lexical Analyzer (Lexer)**\n\n\u003e A simple lexical analyzer (lexer) designed to process and tokenize source code written in MiniLang, a hypothetical programming language used for compiler construction coursework. This lexer serves as the first step in building a full compiler for MiniLang.\n\n---\n\n## 🚀 **Project Overview**\n\nMiniLang is a simplified programming language created for educational purposes in compiler construction. The **MiniLang Lexer** is designed to read MiniLang source code, tokenize it, and classify each token into its corresponding type (e.g., keywords, operators, identifiers, literals).\n\n**Key Features:**\n- **Token Classification:** Identifies and classifies tokens such as keywords, operators, identifiers, literals, and delimiters.\n- **Error Handling:** Includes basic error handling for unrecognized tokens and invalid characters.\n- **Comment Skipping:** Skips over single-line comments and excludes them from the token output.\n- **Testing:** Provides sample valid and invalid MiniLang code to test the lexer’s functionality.\n\n---\n\n## 🌟 **MiniLang Features**\n\nMiniLang includes the following types of tokens:\n\n- **Keywords:** `if`, `else`, `while`, `print`, `int`, `float`\n- **Operators:** `+`, `-`, `*`, `/`, `=`, `==`, `!=`, `\u003c`, `\u003e`, `\u003c=`, `\u003e=`\n- **Delimiters:** `(`, `)`, `{`, `}`, `;`, `,`\n- **Identifiers:** Variable names that start with a letter, followed by letters or digits (e.g., `var1`, `total`)\n- **Literals:** Integer literals (e.g., `123`), floating-point literals (e.g., `45.67`), and string literals enclosed in double quotes (e.g., `\"Hello World\"`)\n- **Comments:** Single-line comments starting with `//` (which are ignored during tokenization)\n\n---\n\n## 🔧 **Installation**\n\nTo get started with the project locally, follow these steps:\n\n### 1. Clone the repository:\n\n```bash\ngit clone https://github.com/yourusername/minilang-lexer.git\ncd minilang-lexer\n```\n## 🧑‍💻 **Usage**\n\nTo use the **MiniLang Lexer**, you need to provide it with a MiniLang source code file. The lexer will process the file, classify each token, and output the tokens in the following format:\n\n\nWhere `token_type` represents the type of the token (e.g., `KEYWORD`, `OPERATOR`, `IDENTIFIER`, `LITERAL`, etc.), and `lexeme` is the exact string or value of the token.\n\n### Steps to Run:\n\n1. Compile the project:\n\n```bash\ng++ -o lexer lexer.cpp\n./lexer input.minilang\n\nint x = 10;\nif (x \u003e 5) {\n    print(\"Hello World\");\n}\n\n```\n---\n\n### Key points:\n- **Usage section** includes the commands for compiling and running the lexer.\n- **Sample Output** shows an example of how the lexer outputs tokenized MiniLang code.\n- It clearly explains each part of the output to make it easy for users to understand how their code is processed.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakircodearchitect%2Flexer-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakircodearchitect%2Flexer-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakircodearchitect%2Flexer-/lists"}