Computer Science
Switch Case Statement Compiler Design
Case Statement The “case” or “switch” statement is available in various languages. The following is the syntax for the case statement: 1 2 3 4 5 6 7 8 9 switch (E) { case Read more…
Case Statement The “case” or “switch” statement is available in various languages. The following is the syntax for the case statement: 1 2 3 4 5 6 7 8 9 switch (E) { case Read more…
Translation of Array References We can access the elements of an array stored in consecutive blocks very easily and quickly. In a programming language like C and Java, the size of an array is one Read more…
Machine-Independent Optimizations The main aim of machine-independent optimization is to improve the generated intermediate code so that compiler can get better target code. Eliminating unwanted code from the object code or replacing one set of Read more…
Boolean Expression The translation of conditional statements such as if-else statements and while-do statements is associated with Boolean expression’s translation. The main use of the Boolean expression is the following: Boolean expressions are used as Read more…
Intermediate-Code Generator The process of translating a source language into machine code for a given target machine is done by intermediate-code. It lies between the high-level language and the machine language. See the below image Read more…
Basic Blocks and Flow Graphs In this section, we are going to learn how to work with basic block and flow graphs in compiler design. Basic Block The basic block is a set of statements. Read more…
Data Flow Analysis All the optimization techniques we have learned earlier depend on data flow analysis. DFA is a technique used to know about how the data is flowing in any control-flow graph. Example: Forglobal Read more…
Optimization of Basic Blocks We can apply the optimization process on a basic block. While optimization, there is no need to change the set of expressions computed by the block. The basic block optimization can Read more…
In this article, we will learn Derivation and Parse Tree. Derivations The parse tree can be constructed by taking a derivational view in which production is treated as rewriting rules. In each rewriting step, a Read more…
This article will describe the parsing method used in the compiler. The grammatical rule of programming language can be constructed with the help of context-free grammars or BNF (Backus–Naur form) notations. The grammar offers some Read more…