Skip to content

How it works

Konstantin Tomashevich edited this page Jun 17, 2017 · 2 revisions

Startup

  1. ASBindGen loads submodules, such as util functions.
  2. ASBindGen loads bindables.
  3. ASBindGen loads configuration from specified configuration file.

Parse input files

  1. ASBindGen parses all input files, specified in configuration file. Parser uses command-comments, such as //@ASBindGen Function or //@ASBindGen Class. If any parsing error occurred, ASBindGen will exit.
  2. ASBindGen applies binding arguments to bindables.
  3. ASBindGen prints all bindables.

Note: ASBindGen expect that file will be accessable as ${pathPrefix}/${projectDir}/${filePath}, where filePath is specified in files list.

Write bindings

  1. ASBindGen prints list of files, which will be writen.
  2. ASBindGen writes main bindings C++ object, which functions simply call all bindables registrators.
  3. ASBindGen writes main bindings header.
  4. ASBindGen writes bindings headers, for each header it:
    1. Writes includes, which are required by bindables. Replaces //@ASBindGen WriteIncludes in template file.
    2. Writes bindables wrappers if needed, then write bindables registrators. Replaces //@ASBindGen WriteBody in template file.

Note: ASBindGen writes project internal includes as #include <${projectDir}/${includePath}>.