-
Notifications
You must be signed in to change notification settings - Fork 52
Developer Guide
This document is intended for people planning to make changes to, and fix bugs in, the Royale Compiler.
The Royale Compiler is a set of Java projects. Eclipse is used by most of the developers working on the compiler, but you can just use any text editor and Apache Maven or Apache Ant to compile and test your changes. For Eclipse setup instructions see this document Eclipse Setup.
The compiler uses several third-party libraries. The ActionScript parsing is handled by Antlr 3. MXML parsing uses JFlex. SWF output uses JBurg. SWF output also uses LZMA for SWF compression. JS output uses Google Closure Library. JUnit is used for testing. And Apache Commons and Guava are used throughout. Volunteers who want to consolidate the parsing to use, say, Antlr 4 are welcome.
The compiler projects are described below and listed in build dependency order.
These two projects rarely, if ever, change and thus aren't even in the main Maven build. You will probably never need to know what is in these projects.
- compiler-build-tools - utility classes that are used during the build to generate other classes
- compiler-jburg-types - classes that need to be compiled early by Maven for compiling against JBurg later
These next 4 are the main projects for the compiler.
- compiler-common - classes shared by all (or most) of the various compilers.
- compiler-externc - "Externs Compiler" classes used to generate Typedefs SWCs from Google Closure externs. Typedefs are used to represent external libraries.
- compiler - This project contains the parsers and lexers and SWF output code.
- compiler-jx - This project is the transpiler. It can be configured to output JavaScript and just about anything else.
The rest of the projects don't get touched too often.
- compiler-test-utils - This project contains utilities for testing. It abstracts the differences between where Maven and Ant like to put output files and lets you setup variables that point to other dependencies.
- swfutils - These are classes copied from the Flex SDK used by debugger and flex-compiler-oem projects to parse SWFs. These are unlikely to ever be modified.
- debugger - The command-line debugger. Many IDEs use the debugger underneath a graphical user interface.
- flex-compiler-oem - This code is used to integrate the compiler with Adobe Flash Builder. Other IDEs might use it as well.
- royale-ant-tasks - The Apache Ant integration project.
- royale-maven-plugin - The Apache Maven integration project.