https://github.com/rofl0r/ascc
standalone AGS script compiler
https://github.com/rofl0r/ascc
Last synced: 12 months ago
JSON representation
standalone AGS script compiler
- Host: GitHub
- URL: https://github.com/rofl0r/ascc
- Owner: rofl0r
- License: other
- Created: 2019-12-09T01:21:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-13T13:16:02.000Z (over 1 year ago)
- Last Synced: 2025-06-02T14:17:02.912Z (about 1 year ago)
- Language: C++
- Size: 392 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
ascc - standalone AGS script compiler
-------------------------------------
about
-----
script compiler factored out from AGS ags3 branch[0], and equipped with a
C-compiler-like command line frontend.
the preprocessor which was long ago ripped off the original C++ code and turned
into C#-windows-only code has been restored from old git history of around 2012.
therefore it's possible that the preprocessor behaves slightly different than
the one shipping with the GUI.
current status:
`ascc` can be used to compile .asc files into binary .o files.
these in turn can be used with agsutils[1] agsdisas disassembler and
agsinject utilities for updating ags' binary .crm or .dat files.
(read agsutils README for more details).
as a bonus over the standard compiler embedded in the AGS editor software,
this version has been enhanced with the following features:
- ability to run different preprocessor (like C preprocessor with support
for #include, function-like macros, etc.
- support for C-style char* pointers. this allows one to write fast
low-level code for agssim, or even for ags games, circumventing the
"managed" OOP bloat.
(currently, such pointers need to be dereferenced with [] operator).
build
-----
install a C++ toolchain, then run
make -jN
where N corresponds to the number of CPU cores in your machine.
buildtime should be roughly 10 secs with one core.
usage
-----
ascc [OPTIONS] FILE.asc
compiles FILE.asc to FILE.o
OPTIONS:
-i systemheaderdir : provide path to system headers
this is the path containing implicitly included headers (atm only agsdefns.sh).
-H 1.ash[:2.ash...] : colon-separated list of headers to include.
order matters. AGS editor automatically includes all headers
it finds in the game dir, but here you need to specify them.
-o filename : explicitily specify output file name
-P preprocessor : use `preprocessor` on files before running the built-in
one on them. example: -P "cpp -P". note that you if you use a
standard C preprocessor, linenumber directives need to be supressed
as in the example cpp command.
-D macro[=val] : define preprocessor macro
-E : run preprocessor only (create file with .i extension)
-W : warn about non-fatal errors parsing system headers
-g : turn on debug info
-S : write textual assembly instead of binary (requires agsdisas)
---
[0]: base commit: c38b937273f21ec6002cde1dec9b1bead5f7833c.
[1]: https://github.com/rofl0r/agsutils