{"id":19916026,"url":"https://github.com/szhu/parsely","last_synced_at":"2026-05-13T17:36:05.358Z","repository":{"id":22717672,"uuid":"26062083","full_name":"szhu/parsely","owner":"szhu","description":"inputs should be easy to understand","archived":false,"fork":false,"pushed_at":"2014-11-19T21:13:23.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T23:26:08.769Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/szhu.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}},"created_at":"2014-11-01T20:18:35.000Z","updated_at":"2023-09-08T16:51:50.000Z","dependencies_parsed_at":"2022-07-15T00:30:44.136Z","dependency_job_id":null,"html_url":"https://github.com/szhu/parsely","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhu%2Fparsely","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhu%2Fparsely/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhu%2Fparsely/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szhu%2Fparsely/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szhu","download_url":"https://codeload.github.com/szhu/parsely/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241344393,"owners_count":19947547,"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-12T21:43:17.199Z","updated_at":"2025-11-23T19:05:41.453Z","avatar_url":"https://github.com/szhu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"parsely\n=======\n\n![](https://cloud.githubusercontent.com/assets/1570168/4874405/d33421a4-6253-11e4-9cad-288253249949.png)\n\nParsely helps you tokenize and parse simple space-delimited files. For example, Parsely can print this tokenized version of a simple Makefile.\n\n```\n1: test:\n1:       test_parsely\n3: test_parsely:\n3:               test_parsely.cpp\n4:  g++\n4:      $\u003c\n4:         -o\n4:            $@\n6: clean:\n7:  rm\n7:     test_parsely\n9: .PHONY:\n9:         test\n9:              clean\n```\n\nHere's the minimal amount of code you need to start using Parsely:\n\n```c++\n#import \"parsely.hpp\"\n\nparsely::FileParser parser(filename);\nwhile (parser.advance_line()) {\n  while (parser.next_token()) {\n    do_something_with(parser.token);\n  }\n}\n```\n\nParsely also helps you inform the user of incorrectly formatted files. Use `parser.here()` to print out the current token in context:\n\n```\nOh no! An error occurred at parsely.cpp:103:38: (additional info can go here)\n  oss \u003c\u003c line_string \u003c\u003c std::endl \u003c\u003c zfill_to_colno() \u003c\u003c '^' \u003c\u003c underline_token() \u003c\u003c std::endl;\n                                     ^~~~~~~~~~~~~~~~\n```\n\nUse `require_next_token` methods to try to parse as the given data type and exit with an error if the next token doesn't match. Here's an example using `parser.require_next_token_positive(float)`:\n\n```\nerror: expected a positive number at in/scene1.txt:4:25\n                ltp 200 200 200 0.6 0.6 -0.6\n                                        ^~~~\n```\n\nThere's not much documentation right now, but there's a test program\nthat might help explain things. To run it, `make` and then `./test_parsely some_file`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszhu%2Fparsely","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszhu%2Fparsely","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszhu%2Fparsely/lists"}