{"id":25171595,"url":"https://github.com/basemax/go-lexer-token-simple","last_synced_at":"2026-07-16T16:35:25.983Z","repository":{"id":57572615,"uuid":"350094698","full_name":"BaseMax/go-lexer-token-simple","owner":"BaseMax","description":"Simple Go lexer: Lex own syntax and read it's from file.","archived":false,"fork":false,"pushed_at":"2021-03-21T19:49:03.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-03T23:38:19.038Z","etag":null,"topics":["go","golang","lexer","lexer-analyzer","lexer-example","lexers","scanner","token","tokenization","tokenize","tokenizer","tokens"],"latest_commit_sha":null,"homepage":"","language":"Go","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/BaseMax.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}},"created_at":"2021-03-21T19:12:38.000Z","updated_at":"2023-10-13T08:37:39.000Z","dependencies_parsed_at":"2022-08-24T08:41:01.556Z","dependency_job_id":null,"html_url":"https://github.com/BaseMax/go-lexer-token-simple","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/go-lexer-token-simple","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fgo-lexer-token-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fgo-lexer-token-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fgo-lexer-token-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fgo-lexer-token-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/go-lexer-token-simple/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fgo-lexer-token-simple/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278621846,"owners_count":26017253,"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-10-06T02:00:05.630Z","response_time":65,"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","lexer","lexer-analyzer","lexer-example","lexers","scanner","token","tokenization","tokenize","tokenizer","tokens"],"created_at":"2025-02-09T09:21:16.195Z","updated_at":"2025-10-06T13:39:58.110Z","avatar_url":"https://github.com/BaseMax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mylex: go-lexer-token-simple\n\nSimple Go lexer: Lex own syntax and read it's from file.\n\n## Features\n\n- Tokenizer\n- Position analyzer (line and offset)\n- Ident\n- Int\n- Comments # ...\n- Operators (+ - * / =)\n\n## Example / Syntax\n\n```\n# Max Base\n# simple lexer written in GoLang\n# 2021-03-21\n\nint main() {\n\ta = 5;\n\tb = a + 6;\n\tc + 123;\n\t5+12;\n\tret c;\n}\n```\n\n## Using\n\n```bash\ngit clone https://github.com/BaseMax/go-lexer-token-simple\ncd go-lexer-token-simple\ngo build\n./go-lexer-token-simple\n```\n\nor using go get:\n\n```bash\ngo get github.com/BaseMax/go-lexer-token-simple\ncd /path/to/go-lexer-token-simple\ngo build\n./go-lexer-token-simple\n```\n\n## Output\n\n```\n5:1\tIDENT\tint\n5:5\tIDENT\tmain\n5:9\t(\t\n5:10\t)\t\n5:12\t{\t\n6:2\tIDENT\ta\n6:4\t=\t\n6:6\tINT\t5\n6:7\t;\t\n7:2\tIDENT\tb\n7:4\t=\t\n7:6\tIDENT\ta\n7:8\t+\t\n7:10\tINT\t6\n7:11\t;\t\n8:2\tIDENT\tc\n8:4\t+\t\n8:6\tINT\t123\n8:9\t;\t\n9:2\tINT\t5\n9:3\t+\t\n9:4\tINT\t12\n9:6\t;\t\n10:2\tRET\t\n10:6\tIDENT\tc\n10:7\t;\t\n11:1\t}\t\n```\n\n## TODO\n\n- Support \\r\\n\n- Support floating numbers\n\n## My references\n\n- How `UnreadRune` works? https://golang.org/pkg/bufio/#Reader.UnreadRune\n- Anko: a perfect go-script language made with Go: https://github.com/mattn/anko\n- Lark: a old but funny lexer-interpreter made with Java: https://github.com/munificent/lark/blob/master/src/com/stuffwithstuff/lark/Lexer.java\n- How `iota` works in golang? https://yourbasic.org/golang/iota/\n- How write a simple go lexer? https://aaronraff.dev/writing-a-lexer-in-go\n- Why use `iota` in golang? https://medium.com/swlh/iota-create-effective-constants-in-golang-b399f94aac31\n\n© Copyright Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fgo-lexer-token-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fgo-lexer-token-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fgo-lexer-token-simple/lists"}