{"id":34568038,"url":"https://github.com/flowdev/semtool","last_synced_at":"2025-12-24T09:12:23.662Z","repository":{"id":310204425,"uuid":"1039062208","full_name":"flowdev/semtool","owner":"flowdev","description":"Tool for semantic actions on any language or file format driven by PEG grammars.","archived":false,"fork":false,"pushed_at":"2025-09-09T19:09:34.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T23:06:18.754Z","etag":null,"topics":[],"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/flowdev.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-16T11:56:34.000Z","updated_at":"2025-09-09T19:09:37.000Z","dependencies_parsed_at":"2025-08-16T14:27:34.098Z","dependency_job_id":"199fc50e-4c99-44b5-a679-1c41007334f2","html_url":"https://github.com/flowdev/semtool","commit_stats":null,"previous_names":["flowdev/semtool"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flowdev/semtool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowdev%2Fsemtool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowdev%2Fsemtool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowdev%2Fsemtool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowdev%2Fsemtool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowdev","download_url":"https://codeload.github.com/flowdev/semtool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowdev%2Fsemtool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27999522,"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-12-24T02:00:07.193Z","response_time":83,"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":[],"created_at":"2025-12-24T09:12:20.807Z","updated_at":"2025-12-24T09:12:23.644Z","avatar_url":"https://github.com/flowdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# semtool\nTool for semantic actions on any language or file format driven by PEG grammars.\n\n## TODOs\n\n1. Get search file definition for SemGrep/OpenGrep.\n1. Define a set of keywords/rules.\n1. Implement parser for search files with **comb**.\n1. Refine own PEG grammar parser.\n1. Implement AST comparison.\n1. Implement repacements with Go text templates.\n\n## Own Syntax\n\n- `=` is used for rule assignment.\n- `/` is used for alternatives (`FirstSuccessful`).\n- Separating multiple rules with space is used for sequences (`Sequence`).\n- `*` and `+` are used for repetitions (`Many0` and `Many1`).\n- `,*` and `,+` are used for lists (`Separated0` and `Separated1`) withOUT parsing a separator at the end.\n- `;*` and `;+` are used for lists (`Separated0` and `Separated1`) WITH optional parsing of a separator at the end.\n- `?` is used for optional parsers (`Optional`).\n- `-\u003e` is used for parsing until another parser matches (`Until`).\n- `.` is used for any character or byte in case of a binary parser (either `AnyChar` or `AnyByte`).\n- `'` and `\"` are used for string literals.\n- `(` and `)` are used for grouping.\n- `!` is used for negative lookahead.\n- `\u0026` is used for positive lookahead.\n- `[` and `]` are used for character classes.\n- In string literals ANSI escape sequences are supported and so are\n  `\\377`, `\\xabcdef` and `\\u00abcdef` for octal, hex and Unicode.\n- Comments start with `#` and continue to the end of the line.\n- Whitespace is ignored.\n\n### Predifined rules\n\n- `EOF` parses the end of the input.\n- `EOL` parses the end of a line (`'\\r\\n', `'\\n'` or `'\\r``).\n- `FLOAT` parses a floating point number (without a sign).\n- `INTEGER` parses an integer number (without a sign).\n- `SPACE` parses any amount of Unicode whitespace (including none).\n- `MUST_SPACE` parses Unicode whitespace (at least one character).\n- `NAME` parses a name (a Unicode letter followed by zero or more Unicode letters, Unicode digits or underscores).\n\n### Predefined character classes\n\n- `ALPHA` parses a Unicode letter.\n- `DIGIT` parses a Unicode digit or number.\n- `WORDO` is `ALPHA` and `DIGIT` plus `_` combined into a single class.\n\nThe names of these character classes are deliberately chosen to contain a double vowel.\nSo they aren't reasonable character classes\n(for example `[WORD]` is a reasonable character class but `[WORDO]` isn't).\n\n### Rules a user has to define\n\n- `GRAMMAR` is the root rule of a grammar.\n- `VARIABLE` parses a variable name (e.g. `'$' NAME`) in code snippets for searching or replacing.\n  A variable can stand for any syntactically valid subtree of the current parse tree (AST).\n- `PLACEHOLDER` parses a placeholder (e.g. `'_'` or `'$PLACEHOLDER'`) in code snippets for searching.\n  Like a variable, a placeholder can stand for any syntactically valid subtree of the current parse tree (AST).\n  But a placeholder can't be referenced later. So it can't be used in replacements.\n- `BINARY` is more a variable than a rule. It can only be set to `true` or `false`.\n  `false` is the default value. So it can be omitted.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowdev%2Fsemtool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowdev%2Fsemtool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowdev%2Fsemtool/lists"}