Found 146 Articles for Compiler Design

What is the role of Compiler Construction Tools?

Ginni
Updated on 23-Oct-2021 11:36:31

7K+ Views

A compiler is a computer program that converts source code written in a computer language (the source language) into another computer language (the target language, providing having a binary form referred to as object code). The best reason for inadequate to convert source code is to create an executable code.The compiler is generally used for programs that translate source code from a high-level programming language to a lower-level language (e.g., assembly language or machine code). A program that translates from a low-level language to a higher level one is a decompiler.A program that translates between high-level languages is generally known ... Read More

What is Compiler Bootstrapping?

Ginni
Updated on 23-Oct-2021 11:33:58

8K+ Views

It is an approach for making a self-compiling compiler that is a compiler written in the source programming language that it determine to compile. A bootstrap compiler can compile the compiler and thus you can use this compiled compiler to compile everything else and the future versions of itself.Uses of BootstrappingThere are various uses of bootstrapping which are as follows −It can allow new programming languages and compilers to be developed starting from actual ones.It allows new features to be combined with a programming language and its compiler.It also allows new optimizations to be added to compilers.It allows languages and ... Read More

What is the difference between Macro-Processors and Pre-Processors?

Ginni
Updated on 23-Oct-2021 11:32:15

2K+ Views

Macro-ProcessorsMany assembly languages support a “macro” facility whereby a macro statement will translate into a sequence of assembly language statements and possibly other macro statements before being translated into a machine program. Therefore, a macro facility is a text replacement capability.It can illustrate the utility of macros, consider a situation in which a machine does not have a single machine or assembly language statement that adds the contents of one memory address to another as hypothetical assembly instruction ADD X, Y. Instead, suppose the machine has an instruction LOAD, which moves a datum from memory to a register, an instruction ... Read More

What is error handling in compiler design?

Ginni
Updated on 23-Oct-2021 11:30:29

4K+ Views

Detection and reporting of errors in the source program is the main function of the compiler. An error can occur at any phase of compilation. A good compiler must determine the line number of the program exactly, where the errors have occurred. Various errors that can occur at a different level of compilation are as follows −The first of these are lexical (scanner) errors − Some of the most common types here consist of illegal or unrecognized characters, mainly, caused by typing errors. A common way for this to happen is for the programmer to type a character that is ... Read More

What is the difference between Imperative languages and Functional languages in compiler design?

Ginni
Updated on 23-Oct-2021 11:28:36

3K+ Views

Imperative LanguagesImperative languages are those which facilitate the computation by mean of state changes. By a state, it means the condition of a computer’s random access memory (RAM) or storage. It is helpful to think of computer memory as a sequence of snapshots, each one capturing the values in all memory cells at a particular time. Each snapshot records a state.When a program is entered, associated data exists in a certain condition, say an unsorted list off-line. It is the programmer’s job to specify a sequence of changes to the store that will produce the desired final state, perhaps a ... Read More

What is the difference between Procedural and Non-Procedural Languages in compiler design?

Ginni
Updated on 23-Oct-2021 11:26:54

8K+ Views

Procedural LanguagesProcedural languages are command-driven or statement-oriented languages. A program includes a sequence of statements, and the implementation of each statement generates the interpreter to modify the value of one or more areas in its memory that enters a new state.The format of procedural languages arestatement1;statement2;C, Pascal, FORTRAN, and equivalent languages are procedural languages. Each statement in the language communicates the computer to do something. A program in a procedural language is a list of instructions. For very small programs, no other arranging principle is required. Such language includes a sequence of procedures that execute when called. Each procedure includes ... Read More

What is Storage Management?

Ginni
Updated on 23-Oct-2021 11:25:24

3K+ Views

The compiler demands a block of memory for the operating system. The compiler uses this block of memory to implement the compiled program. This block of memory is known as storage management. A compiler should execute is to designate the resources of the target machine to define the data objects that are being manipulated by the source code.There are three basic storage management phases are as follows −Initial allocation − Initially each piece of storage is either free or in use. If free, it is available for dynamic allocation as the execution proceeds. A storage management system needed several methods ... Read More

What is the difference between Sequence control and data control?

Ginni
Updated on 23-Oct-2021 11:23:52

5K+ Views

Sequence ControlSequence control defines the line-by-line implementation by which statements are implemented sequentially, in the equivalent order in which they occur in the program. It can move out a sequence of read or write operations, arithmetic operations, or assignments to variables. A sequence control structure can be either implicit or explicit.Implicit Sequence Control − Implicit sequence control structures are those represented by the language. Implicit sequence control is decided by the sequence of the statements in the source code or by the built-in implementation model. The implicit sequence control structure tends to be in consequence except that transformed by the ... Read More

What is the difference between Subprograms and Coroutines?

Ginni
Updated on 23-Oct-2021 11:20:06

2K+ Views

SubprogramsA subprogram is defined as a set of statements that can be reused at multiple places in a program when convenient. This reuse results in multiple types of savings, from memory space to coding time. Such reuse is also an abstraction, for the analysis of subprograms computations are restored in a program by a statement that calls the subprogram.Features of SubprogramsThe features of subprograms are as follows −A subprogram has a single entry point.The caller is suspended during the implementation of the called subprogram.Control continually returns to the caller when the called subprogram’s execution eliminates.Advantages of subprogramsThere are the following ... Read More

What are Subprograms?

Ginni
Updated on 23-Oct-2021 11:18:33

9K+ Views

A subprogram is defined as a set of statements that can be reused at multiple places in a program when convenient. This reuse results in multiple types of savings, from memory space to coding time. Such reuse is also an abstraction, for the analysis of subprograms computations are restored in a program by a statement that calls the subprogram.Features of SubprogramsThe features of subprograms are as follows −A subprogram has a single entry point.The caller is suspended during the implementation of the called subprogram.Control repeatedly returns to the caller when the called subprogram’s execution eliminates.Types of SubprogramsThere are two types ... Read More

Advertisements