Scope & closures Flashcards
Tokenizing / lexing
Breaking up a string of characters in source code into meaningful chunks.
Parsing
Taking a stream (array) of tokens and turning it into a tree of nested elements, which collectively represent the grammatical structure of the program. This tree is called the “Abstract Syntax Tree”, or AST.
Code-generation
The process of taking an AST and turning it into executable code. This process will vary greatly depending on the language, the platform it’s targeting, etc.
Scope
The set of rules that determines where and how a variable (identifier) can be looked up.
LHS lookup
A lookup for the purposes of assigning a value to a variable.
RHS lookup
A lookup for the purposes of retrieving the value stored in a variable.
The type of error thrown on unfulfilled RHS lookups (when in strict mode)
ReferenceError
The type of error thrown on unfulfilled LHS lookups
TypeError