Compiler Theory
This theory is basically just a reference to compiler construction, which is the underlying mechanics of how a programming language operates. For JS, there are 3 main processes that the code goes through before executing:
- Tokenizing/Lexing: The engine first breaks the code into parts/chunks, and not the way you would think it would. For example, var a = 2 is broken up into 2 parts. The first part is 'var a' (LHS) and the second part is '= 2' (RHS).
- Parsing: The parts of code are then converted into a tree like structure (Abstract Syntax Tree) that is grammatically representative of the structure of the overall code.
- Turns the AST into executable code, which is dependent on the platform
References:
http://stackoverflow.com/questions/tagged/compiler-theory
http://www.cse.msu.edu/rgroups/sens/Software/Telelogic-3.5/locale/english/help/htmlhlp/comptheory.html
http://www.diku.dk/~torbenm/Basics/basics_lulu2.pdf
No comments:
Post a Comment