{"id":22234368,"url":"https://github.com/furqansoftware/scanlib","last_synced_at":"2025-08-09T10:14:38.976Z","repository":{"id":64715490,"uuid":"338563188","full_name":"FurqanSoftware/scanlib","owner":"FurqanSoftware","description":"Input validator and code generator","archived":false,"fork":false,"pushed_at":"2024-01-05T16:38:31.000Z","size":518,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-27T21:45:06.404Z","etag":null,"topics":["go","golang","toph"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FurqanSoftware.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":"2021-02-13T11:51:14.000Z","updated_at":"2022-09-07T07:47:38.000Z","dependencies_parsed_at":"2025-07-27T21:32:40.802Z","dependency_job_id":"fcebbc7d-f8f0-4893-9c93-6d4114f65216","html_url":"https://github.com/FurqanSoftware/scanlib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FurqanSoftware/scanlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FurqanSoftware%2Fscanlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FurqanSoftware%2Fscanlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FurqanSoftware%2Fscanlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FurqanSoftware%2Fscanlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FurqanSoftware","download_url":"https://codeload.github.com/FurqanSoftware/scanlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FurqanSoftware%2Fscanlib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269563261,"owners_count":24438721,"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-09T02:00:10.424Z","response_time":111,"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":["go","golang","toph"],"created_at":"2024-12-03T02:08:14.988Z","updated_at":"2025-08-09T10:14:38.890Z","avatar_url":"https://github.com/FurqanSoftware.png","language":"Go","readme":"# Scanlib\n\nUse Scanspec Validate input files and generate input code in different programming languages.\n\n## Scanspec\n\nLearn more about Scanspec [here](https://help.toph.co/drafts/scanspec).\n\n### Examples\n\n#### Two Integers\n\n```\n3 2\n```\n\n```\nvar A, B int\nscan A, B\ncheck A \u003e= 0, A \u003c 10, B \u003e= 0, B \u003c 20\neol\neof\n```\n\n``` cpp\n// Generated using Scanlib\n\n#include \u003ciostream\u003e\n\nusing namespace std;\n\nint main() {\n\tint A, B;\n\tcin \u003e\u003e A;\n\tcin \u003e\u003e B;\n\t\n\treturn 0;\n}\n```\n\n``` py\n# Generated using Scanlib\n\nA, B = map(int, input().split())\n```\n\n#### R, C, and Grid\n\n```\n3 5\n**...\n..*..\n....*\n```\n\n```\nvar R, C int\nscan R, C\ncheck R \u003e= 1, R \u003c 25, C \u003e= 1, C \u003c 25\neol\nvar G [R]string\nfor i := 0 ... R\n\tscan G[i]\n\tcheck len(G[i]) == C\n\tcheck re(G[i], \"^[*.]+$\")\n\teol\nend\neof\n```\n\n``` cpp\n// Generated using Scanlib\n\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n\nusing namespace std;\n\nint main() {\n\tint R, C;\n\tcin \u003e\u003e R;\n\tcin \u003e\u003e C;\n\tstring G[R];\n\tfor (int i = 0; i \u003c R; ++i) {\n\t\tcin \u003e\u003e G[i];\n\t}\n\t\n\treturn 0;\n}\n```\n\n``` py\n# Generated using Scanlib\n\nR, C = map(int, input().split())\nG = [\"\"] * R\nfor i in range(0, R):\n\tG[i] = input()\n```\n\n### Specification\n\n#### Comments\n\nA comment begins with the # character, and ends at the end of the line. A comment cannot begin within a string literal.\n\n```\n# This is a comment\n```\n\n#### Keywords\n\n```\ncheck eof eol for scan var\n```\n\n#### Types\n\n```\nbool\nint\nint64\nfloat32\nfloat64\nstring\n[]T\n```\n\n#### Check Statements\n\n```\ncheck n \u003e 0, n \u003c 1000\ncheck e \u003e 0, f \u003c 5.0\n```\n\n#### Variable Declarations\n\n```\nvar n int\nvar e, f float64\nvar a, b string\nvar G [R]string\n```\n\n#### Scan Statements\n\n```\nscan n\nscan a, e\nscan e, f, n\nscan G[2]\n```\n\n#### If Statements\n\n```\nif q == 1\n\tscan i, G[i]\nelse if q == 2\n\tscan a\nelse if q == 3\n\tscan l, h\nelse\n\tscan G[q]\nend\n```\n\n#### For Range Statements\n\n```\nfor i := 0 ... n\n\tscan G[i]\nend\n```\n\n#### For Scan/Scanln Statements\n\n```\nvar s string\nvar i int\nfor scan s, i\n\t# Scans s and i repeatedly until EOF\nend\n```\n\n```\nvar s string\nfor scanln s\n\t# Scans line to s repeatedly until EOF\nend\n```\n\n#### EOL Statements\n\nThe following indicates end of line.\n\n```\neol\n```\n#### EOL Statements\n\nThe following indicates end of file.\n\n```\neof\n```\n\n#### Built-in Functions\n\n```\nlen(a): Returns the length of array a.\nre(s, x): Returns true if string s matches regular expression x.\npow(n, e): Returns n raised to the power of e. Result is int or int64 if both n and e are int or int64, otherwise float64.\ntoInt64(s, b=10): Parses string s in base b and returns in int64.\n```\n\n## TODO\n\n- [x] If Statements\n- [ ] C Generator\n- [x] Go Generator\n- [ ] Graph Checks\n- [ ] CLI Tool\n- and more...","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurqansoftware%2Fscanlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffurqansoftware%2Fscanlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffurqansoftware%2Fscanlib/lists"}