Giter Club home page Giter Club logo

ascc's Introduction

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

ascc's People

Contributors

rofl0r avatar ivan-mogilko avatar ericoporto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.