1.4 Compilation and Interpretation The process of compilation and interpretation are almost similar because they are aimed at changing the source code to a form that a machine can understand. The only difference between the two is that while compilation involves a the generation of a machine code only once Ty Montgomery Packers Jersey , interpretation entails the analysis and interpretation of the same code every time it encounters the same program statements. The process of compilation entails the source code being passed through the scanner for the purpose of lexical analysis; it is passed via the parser that analyzes its syntax. The code is then analyzed for semantic errors, and an intermediate machine code has generation. The intermediate code from the basis of the target code generation and in some machines the target code can have improvement in light of the specific machine in which the compilation is taking place. The lexical analysis takes place using the scanner whereas syntax analysis takes place using the parser. Lexical analysis is aimed at identifying each work and then assigning meaning to it. On the other hand Montravius Adams Packers Jersey , the aim of syntactic analysis is to verify if the code was written following the syntax of the programming language being used. The generation of a good code cannot take place in just a single pass, and that is the reason the source code ahs to have translation taking place to produce an intermediate code. Wit is after which the checking of semantic errors takes place for the purpose of deriving making the code more meaningful. The target code is then generated based on the information of the syntax tree. The code improvement is optional Josh Jones Packers Jersey , but it is equally essential to the purpose of efficient computation of the same result. Chapter 2 2.2 Scanning 51 actic structure, and it is the work of the scanner to accomplish that. It groups the input characters to produce tokens or words Kenny Clark Packers Jersey , thereby reducing the number of items that the parser needs to inspect. Scanners can be built in a way that looks less the same as a finite automaton. The generation of finite automaton takes pace using the patterns or expressions within the input of specific character set. A finite automaton has the function of accepting or rejecting the input provided based on the pattern defined. The scanner codes can have generation using the table-driven format or the automatic format by the finite automaton. Table-driven scanning entails the representation of an automaton in the form of a data structure whereby there are keywords in the table where the scanner can look up. The generated scanner code can recognize lexical errors and then print a message that to upon which the next step of compilation cane be determined. Some languages can consist of programs to tell the compiler what it should do, and they can occur anywhere in the program. 2.3 Parsing Parsing entails the parser calling the scanner to get the tokens that are within a given input program which is then passed to the compiler to carry out the subsequent phases. The process of parsing either occurs from the bottom up or top down. The recursive descent parser has its subroutines corresponding to the grammar鈥檚 non-terminals. They recursive descent parsers can have creation either by hand or automatically where the latter takes place using the ANTLR. The recursive descent parsers comprise of case statements with arms that correlate with the production Jamaal Williams Packers Jersey , and they have parsing routines that correlate to the symbol in the RHS of the production. In top-down table-driven parsing, the similar symbols as those found in the recursive descent parser are also present. An automatic tool creates a parsing table that contains those symbols starting from the top-down. Bottom-up parsing works almost in a similar way to top-down parsing although the bottom-up uses partially completed subtrees derived from the parse tree. Syntax error recovery is essential while parsing as it helps in the discovery of any syntax errors in a program being compiled. Chapter 3 Scope Rules 121 There are rules that determine to which extent binding should take place. Scoping can take place during the time of program compilation or later after the compilation. The former is known as static scoping and the languages that leverage it such as FORTRAN that partition global variables to produce the common blocks that can then have importation by the subroutines.