{"id":16989932,"url":"https://github.com/x39/xcg","last_synced_at":"2026-05-07T07:39:39.929Z","repository":{"id":53443948,"uuid":"142948267","full_name":"X39/XCG","owner":"X39","description":"X39s Code Generator - Creating your CST (Concrete-Syntax-Tree) with ease","archived":false,"fork":false,"pushed_at":"2024-06-20T21:53:51.000Z","size":642,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"rewrite","last_synced_at":"2025-02-04T15:47:14.178Z","etag":null,"topics":["code-generation","code-generator","cpp","cst","generator","parser","parser-generator","syntax-tree"],"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/X39.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2018-07-31T01:50:51.000Z","updated_at":"2024-06-19T07:11:12.000Z","dependencies_parsed_at":"2024-06-07T15:46:07.936Z","dependency_job_id":"6f0c54d7-c6d3-4e0b-9778-53a80d67956a","html_url":"https://github.com/X39/XCG","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X39%2FXCG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X39%2FXCG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X39%2FXCG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/X39%2FXCG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/X39","download_url":"https://codeload.github.com/X39/XCG/tar.gz/refs/heads/rewrite","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239877126,"owners_count":19712020,"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":["code-generation","code-generator","cpp","cst","generator","parser","parser-generator","syntax-tree"],"created_at":"2024-10-14T03:08:28.874Z","updated_at":"2026-03-08T02:30:19.025Z","avatar_url":"https://github.com/X39.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How it looks\n\n```\ntoken integer\n    require plus { 0-9 }\n\ntoken scalar\n    require once { integer }\n    require once .\n    require once { integer }\n\ntoken roundO: \"(\"\n    require once (\n    \ntoken roundC: \")\"\n    require once )\n    \ntoken slash: \"/\"\n    require once /\n    \ntoken star: \"*\"\n    require once *\n    \ntoken plus: \"+\"\n    require once +\n    \ntoken minus: \"-\"\n    require once -\n\nproduction expC\n    alternatives\n        match \"(\" @[value]expA \")\"\n        match @[value]scalar\n        match @[value]integer\n\nleft-recursive expB\n\tmatch @[left]expB \"/\" @[right]expC\n\t\tset capture op '/'\n\tmatch @[left]expB \"*\" @[right]expC\n\t\tset capture op '*'\n\tmatch @[left]expC\n\nleft-recursive expA\n\tmatch @[left]expA \"+\" @[right]expB\n\t\tset capture op '+'\n\tmatch @[left]expA \"-\" @[right]expB\n\t\tset capture op '-'\n\tmatch @[left]expB\n\nproduction main\n    match @[root]expA\n```\n\n# Using XCG\n`xcg -i .\\input.xcg -g cpp -o output --options -s namespace:xcg::parser`\n```\n  -i PATH ..., --input=PATH ...                  Required. Declares a single input xcg file.\n\n  -g GENERATOR, --generator=GENERATOR            Required. Sets the generator to use. Might be a path to a file or one of the build-in ones.\n\n  -o PATH, --output=PATH                         (Default: output) Set the output filepath to where the generated file(s) should be generated to.\n\n  -s OPTION:VALUE ..., --set=OPTION:VALUE ...    Allows to change generator-dependant settings.\n\n  --options                                      Lists all options of a given generator.\n\n  -d, --dry-run                                  Will not generate any output files if set.\n\n  --help                                         Display this help screen.\n\n  --version                                      Display version information.\n```\n\n# Available generators\n\n- `cpp`\n\n# FAQ\n\n## Why .Net Core\nAnswering this question is quite simple:\n\nI chose .net core because the whole project started out as a draft of ideas\nand it was clear that i needed a solid string type which is easy to work with,\nsome no-f-given memory management (aka garbage collection) because generating a parser is hard enough\nso making a tree structure should not take as much time as building the parser\nplus it allows fast prototyping with checked typing.\n\nThe project itself was needed because writing the parser i desired myself\nfailed multiple times due to basic mistakes i did that would\nrequire changing the whole syntax file because i only noticed in the end\n(yes, i know about bison ... but bison + ambiguous grammar = nono).\nThis project allowed me to toy around with those ideas, make\nthings work fast and so on.\n\nThe ***TL;DR*** thus is probably ... because i can","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx39%2Fxcg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx39%2Fxcg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx39%2Fxcg/lists"}