Found 205 Articles for Computer Programming

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

4K+ 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

6K+ 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

10K+ 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

What are the operations on sequential files in compiler design?

Ginni
Updated on 23-Oct-2021 11:16:39

3K+ Views

The major operations on sequential files are as follows −Creating a file − The primary creation of a file is also defined as the loading of the file. In some implementations, space is first designated to the file, thus the data are loaded into that Skelton.Opening a file − Before a program can access a file for input or output, that file must be opened. The open operation is given the name of a file and the access mode (read or write). In Pascal, the procedure reset opens a file in read mode and the procedure rewrite opens a file ... Read More

What are the specifications and operations of data structures in compiler design?

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

687 Views

The major attributes for specifying data structures include the following −Number of components − A data structure can be of fixed size if the number of components is even during its lifetime or of the variable size if the number of components transforms dynamically. Variable size data structure types generally define operations that insert and delete elements from structures.Arrays and records are examples of fixed-size data structure types. Stacks, lists, sets, tables, and files are an example of variable size data types. Variable size data objects use a pointer data type that enables fixed-size data objects to be connected explicitly ... Read More

Advertisements