Skip to content

Latest commit

 

History

74 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gscp

gscp is a small lexer and parser for the .gsc scripting language used in older Call of Duty games. gscp takes raw .gsc code and turns it into an abstract syntax tree. You can find a small demo input and output file in ./demo.

Projects using gscp

t6t: A code analysis tool for gsc

Installation

Download binary

  1. Go to the releases tab and download one of the gscp binaries

Build from source

#Clone the repo
git clone https://github.com/maxvanasten/gscp
#Build the parser
cd ./gscp/
go build
# OPTIONAL: Move the binary to /usr/bin/ so it can be accessed from anywhere
sudo mv ./gscp /usr/bin/gscp
#Run the parser
./gscp -p input.gsc
# Or if you installed it to /usr/bin:
gscp -p input.gsc

Usage

# Parse GSC file into AST and output the result on STDOUT
gscp -p input_file.gsc
# Generate GSC file from AST JSON
gscp -g input_ast.json

gscp outputs a JSON object on STDOUT containing both the AST and diagnostics. You can format the JSON nicely with jq and bat, for example: gscp -p input.gsc | jq | bat -l json

Documentation

For a detailed walk-through of how gscp works internally, see docs/gscp-internals.md.

Application

gscp can be the backbone for future projects like a gsc language server or doing complex code analysis on the original codebase.

Latest test results

You can find the latest test results here

About

A parser for the .gsc language used in older Call of Duty titles.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages