{"id":18822051,"url":"https://github.com/ore-codes/c-lexical-scanner","last_synced_at":"2025-06-23T06:35:56.746Z","repository":{"id":223569403,"uuid":"760906244","full_name":"ore-codes/c-lexical-scanner","owner":"ore-codes","description":"Simple lexical analyser (scanner) for C-style language compiler.","archived":false,"fork":false,"pushed_at":"2024-02-24T12:18:15.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-22T10:14:50.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/ore-codes.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":"2024-02-20T21:57:10.000Z","updated_at":"2024-02-20T21:58:57.000Z","dependencies_parsed_at":"2024-02-24T12:39:42.200Z","dependency_job_id":null,"html_url":"https://github.com/ore-codes/c-lexical-scanner","commit_stats":null,"previous_names":["quodline/c-lexical-scanner","ore-codes/c-lexical-scanner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ore-codes/c-lexical-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ore-codes%2Fc-lexical-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ore-codes%2Fc-lexical-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ore-codes%2Fc-lexical-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ore-codes%2Fc-lexical-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ore-codes","download_url":"https://codeload.github.com/ore-codes/c-lexical-scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ore-codes%2Fc-lexical-scanner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261430246,"owners_count":23157156,"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":[],"created_at":"2024-11-08T00:47:34.354Z","updated_at":"2025-06-23T06:35:51.727Z","avatar_url":"https://github.com/ore-codes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Simple lexical analyser (scanner) for C-style language compiler.\n\n```\n\"lint\": \"gts lint\",\n\"clean\": \"gts clean\",\n\"compile\": \"tsc\",\n\"fix\": \"gts fix\",\n```\n\n### Input\n```c\n#include \u003cstdio.h\u003e\n\nint main() {\n    int arr[3] = {10, 20, 30}; // Example array of 3 integers\n    int sum = 0;\n    \n    // Loop through the array and calculate the sum\n    for (int i = 0; i \u003c= 2; i++) {\n        sum += arr[i];\n    }\n    \n    // Output the sum\n    printf(\"The sum of the array elements is: %d\\n\", sum);\n    \n    return 0;\n}\n```\n\n### Output\n```js\n{\n  tokens: [\n    { type: 'directive', position: 0, value: '#include \u003cstdio.h\u003e' },\n    { type: 'keyword', position: 20, value: 'int' },\n    { type: 'identifier', position: 24, value: 'main' },\n    { type: 'punctuator', position: 28, value: '(' },\n    { type: 'punctuator', position: 29, value: ')' },\n    { type: 'punctuator', position: 31, value: '{' },\n    { type: 'keyword', position: 37, value: 'int' },\n    { type: 'identifier', position: 41, value: 'arr' },\n    { type: 'punctuator', position: 44, value: '[' },\n    { type: 'constant', position: 45, value: '3' },\n    { type: 'punctuator', position: 46, value: ']' },\n    { type: 'operator', position: 48, value: '=' },\n    { type: 'punctuator', position: 50, value: '{' },\n    { type: 'constant', position: 51, value: '10' },\n    { type: 'operator', position: 53, value: ',' },\n    { type: 'constant', position: 55, value: '20' },\n    { type: 'operator', position: 57, value: ',' },\n    { type: 'constant', position: 59, value: '30' },\n    { type: 'punctuator', position: 61, value: '}' },\n    { type: 'punctuator', position: 62, value: ';' },\n    { type: 'keyword', position: 69, value: 'int' },\n    { type: 'identifier', position: 73, value: 'sum' },\n    { type: 'operator', position: 77, value: '=' },\n    { type: 'constant', position: 79, value: '0' },\n    { type: 'punctuator', position: 80, value: ';' },\n    { type: 'keyword', position: 96, value: 'for' },\n    { type: 'punctuator', position: 100, value: '(' },\n    { type: 'keyword', position: 101, value: 'int' },\n    { type: 'identifier', position: 105, value: 'i' },\n    { type: 'operator', position: 107, value: '=' },\n    { type: 'constant', position: 109, value: '0' },\n    { type: 'punctuator', position: 110, value: ';' },\n    { type: 'identifier', position: 112, value: 'i' },\n    { type: 'operator', position: 114, value: '\u003c=' },\n    { type: 'constant', position: 117, value: '2' },\n    { type: 'punctuator', position: 118, value: ';' },\n    { type: 'identifier', position: 120, value: 'i' },\n    { type: 'operator', position: 121, value: '++' },\n    { type: 'punctuator', position: 123, value: ')' },\n    { type: 'punctuator', position: 125, value: '{' },\n    { type: 'identifier', position: 135, value: 'sum' },\n    { type: 'operator', position: 139, value: '+=' },\n    { type: 'identifier', position: 142, value: 'arr' },\n    { type: 'punctuator', position: 145, value: '[' },\n    { type: 'identifier', position: 146, value: 'i' },\n    { type: 'punctuator', position: 147, value: ']' },\n    { type: 'punctuator', position: 148, value: ';' },\n    { type: 'punctuator', position: 154, value: '}' },\n    { type: 'identifier', position: 170, value: 'printf' },\n    { type: 'punctuator', position: 176, value: '(' },\n    {\n      type: 'literal',\n      position: 177,\n      value: '\"The sum of the array elements is: %d\\\\n\"'\n    },\n    { type: 'operator', position: 217, value: ',' },\n    { type: 'identifier', position: 219, value: 'sum' },\n    { type: 'punctuator', position: 222, value: ')' },\n    { type: 'punctuator', position: 223, value: ';' },\n    { type: 'keyword', position: 234, value: 'return' },\n    { type: 'constant', position: 241, value: '0' },\n    { type: 'punctuator', position: 242, value: ';' },\n    { type: 'punctuator', position: 244, value: '}' }\n  ],\n    tokenCount: 59\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fore-codes%2Fc-lexical-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fore-codes%2Fc-lexical-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fore-codes%2Fc-lexical-scanner/lists"}