Skip to content

A program that contains grammars and functionality to remove server only code from code bases.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

EmbarkStudios/server-code-exciser

🈹 Server Code Exciser



ci

An antl4r based program that can automatically remove server only code from Unreal projects using Angelscript (https://angelscript.hazelight.se/)

Thanks to Tom van Dijck for initiating this project and suggesting to use Antl4r as the base!

Setup

I would strongly recommend using VSCode as that will give you the visual antl4r debugger. You need these extensions:

  • ANTLR4 grammar syntax support
  • C#

Then, you should just have to open the Grammar/AngelscriptParser.g4 file and save it once to generate all the antl4r stuff.

Launch Settings

Since the launch targets include local paths, I don't think it makes sense to have these checked in in project scope, so I'll just put some launch config templates here instead! <3 You will have to put your own arguments in there of course :) These configs will excise a full script folder and visually debug one AS file, respectively!

{
	// Use IntelliSense to learn about possible attributes.
	// Hover to view descriptions of existing attributes.
	// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Excise Server Angelscript",
			"type": "coreclr",
			"request": "launch",
			"preLaunchTask": "build",
			"program": "${workspaceFolder}/ServerCodeExciser/bin/Debug/net5.0/ServerCodeExciser.exe",
			"args": ["C:/Projects/MyProject/Script"],
			"cwd": "${workspaceFolder}/ServerCodeExciser",
			"console": "internalConsole",
			"stopAtEntry": false
		},
		{
			"name": "Debug Angelscript Grammar For Input",
			"type": "antlr-debug",
			"request": "launch",
			"preLaunchTask": "build",
			"grammar": "${workspaceFolder}/UnrealAngelscriptParser/Grammar/UnrealAngelscriptParser.g4",
			"input": "C:/Projects/MyProject/Script/Foo.as",
			"printParseTree": true,
			"visualParseTree": true
		}
	]
}

I usually try running the full parser target to see which files are breaking. Then I point the grammar target to that file and run it. After you see the errors, you can then start removing code from the file until only the thing that causes the error is left, and then start tweaking the grammar to fix it! Happy antlering!

Embark

Contribution

Contributor Covenant

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started. Please also read our Contributor Terms before you make any contributions.

Any contribution intentionally submitted for inclusion in an Embark Studios project, shall comply with the Rust standard licensing model (MIT OR Apache 2.0) and therefore be dual licensed as described below, without any additional terms or conditions:

License

This contribution is dual licensed under EITHER OF

at your option.

For clarity, "your" refers to Embark or any other licensee/user of the contribution.

About

A program that contains grammars and functionality to remove server only code from code bases.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •