{"id":16266833,"url":"https://github.com/rameshvarun/galaxy-parser","last_synced_at":"2025-04-08T14:53:28.192Z","repository":{"id":70661657,"uuid":"45837336","full_name":"rameshvarun/galaxy-parser","owner":"rameshvarun","description":"A parser for StarCraft 2's Galaxy scripting language, written in JavaScript using parser combinators.","archived":false,"fork":false,"pushed_at":"2024-08-12T04:47:28.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T01:35:47.645Z","etag":null,"topics":["parser","parser-combinator","starcraft2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/rameshvarun.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}},"created_at":"2015-11-09T12:44:02.000Z","updated_at":"2024-08-12T04:47:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b52ad79-a967-45e4-8f24-6eba3a5f113d","html_url":"https://github.com/rameshvarun/galaxy-parser","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/rameshvarun%2Fgalaxy-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameshvarun%2Fgalaxy-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameshvarun%2Fgalaxy-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameshvarun%2Fgalaxy-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rameshvarun","download_url":"https://codeload.github.com/rameshvarun/galaxy-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247866138,"owners_count":21009239,"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":["parser","parser-combinator","starcraft2"],"created_at":"2024-10-10T17:43:10.545Z","updated_at":"2025-04-08T14:53:28.172Z","avatar_url":"https://github.com/rameshvarun.png","language":"JavaScript","readme":"# StarCraft 2 Galaxy Parser\n\n[![Node.js CI](https://github.com/rameshvarun/galaxy-parser/actions/workflows/node.js.yml/badge.svg)](https://github.com/rameshvarun/galaxy-parser/actions/workflows/node.js.yml)\n[![npm](https://img.shields.io/npm/v/sc2-galaxy-parser)](https://www.npmjs.com/package/sc2-galaxy-parser)\n\n## Usage\n\n```javascript\nconst parse = require(\"sc2-galaxy-parser\");\nconst ast = parse(`void Main(int argc, string[100] argv) {\n  ConsoleLog(\"Galaxy Test...\");\n}`);\nconsole.log(ast);\n```\n\n## Notes\n### Extended Backus–Naur Form Grammar\n```\n\u003cprogram\u003e ::= {\u003ctoplevel-declaration\u003e}\n\u003ctoplevel-declaration\u003e ::= \u003cstruct-declaration\u003e\n  | \u003cglobal-declaration\u003e\n  | \u003ctype-def\u003e\n  | \u003cfunction-declaration\u003e\n  | \u003cfunction-prototype\u003e\n  | \u003cnative-declaration\u003e\n\n\u003cglobal-declaration\u003e ::= [\"static\"] [\"const\"] \u003cvariable-declaration\u003e \";\"\n\u003cvariable-declaration\u003e ::= \u003ctype-specifier\u003e \u003cidentifier\u003e []\n\n\u003cstruct-declaration\u003e ::= \"struct\" \"{\" {\u003cstruct-field\u003e} \"}\"\n\u003cstruct-field\u003e ::= \u003ctype-specifier\u003e \u003cidentifier\u003e  \";\"\n\n\u003cfunction-prototype\u003e ::= [\"static\"] \u003ctype-specifier\u003e \u003cidentifier\u003e \"(\" \")\" \";\"\n\n\u003cfunction-declaration\u003e ::= [\"static\"] \u003ctype-specifier\u003e \u003cidentifier\u003e \"(\" \")\" \"{\" \u003cfunction-body\u003e \"}\"\n\n\u003ctype-specifier\u003e ::= \u003cidentifier\u003e\n  | \u003ctype-specifier\u003e \"[\" \u003cinteger-literal\u003e \"]\"\n  | \u003cidentifier\u003e \"\u003c\" \u003cidentifier\u003e \"\u003e\"\n\n\u003ctype-def\u003e ::= \"typedef\" \u003ctype-specifier\u003e \u003cidentifier\u003e \";\"\n\u003cinclude-path\u003e ::= \"import\" \u003cstring-literal\u003e [\";\"]\n\n\u003cfunction-body\u003e ::= {\u003cvariable-declaration\u003e \";\"}\n\n\u003cstatement\u003e ::= \u003cexpression\u003e\n  | \u003cidentifier\u003e \u003cassign-op\u003e \u003cexpression\u003e // TODO: Determine if assignment is a statement or expression.\n  | \"return\" \u003cexpression\u003e\n  | \"continue\"\n  | \"break\"\n\n\u003cexpression\u003e ::= \u003cexpression\u003e \u003cbin-op\u003e \u003cexpression\u003e // Binary operator.\n  | \u003cunary-op\u003e \u003cexpression\u003e // Unary operator.\n  | \u003cidentifier\u003e \"[\" \"]\" // Array indexing.\n  | \u003cidentifier\u003e \"(\" [\u003cexpresion_list\u003e] \")\" // Function call.\n  | \u003cidentifier\u003e // Scope lookup.\n  | \u003cstring-literal\u003e // String literal.\n\n\u003cexpresion_list\u003e ::= {\u003cexpresion\u003e \",\"} \u003cexpresion\u003e\n\n\u003cbin-op\u003e ::= \"+\" | \"-\" | \"*\" | \"/\" | \"%\" | \"\u0026\"\n  | \"|\" | \"^\" | \"\u003c\u003c\" | \"\u003e\u003e\" | \"\u0026\u0026\" | \"||\" | \"==\"\n  | \"!=\" | \"\u003c\" | \"\u003c=\" | \"\u003e=\" | \"\u003e\"\n\n\u003cunary-op\u003e ::= \"+\" | \"-\" | \"~\" | \"!\"\n\n\u003cassign-op\u003e ::= \"=\" | \"+=\" | \"-=\" | \"*=\" | \"/=\"\n  | \"%=\" | \"\u0026=\" | \"|=\" | \"^=\" | \"\u003c\u003c=\" | \"\u003e\u003e=\"\n```\n## Links\n- [Galaxy Parser in Haskell (Using Parser Combinators)](https://github.com/phyrex1an/galaxy-parser)\n- [Galaxy Language Overview](http://www.sc2mapster.com/wiki/galaxy/script/language-overview/)\n- [Galaxy Operators](http://deaod.de/GalaxyOperators.txt)\n- [Galaxy Types](http://deaod.de/GalaxyTypes.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameshvarun%2Fgalaxy-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frameshvarun%2Fgalaxy-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameshvarun%2Fgalaxy-parser/lists"}