{"id":29251737,"url":"https://github.com/macrat/simplexer","last_synced_at":"2025-07-04T01:08:18.089Z","repository":{"id":57524933,"uuid":"116154471","full_name":"macrat/simplexer","owner":"macrat","description":"A simple lexical analyzer for Go","archived":false,"fork":false,"pushed_at":"2018-01-10T13:17:29.000Z","size":34,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-07-27T22:20:04.906Z","etag":null,"topics":["golang-library","lexical-analyzer"],"latest_commit_sha":null,"homepage":null,"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/macrat.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":"2018-01-03T15:49:24.000Z","updated_at":"2023-02-07T12:30:37.000Z","dependencies_parsed_at":"2022-08-26T02:42:49.991Z","dependency_job_id":null,"html_url":"https://github.com/macrat/simplexer","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/macrat/simplexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fsimplexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fsimplexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fsimplexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fsimplexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macrat","download_url":"https://codeload.github.com/macrat/simplexer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macrat%2Fsimplexer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263427316,"owners_count":23464845,"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":["golang-library","lexical-analyzer"],"created_at":"2025-07-04T01:08:17.324Z","updated_at":"2025-07-04T01:08:18.061Z","avatar_url":"https://github.com/macrat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"simplexer\n=========\n\n[![Build Status](https://travis-ci.org/macrat/simplexer.svg?branch=master)](https://travis-ci.org/macrat/simplexer)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/2208d3ac4fbcdcd2b78a/test_coverage)](https://codeclimate.com/github/macrat/simplexer/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/2208d3ac4fbcdcd2b78a/maintainability)](https://codeclimate.com/github/macrat/simplexer/maintainability)\n[![GoDoc](https://godoc.org/github.com/macrat/simplexer?status.svg)](https://godoc.org/github.com/macrat/simplexer)\n\nA simple lexical analyzser for Go.\n\n## example\n### simplest usage\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/macrat/simplexer\"\n)\n\nfunc Example() {\n\tinput := \"hello_world = \\\"hello world\\\"\\nnumber = 1\"\n\tlexer := simplexer.NewLexer(strings.NewReader(input))\n\n\tfmt.Println(input)\n\tfmt.Println(\"==========\")\n\n\tfor {\n\t\ttoken, err := lexer.Scan()\n\t\tif err != nil {\n\t\t\tpanic(err.Error())\n\t\t}\n\t\tif token == nil {\n\t\t\tfmt.Println(\"==========\")\n\t\t\treturn\n\t\t}\n\n\t\tfmt.Printf(\"line %2d, column %2d: %s: %s\\n\",\n\t\t\ttoken.Position.Line,\n\t\t\ttoken.Position.Column,\n\t\t\ttoken.Type,\n\t\t\ttoken.Literal)\n\t}\n}\n```\n\nIt is output as follow.\n\n``` text\nhello_world = \"hello world\"\nnumber = 1\n==========\nline  0, column  0: IDENT: hello_world\nline  0, column 12: OTHER: =\nline  0, column 14: STRING: \"hello world\"\nline  1, column  0: IDENT: number\nline  1, column  7: OTHER: =\nline  1, column  9: NUMBER: 1\n==========\n```\n\n### more examples\nPlease see [godoc](https://godoc.org/github.com/macrat/simplexer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacrat%2Fsimplexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacrat%2Fsimplexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacrat%2Fsimplexer/lists"}