This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/royale-compiler.wiki.git
The following commit(s) were added to refs/heads/master by this push: new 52394da Updated Developer Guide (markdown) 52394da is described below commit 52394dad6f35fcdb03a065204c7f7141a82c9aa5 Author: aharui <aha...@apache.org> AuthorDate: Thu May 31 16:38:59 2018 -0700 Updated Developer Guide (markdown) --- Developer-Guide.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Developer-Guide.md b/Developer-Guide.md index a305484..2af6205 100644 --- a/Developer-Guide.md +++ b/Developer-Guide.md @@ -32,4 +32,8 @@ The compiler has a set of "clients" that are entry points into the compiler. Th The compiler-jx project also introduces the concept of a "target" which is a set of emitters and an optional "publisher". A publisher takes the output and does some post-processing. The default Royale Publisher for JavaScript calls the Google Closure Compiler to optimize the output JS. There is a Cordova Publisher that further calls Apache Cordova command-line commands to package the JavaScript for use as a Cordova application. The user can specify more than one target at a time. Th [...] -Pretty much all targets start execution the same way: They build an Abstract Syntax Tree (AST). \ No newline at end of file +Pretty much all targets start execution the same way: They build an Abstract Syntax Tree (AST). An AST is a tree data structure with nodes that represent the parsed source code. The top of the tree is a FileNode and usually the first child is a PackageNode and children of that might be ImportNodes and a ClassNode and children of the ClassNode will be FunctionNodes that contain ParameterNodes and ExpressionNodes and so on. At the bottom of the tree should be IdentifierNodes and LiteralNodes. + +What happens next is different for SWF output vs JavaScript output. In the SWF output, the JBurg "reducer" is called to reduce patterns of nodes into SWF output byte code. This reducer works from the bottom of the tree upward. This supposedly makes it easier and more efficient to identify possible optimizations such as collapsing constant expressions, and identify semantic errors. + +The JavaScript output also runs the reducer to help identify semantic errors. But if none are found it then walks the AST from the top FileNode down, along the way "emitting" whatever output is desired. There are emitters that just output the ASDoc into JSON files which is how we generate our ASDoc today. There is an emitter that outputs ActionScript just to prove that the AST has not lost information. There is an emitter than outputs vanilla JavaScript. But the main emitter class ( [...] \ No newline at end of file -- To stop receiving notification emails like this one, please contact aha...@apache.org.