{"id":22974010,"url":"https://github.com/ya2ir/c_lexer","last_synced_at":"2025-08-23T11:08:42.181Z","repository":{"id":252164619,"uuid":"839611984","full_name":"YA2IR/C_lexer","owner":"YA2IR","description":"C Lexer","archived":false,"fork":false,"pushed_at":"2024-10-15T14:45:39.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T11:03:59.980Z","etag":null,"topics":["c","lexer","lexical-analysis","lexical-analyzer","tokenization","tokenizer"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YA2IR.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,"zenodo":null}},"created_at":"2024-08-08T01:17:07.000Z","updated_at":"2025-06-12T01:59:32.000Z","dependencies_parsed_at":"2025-08-13T14:33:48.365Z","dependency_job_id":"ea60ecbf-86c2-404c-aaae-4a089bf37e1b","html_url":"https://github.com/YA2IR/C_lexer","commit_stats":null,"previous_names":["ya2ir/c_lexer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YA2IR/C_lexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YA2IR%2FC_lexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YA2IR%2FC_lexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YA2IR%2FC_lexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YA2IR%2FC_lexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YA2IR","download_url":"https://codeload.github.com/YA2IR/C_lexer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YA2IR%2FC_lexer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746755,"owners_count":24813580,"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-08-23T02:00:09.327Z","response_time":69,"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":["c","lexer","lexical-analysis","lexical-analyzer","tokenization","tokenizer"],"created_at":"2024-12-14T23:59:51.512Z","updated_at":"2025-08-23T11:08:42.139Z","avatar_url":"https://github.com/YA2IR.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nThis is a lexer/tokenizer for the C programming language. It takes a C file as an input and produces the following (literal, token_type) pairs as output:\n```\n// example1.c:\n    int x = 1.f*0xAB;\n// gcc lexer/lexer.c main.c \u0026\u0026 ./a.out example1.c:\n    == ('int','INT')\n    == ('x','IDENT')\n    == ('=','ASSIGN')\n    == ('1.f','NUM')\n    == ('*','STAR')\n    == ('0xAB','NUM')\n    == (';','SEMICOLON')\n    == --END-- ==\n```\n\nFor a full example, you can run it on example.c -an actual file-:\n```\ngcc main.c lexer/lexer.c \u0026\u0026 ./a.out example.c\n```\n\n# Limitations\n- The lexer supports most but not all of the language. For example, it doesn't support the scientific notation \"123.45e-6\" yet, and I might have missed things like supporting suffixes in hexadecimal literals (i.e. \"0xA(L)\" is not allowed)\n- There is only one token type that represents numbers \"NUM\"\n- It doesn't support directives that are handled by the preprocessor (e.g. #define and #include)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fya2ir%2Fc_lexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fya2ir%2Fc_lexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fya2ir%2Fc_lexer/lists"}